Skip to content

Conversation

knollengewaechs
Copy link
Contributor

@knollengewaechs knollengewaechs commented Mar 12, 2025

This reverts commit 196b946.
Command was already taken
https://scm.slack.com/archives/C02H5T8Q08P/p1741802492141839

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • abc

TODOs:

  • ...

Issues:

  • fixes #

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

@knollengewaechs knollengewaechs self-assigned this Mar 12, 2025
Copy link
Contributor

coderabbitai bot commented Mar 12, 2025

📝 Walkthrough

Walkthrough

The PR removes the command palette feature and its related components, styles, and dependencies. It eliminates legacy utility functions and tool name constants in favor of new localized definitions while refactoring modal management by removing associated state properties, action types, reducer cases, and handler functions. Additionally, the PR updates menu item structures, navigation paths, and cleans up CSS variables and package dependencies.

Changes

File(s) Summary
CHANGELOG.unreleased.md
frontend/javascripts/oxalis/view/components/command_palette.tsx
frontend/javascripts/oxalis/view/components/command_palette_theme.tsx
frontend/javascripts/oxalis/view/statusbar.tsx
frontend/javascripts/router.tsx
package.json
frontend/stylesheets/command_palette.less
frontend/stylesheets/main.less
Removed the command palette feature, its themes, UI elements, and associated package dependencies.
frontend/javascripts/oxalis/default_state.ts
frontend/javascripts/oxalis/model/actions/ui_actions.ts
frontend/javascripts/oxalis/model/reducers/ui_reducer.ts
frontend/javascripts/oxalis/store.ts
frontend/javascripts/oxalis/view/action-bar/tracing_actions_view.tsx
Removed modal state properties, action types, reducer cases, and refactored modal handling directly within component state.
frontend/javascripts/oxalis/model/accessors/tool_accessor.ts
frontend/javascripts/oxalis/view/action-bar/toolbar_view.tsx
frontend/javascripts/navbar.tsx
Removed outdated tool name constants and helper methods; introduced a new in-file TOOL_NAMES constant and updated navigation paths.
frontend/javascripts/libs/utils.ts
frontend/javascripts/oxalis/view/action-bar/view_dataset_actions_view.tsx
Removed the camel case conversion utility and streamlined inline menu item definitions while updating import paths.
frontend/stylesheets/_variables.less Removed obsolete color variables from the root stylesheet.

Possibly related PRs

Suggested reviewers

  • MichaelBuessemeyer
  • daniel-wer

Poem

I'm a little rabbit, hopping through the code,
Leaving old command palettes on the lonesome road.
Modals vanish, and tools are redefined,
With changes clear and streamlined.
A joyful skip in every crafted line—
Hoppy updates for code so fine! 🐇

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 369630a and 9a7a389.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (19)
  • CHANGELOG.unreleased.md (0 hunks)
  • frontend/javascripts/libs/utils.ts (0 hunks)
  • frontend/javascripts/navbar.tsx (2 hunks)
  • frontend/javascripts/oxalis/default_state.ts (0 hunks)
  • frontend/javascripts/oxalis/model/accessors/tool_accessor.ts (0 hunks)
  • frontend/javascripts/oxalis/model/actions/ui_actions.ts (0 hunks)
  • frontend/javascripts/oxalis/model/reducers/ui_reducer.ts (0 hunks)
  • frontend/javascripts/oxalis/store.ts (0 hunks)
  • frontend/javascripts/oxalis/view/action-bar/toolbar_view.tsx (1 hunks)
  • frontend/javascripts/oxalis/view/action-bar/tracing_actions_view.tsx (8 hunks)
  • frontend/javascripts/oxalis/view/action-bar/view_dataset_actions_view.tsx (2 hunks)
  • frontend/javascripts/oxalis/view/components/command_palette.tsx (0 hunks)
  • frontend/javascripts/oxalis/view/components/command_palette_theme.tsx (0 hunks)
  • frontend/javascripts/oxalis/view/statusbar.tsx (1 hunks)
  • frontend/javascripts/router.tsx (0 hunks)
  • frontend/stylesheets/_variables.less (0 hunks)
  • frontend/stylesheets/command_palette.less (0 hunks)
  • frontend/stylesheets/main.less (0 hunks)
  • package.json (0 hunks)
💤 Files with no reviewable changes (14)
  • CHANGELOG.unreleased.md
  • frontend/stylesheets/main.less
  • frontend/javascripts/oxalis/store.ts
  • frontend/javascripts/oxalis/view/components/command_palette_theme.tsx
  • frontend/javascripts/oxalis/model/accessors/tool_accessor.ts
  • package.json
  • frontend/javascripts/oxalis/model/reducers/ui_reducer.ts
  • frontend/javascripts/oxalis/view/components/command_palette.tsx
  • frontend/javascripts/router.tsx
  • frontend/javascripts/oxalis/default_state.ts
  • frontend/javascripts/oxalis/model/actions/ui_actions.ts
  • frontend/javascripts/libs/utils.ts
  • frontend/stylesheets/_variables.less
  • frontend/stylesheets/command_palette.less
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: circleci_build
🔇 Additional comments (32)
frontend/javascripts/oxalis/view/statusbar.tsx (1)

49-51: Style change improves layout flexibility.

Changing marginRight from a fixed value to "auto" allows the element to better utilize available space and improves layout responsiveness. This change aligns with the removal of the CommandPalette component that was previously displayed in this area.

frontend/javascripts/oxalis/view/action-bar/toolbar_view.tsx (1)

834-848: Good refactoring: Localized tool name definitions.

Moving the TOOL_NAMES constant directly into this file instead of importing it from tool_accessor module improves code maintainability by keeping related functionality together. This is a positive change that reduces external dependencies.

frontend/javascripts/navbar.tsx (2)

203-203: Function accessibility properly restricted.

Removing the export keyword from getAdministrationSubMenu appropriately restricts its accessibility to within this module, which is good practice as this function doesn't appear to be used externally.


248-248:

❓ Verification inconclusive

URL path key simplified.

Changing the menu item key from a dynamic path to a static /organization simplifies the URL structure. However, ensure this doesn't affect any code that might be relying on this key for navigation or identification purposes.


🏁 Script executed:

#!/bin/bash
# Check if there are any other references to this specific key format in the codebase
rg -A 2 -B 2 "key: \"/organizations/\$\{.*?\}\""

Length of output: 47


Static key '/organization' usage reviewed – please double-check dependent navigation routines.

The update simplifies the menu key by using a static /organization instead of a dynamic path. Our initial search for the dynamic pattern (e.g., /organizations/${…}) did not return any results, suggesting there are no residual references in the codebase. However, since the automated output was inconclusive, please manually verify that no navigation or identification logic elsewhere relies on the original dynamic key.

  • Review any routing or menu-handling functions that may reference dynamically generated keys.
  • Confirm that the removal of interpolation does not break contextual dependencies in navigation.
frontend/javascripts/oxalis/view/action-bar/view_dataset_actions_view.tsx (2)

9-9: Updated import path to use ES modules.

Updating the import path from "antd/lib/menu/interface" to "antd/es/menu/interface" aligns with modern ES module standards and is likely part of a broader update to antd dependency handling.


66-84: Menu structure refactored for better readability.

The menu items are now defined directly inline within the overlayMenu object rather than using separate constants. This refactoring:

  1. Makes the code more concise by removing intermediate variables
  2. Improves readability by placing related items together
  3. Maintains the same functionality with a cleaner structure

This change aligns with the overall refactoring of menu item structures mentioned in the PR summary.

frontend/javascripts/oxalis/view/action-bar/tracing_actions_view.tsx (26)

36-36: New type imports correctly support new menu item implementation.

The addition of the ItemType and SubMenuType types from Ant Design's menu interface provides proper typing for the menu items in the refactored implementation.


87-89: Props type properly updated.

The update to the OwnProps type now correctly specifies that layoutMenu is of type SubMenuType to match the Ant Design menu interface types. The Props type correctly combines OwnProps and StateProps.

Also applies to: 105-105


106-110: Component state now properly manages modal visibility locally.

The state now includes boolean flags for tracking modal visibility (isMergeModalOpen, isUserScriptsModalOpen, isZarrPrivateLinksModalOpen), which is a better approach than the previous Redux-based modal visibility management. This localizes UI state to the component that needs it.


320-323: Restored the handleRestore method.

This method correctly ensures the state is saved before displaying the version restore modal. The implementation follows the pattern of waiting for state to be saved before modal interactions.


334-341: Properly implemented handleDuplicate method.

The method correctly:

  1. Ensures the state is saved before duplication
  2. Calls the API to duplicate the annotation
  3. Opens the new annotation in a new tab with proper security attributes

376-386: Refactored the handleFinish method.

The method correctly ensures the state is saved before showing a confirmation dialog to finish the annotation. Upon confirmation, it calls the appropriate API and redirects to the dashboard.


388-396: Restored handleDisableSaving method.

This method correctly shows a confirmation dialog before dispatching the disableSavingAction.


398-412: Restored modal visibility handlers for share and download.

These handlers properly dispatch the appropriate actions to show/hide the share and download modals.


438-442: Added handleMergeOpen method for local state management.

This method properly updates the component's local state to show the merge modal, which is a better approach than the previous Redux-based visibility management.


444-448: Added handleUserScriptsOpen method for local state management.

This method properly updates the component's local state to show the user scripts modal, following the same pattern as the other modal handlers.


450-455: Added handleModalClose method for local state management.

This method correctly resets multiple modal visibility flags in a single call, which is more efficient than having separate close handlers for each modal.


457-474: Implementation of handleChangeLockedStateOfAnnotation method.

This method correctly:

  1. Ensures the state is saved before changing the locked state
  2. Calls the API to update the locked state
  3. Shows appropriate success/error messages
  4. Handles errors properly with detailed messaging

477-478: Restored viewMode and controlMode retrieval.

The code correctly retrieves viewMode and controlMode from the Redux store and checks if the current mode is a skeleton mode.


588-589: Clean approach to menu items and modals construction.

The code now uses separate arrays (menuItems and modals) to construct the menu items and modals, which makes the code more organized and easier to read than the previous implementation.


591-598: Correct implementation of finish menu item.

The code correctly adds a finish menu item to the menu items array when allowed by restrictions.


600-615: Download modal implementation.

The code properly adds the download menu item and modal when allowed by restrictions. The modal is correctly passed the necessary props including the visibility state from Redux.


617-629: Share and Zarr links implementations.

These menu items are correctly added to the menu items array. The Zarr links button uses the local state to control modal visibility.


631-647: Modal implementations for share and Zarr links.

Both modals are correctly added to the modals array with the appropriate props. The ShareModalView uses visibility from Redux while PrivateLinksModal uses the local component state.


648-655: Duplicate functionality when user is logged in.

The duplicate button is correctly added to the menu only when a user is logged in, which prevents unauthorized access to the duplication feature.


657-666: Screenshot and animation functionality.

These items are correctly added to the menu items array, and the animation modal is properly configured with visibility from Redux.


668-680: User scripts modal implementation.

The menu item and modal for adding scripts are correctly implemented using the local component state for visibility.


682-696: Merge functionality for skeleton mode.

The merge functionality is correctly restricted to skeleton mode and when a user is logged in. The modal uses the local component state for visibility.


697-704: Restore functionality for non-sandbox mode.

The restore button is correctly added only when not in sandbox mode, which prevents conflicts with the sandbox's ephemeral nature.


706-706: Layout menu integration.

The layout menu is correctly added to the menu items array, reusing the existing layoutMenu prop.


708-715: Disable saving option.

The disable saving option is correctly added only when saving is allowed and not in a task context.


716-723: Lock/unlock annotation functionality.

This feature is correctly restricted to annotation owners only and displays either "Lock Annotation" or "Unlock Annotation" based on the current locked state.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@knollengewaechs knollengewaechs enabled auto-merge (squash) March 12, 2025 18:14
@knollengewaechs knollengewaechs merged commit 877e457 into master Mar 12, 2025
3 checks passed
@knollengewaechs knollengewaechs deleted the revert-command-palette branch March 12, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants