Skip to content

Conversation

hotzenklotz
Copy link
Member

This PR update some modals to:

  1. Use antd default props to achieve things like hiding the footer buttons
  2. Make them closable by clicking into the mask outside the modal.

There remained 14 modals that can not be closed by just clicking outside them in the background. I looked through the list and for those modals I agree that they should not be (accidentally) closable but rather the user should be forced to make a decision by clicking one the Ok/Cancel/etc buttons.

Screenshot 2025-08-22 at 11 24 48

Issues:


(Please delete unneeded items, merge only when none are left open)

  • Added changelog entry (create a $PR_NUMBER.md file in unreleased_changes or use ./tools/create-changelog-entry.py)
  • Added migration guide entry if applicable (edit the same file as for the changelog)
  • Updated documentation if applicable
  • Adapted wk-libs python client if relevant API parts change
  • Removed dev-only changes like prints and application.conf edits
  • Considered common edge cases
  • Needs datastore update after deployment

@hotzenklotz hotzenklotz self-assigned this Aug 22, 2025
Copy link
Contributor

coderabbitai bot commented Aug 22, 2025

📝 Walkthrough

Walkthrough

Replaces Ant Design Modal footer-hiding via CSS/props with footer={null} in dataset views, adjusts mask closability on several modals by removing maskClosable={false}, and tidies confirm dialog options. Updates _utils.less by removing .no-footer-modal, adding dragging helpers, and minor selector/clearfix tweaks.

Changes

Cohort / File(s) Summary
Admin dataset modals
frontend/javascripts/admin/dataset/dataset_add_view.tsx, frontend/javascripts/admin/dataset/dataset_upload_view.tsx
Switched modal footer suppression to footer={null}; removed reliance on CSS class and ok/cancel button props for hiding footer.
Admin user modal
frontend/javascripts/admin/user/experience_modal_view.tsx
Removed maskClosable={false} to use default mask closability.
Viewer modals
frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx, frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx
AddVolume: removed maskClosable={false}; Layer settings confirm: removed explicit maskClosable and closable, relying on defaults.
Styles / utilities
frontend/stylesheets/_utils.less
Removed .no-footer-modal; added .grabbing, .is-dragging (and descendant rules) and a clearfix::after; minor selector spacing tweak.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
All modals should be closeable by clicking gray backdrop (#5367) Some modals now likely mask-closable (Experience, Add Volume). For the delete confirmation, removing maskClosable: true may revert to default (often not mask-closable). Coverage across all modals isn’t verifiable from this diff.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Replace CSS-based no-footer with footer={null} in dataset modals (frontend/javascripts/admin/dataset/dataset_add_view.tsx, .../dataset_upload_view.tsx) Footer presentation changes are unrelated to mask/backdrop closability objective.
Remove .no-footer-modal CSS (frontend/stylesheets/_utils.less) Styling cleanup not tied to backdrop closability requirement.
Add dragging state classes (.grabbing, .is-dragging) (frontend/stylesheets/_utils.less) New cursor and user-select rules are unrelated to modal backdrop behavior.
Add clearfix::after helper (frontend/stylesheets/_utils.less) Utility clearfix addition not connected to the backdrop closability objective.

Possibly related PRs

Suggested labels

frontend, usability, css, refactoring

Suggested reviewers

  • philippotto
  • MichaelBuessemeyer

Poem

I thump with glee at modals light,
Their gray skies now invite a click-goodnight.
Footers vanish—poof!—so neat,
Dragging paws get grippy feet.
A hop, a pop, a backdrop close—
Such tidy UI, a rabbit knows! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch closable-modals

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

display: "none",
},
}}
footer={null}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm:
Image

title: `Deleting an annotation layer makes its content and history inaccessible. ${fallbackLayerNote}This cannot be undone. Are you sure you want to delete this layer?`,
okText: `Yes, delete annotation layer “${readableAnnotationLayerName}”`,
cancelText: "Cancel",
maskClosable: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmAsync uses a Modal.confirm under the hood. The intent of a confirm is to force a user decision. Therefore, both these options are not part of the defaults. I think that is sensible and we should not change the default behavior.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was auto-formatted while saving.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
frontend/javascripts/admin/dataset/dataset_add_view.tsx (1)

271-280: Post-upload modal still blocks backdrop-click close; also remove unused onOk

This PR aims to make modals closable by clicking the mask. Here, maskClosable={false} prevents that. Also, with footer={null}, there is no OK button, so onOk is dead code.

Apply:

   return (
     <Modal
       open
       closable
-      maskClosable={false}
+      maskClosable
       footer={null}
       onCancel={() => setDatasetId("")}
-      onOk={() => setDatasetId("")}
       width={580}
     >
frontend/stylesheets/_utils.less (1)

52-63: Fix first/last-child selectors to target children, not the container

&:first-child / &:last-child select .centered-items when it is the first/last child of its parent. The intent here appears to be targeting the first/last direct child inside .centered-items.

 .centered-items {
   display: flex;
   flex-direction: row;
   justify-content: center;

-  &>* {
+  &>* {
     margin: 6px;
   }

-  &:first-child {
-    margin-left: 0px;
-  }
-
-  &:last-child {
-    margin-right: 0px;
-  }
+  & > *:first-child {
+    margin-left: 0;
+  }
+
+  & > *:last-child {
+    margin-right: 0;
+  }
 }
🧹 Nitpick comments (2)
frontend/javascripts/admin/dataset/dataset_upload_view.tsx (1)

491-497: Consider enabling mask close (or document why this is one of the 14 exceptions)

You switched to footer={null} (good), but maskClosable={false} still blocks backdrop-click closing, which may be intended for an in-progress upload. If this modal is not one of the 14 deliberate exceptions, enable mask close. If it is an exception, add a brief code comment stating why.

Proposed change (keeps keyboard={false} to avoid accidental ESC closes, still routes through onCancel → confirm dialog):

   <Modal
     open={isUploading}
     keyboard={false}
-    maskClosable={false}
+    maskClosable
     footer={null}
     onCancel={this.cancelUpload}
   >

If you intentionally keep it non-closable by mask, consider:

-    maskClosable={false}
+    // Keep mask non-closable to force explicit confirmation via onCancel
+    maskClosable={false}
frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx (1)

230-232: Make the intention explicit: allow backdrop-click close

You removed the explicit maskClosable={false}. To avoid relying on library defaults and to align with the PR goal, set maskClosable explicitly.

-  <Modal title="Add Volume Annotation Layer" footer={null} width={500} onCancel={onCancel} open>
+  <Modal
+    title="Add Volume Annotation Layer"
+    footer={null}
+    width={500}
+    onCancel={onCancel}
+    open
+    maskClosable
+  >
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between de553c2 and 80bdfb0.

📒 Files selected for processing (6)
  • frontend/javascripts/admin/dataset/dataset_add_view.tsx (2 hunks)
  • frontend/javascripts/admin/dataset/dataset_upload_view.tsx (1 hunks)
  • frontend/javascripts/admin/user/experience_modal_view.tsx (0 hunks)
  • frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx (0 hunks)
  • frontend/javascripts/viewer/view/left-border-tabs/modals/add_volume_layer_modal.tsx (1 hunks)
  • frontend/stylesheets/_utils.less (4 hunks)
💤 Files with no reviewable changes (2)
  • frontend/javascripts/viewer/view/left-border-tabs/layer_settings_tab.tsx
  • frontend/javascripts/admin/user/experience_modal_view.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-smoketest-push
  • GitHub Check: backend-tests
  • GitHub Check: frontend-tests
🔇 Additional comments (4)
frontend/javascripts/admin/dataset/dataset_add_view.tsx (1)

329-329: No-op formatting change — looks fine

Nothing to do here.

frontend/stylesheets/_utils.less (3)

75-80: Clearfix addition looks good

Adding clearfix::after with clear: both complements the existing ::before and resolves float clearing reliably.


139-156: Dragging state utilities — LGTM

The .grabbing / .is-dragging rules are scoped and should not affect normal interactions. Good addition.


52-55: No lingering .no-footer-modal references found
A project-wide search for no-footer-modal returned no matches, confirming that the CSS helper can be safely removed.

Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for doing this clean up.

Please add a changelog entry file before merging

@hotzenklotz hotzenklotz enabled auto-merge (squash) August 25, 2025 09:00
@hotzenklotz hotzenklotz merged commit cdbd039 into master Aug 25, 2025
5 checks passed
@hotzenklotz hotzenklotz deleted the closable-modals branch August 25, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All modals should be closeable by clicking gray backdrop
2 participants