Skip to content

Sequence metadata UI#1901

Open
AaronPlave wants to merge 28 commits intodevelopfrom
feat/sequence-metadata-ui
Open

Sequence metadata UI#1901
AaronPlave wants to merge 28 commits intodevelopfrom
feat/sequence-metadata-ui

Conversation

@AaronPlave
Copy link
Copy Markdown
Contributor

@AaronPlave AaronPlave commented Mar 27, 2026

___REQUIRES_AERIE_PR___="1807"

Corresponding backend branch NASA-AMMOS/plandev#1807. Closes #1767

Summary

  • Workspace file metadata UI: Added metadata columns (Last Editor, Last Edited, Created By, Created, Version, Read-Only, User Metadata) to the file browser with a column picker, metadata banner in the editor header with a read-only toggle, and a dedicated right-side metadata panel with a user metadata JSON editor (edit/save/cancel flow)
  • Workspace layout refactor: Broke workspace page into separate components - WorkspaceLeftIconRail, WorkspaceRightIconRail, WorkspaceRightPanel, WorkspaceMetadataPanel, FileMetadataBanner, and PanelHeader - with resizable left/right sidebar panels and independent icon rails
  • Tooltip wrapper improvements: Switched SidebarMenuButton and sidebar icon rails to use the shared Tooltip.svelte wrapper for consistent behavior, instant tooltips on sidebar buttons and a fix for tooltips reappearing after click
  • File browser enhancements: Added "Open Folder" context menu action, column visibility toggle via ActivityTableMenu, compact action cell (menu-only, removed inline delete/open buttons), and metadata-aware sorting
  • Editor updates: Added FileMetadataBanner for read-only control and unified the "(Read-only)" label which previously said "Preview Mode" in certain cases.

TODO:

  • UI needs to set user metadata with a shallow instead of deep merge option or else user metadata keys will not be deleted when desired. This backend endpoint may not exist yet.

Test plan

  •  Verify metadata columns appear in file browser and can be toggled via column picker
  •  Verify metadata banner shows in editor with correct last-edited info and read-only checkbox
  •  Verify right panel metadata tab shows file metadata fields and user metadata JSON editor (edit/save/cancel)
  •  Verify user metadata editor discards changes on file switch or tab change
  •  Verify sidebar tooltips appear instantly and switch smoothly between buttons
  •  Verify left/right sidebar panels collapse/expand via icon rail buttons and resizable handles
  •  Verify "Open Folder" context menu navigates into the folder in the file browser
  •  Verify read-only toggle updates file metadata and prevents editing when appropriate

@AaronPlave AaronPlave changed the title Feat/sequence metadata UI Sequence metadata UI Mar 27, 2026
@AaronPlave AaronPlave marked this pull request as ready for review April 3, 2026 23:06
@AaronPlave AaronPlave requested a review from a team as a code owner April 3, 2026 23:06
…arch improvements

- Add CodeMirror-based JSON editor for user metadata in the metadata panel
  with syntax highlighting, validation, and auto-save on blur/file switch
- Add "Open Folder" button in content area and context menu to navigate
  the file browser to a selected folder
- Extend file browser search to match against metadata fields (createdBy,
  lastEditedBy, version, user metadata)
- Move read-only permission handling from editor components to FileMetadataBanner
- Add success toast for read-only status changes
… Auto discard changes when changing tabs or files.
@AaronPlave AaronPlave force-pushed the feat/sequence-metadata-ui branch from ac77bc8 to 5c140d9 Compare April 3, 2026 23:06
@Mythicaeda
Copy link
Copy Markdown
Contributor

Backend change that needs to be integrated:

POST /metadata/{workspaceId}/<path> (aka set metadata keys now accepts an optional query param mergeBehavior, which can be one of deep/deepMerge, shallow/shallowMerge, or overwrite. Behavior is as follows:

  • deep: deep merge user JSON Object, if provided (combine nested properties)
  • shallow: shallow merge user JSON Object, if provided (combine only top-level properties)
  • overwrite: replace user JSON Object with the new value, if provided
    The endpoint defaults to "deep" if not provided.

As per discussion, the UI should use the mergeBehavior=overwrite flag when sending an update to the user object to the backend.

bind:pane={leftPaneApi}
>
<Sidebar.Provider
disableShortcut
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It doesn't look like we use the shortcut to toggle open the sidebar anywhere else. If we disable it for workspaces, do we need it anywhere else? It looks like the other places we currently use the sidebar provider are in modals, and they're not even used as a sidebar in them.

Add EditorView.editable configuration alongside EditorState.readOnly
in SequenceEditor and WorkspaceMetadataPanel components. Both facets
need to be properly configured for CodeMirror to correctly handle
editor editability state changes.

Changes:
- Add EditorView.editable.of() to compartment reconfiguration in both components
- Refactor SequenceEditor readonly logic to use isEditable variable for clarity
- Reorder onReadOnlyChange prop declaration in SequenceEditor

This ensures the editor properly responds to readonly state changes by
configuring both the readOnly state facet and the editable view facet.
Extract duplicate click handler logic into a `togglePanel` function to reduce code duplication in WorkspaceRightIconRail component. The function handles toggling between metadata, command, and dictionary panels, closing the active panel if clicked again or switching to a new panel otherwise.

This improves maintainability by following the DRY principle and makes the component easier to modify in the future.
duranb added 4 commits April 9, 2026 17:11
…anel

- Add explicit type imports (ArgTextDef, TimeTagInfo) from sequence languages
- Declare component variables at top for better organization and clarity
- Simplify timeTagNode reactive statement formatting
- Improve code readability by making variable declarations explicit

This refactoring improves code maintainability by organizing variable
declarations in a clear, conventional pattern at the component's top level.
This fixes a potential race condition where the workspace UI might not reflect the saved state and ensures proper async/await flow in the save operation.
Copy link
Copy Markdown
Collaborator

@dandelany dandelany left a comment

Choose a reason for hiding this comment

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

@duranb and I reviewed this today & it is nearly ready to go. We updated the metadata POST request to include the overwrite flag per @Mythicaeda 's comment above. Only known remaining issues for us to look at tomorrow:

  • remove disableShortcut (unused) decided not to do for now
  • In the left panel, if no metadata columns are shown, you can't resize the main "file name" column easily fixed
  • In left panel, if you rearrange columns & then change which columns are enabled, they all get reordered back to original order fixed
  • self-review our last few commits re: optimistic updating - we think they're correct but kinda rushed to get it working done

Other feedback from leads meeting to consider (not committed to):

  • When you try to move/delete readonly files, everything looks like it's allowed until you click the button and then get a red error. It would be nice to instead gray them out in the context menu so you can't open the modal
    • What about multi-select -> move/delete, where some selected files are readonly and some aren't? Best would be some kind of message in the modal. At minimum make sure we at least get errors for the ones we couldn't edit.
  • readonly icon or other visual distinction in table for readonly files? done
  • remove Version column from the workspace file table done

- Add columnShiftResize prop to BulkActionDataGrid and SingleActionDataGrid components
- Create centralized cookie utilities (setCookie, getCookie) with consistent expiration handling
- Implement column state persistence in WorkspaceFileBrowser using cookies
- Move cookie constants to centralized location (constants/cookies.ts)
- Refactor SidebarProvider to use new cookie utilities instead of manual document.cookie
- Add comprehensive test coverage for cookie utility functions

This change improves code maintainability by consolidating cookie management logic and enables users to persist their column resize preferences across sessions.
@dandelany
Copy link
Copy Markdown
Collaborator

Discussed more with @duranb today - updated my last comment above to reflect fixed issues. Known remaining issues we're working on:

  • Handling cases where user selects multiple files but some of them are readonly:
    • Copy/Move: you should still be able to open the modal, but "Move" button in the modal gets grayed out + a tooltip, like "one or more selected files are read-only, cannot move"
      delete
    • Delete: Delete can be grayed out in the context menu & not clickable, with tooltip like "one or more selected files are read-only & can't be deleted"
  • handle multi-part responses from delete/move/copy files API
    • today: if one part of delete fails, it shows green toast.
    • should see a red toast & errors in our error console (one per failed file)
    • note that this will be a rare/unexpected case with the changes from the first bullet implemented, since we will prevent users from doing most things where an error could occur
  • fix failing e2e test

- Add `hasReadOnlyNodes` prop to track selection of read-only files
- Disable rename and delete operations when read-only files are selected
- Display appropriate error messages for read-only restrictions
- Visually indicate "Move" is disabled (with reduced opacity) while keeping "Copy" available for read-only files
- Update permission checks to consider read-only status alongside existing permissions

This prevents users from accidentally modifying or deleting files that should remain read-only, improving data integrity in the workspace.
Replace 'complementary' role with 'tablist' role in the actions test
selector to accurately reflect the sidebar navigation component's
semantic structure.
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.

Phoenix: show metadata files in workspace

4 participants