Skip to content

Sequence metadata UI (use this one)#1905

Open
duranb wants to merge 32 commits intodevelopfrom
feat/bryan/sequence-metadata-ui
Open

Sequence metadata UI (use this one)#1905
duranb wants to merge 32 commits intodevelopfrom
feat/bryan/sequence-metadata-ui

Conversation

@duranb
Copy link
Copy Markdown
Collaborator

@duranb duranb commented Apr 14, 2026

Taken from #1901

___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 and others added 27 commits April 14, 2026 11:45
…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.
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.
…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.
- 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.
- 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.
@duranb duranb requested a review from a team as a code owner April 14, 2026 19:37
@duranb duranb requested review from AaronPlave and mattdailis April 14, 2026 19:37
@duranb duranb requested a review from joswig April 14, 2026 19:37
duranb added 2 commits April 14, 2026 12:38
- Remove custom event dispatcher from WorkspaceLeftIconRail component
- Use existing handleTabClick function for actions button instead of custom event
- Simplify component interface by removing actionsClick event handler prop
- Add "Open Folder" button to workspace document view for easier folder access

This refactoring reduces code complexity by consolidating tab click handling into a single method while improving UX with the new folder access feature.
- Move currentBreadcrumbPath export to group with other props in WorkspaceSidebar
- Restructure workspace content area component hierarchy
- Improve code organization without changing functionality

This refactoring improves code readability by grouping related exports together and simplifying the component structure in the workspace page.
@duranb duranb changed the base branch from feat/sequence-metadata-ui to develop April 14, 2026 19:54
- Use type-only imports for Locator and Page to optimize bundle size
- Add definite assignment assertions (!:) to Locator properties initialized in constructor
- Update action sidebar selector from 'complementary' to 'tablist' role for more accurate element targeting

These changes improve TypeScript type safety and ensure more reliable E2E test selectors in the Action fixture.
- Remove unused workspace and user props from ImportWorkspaceFileModal
- Remove enableContextMenu prop from WorkspaceTreeView component calls
- Add selectionHasReadOnlyNodes prop to MoveItemToWorkspaceModal
- Prevent moving read-only files with appropriate error messaging
- Update permission checks to account for read-only file selections
- Clean up unused type imports and component props

This simplifies the component interface by removing unnecessary props that were being passed through multiple layers, and adds protection against moving read-only files to prevent data integrity issues.
@duranb duranb changed the title Feat/bryan/sequence metadata UI Sequence metadata UI (use this one) Apr 14, 2026
@duranb duranb mentioned this pull request Apr 14, 2026
1 task
**Changes:**
- Configure both `EditorState.readOnly` and `EditorView.editable` facets to properly control editor interactivity
- Update E2E test selectors to use more specific button roles in tabpanel instead of generic labels
- Reorder component props for consistency (move callback to end)

**Why:**
The text editor was not properly respecting readonly/preview/loading states because only the `readOnly` facet was configured. CodeMirror requires both `readOnly` and `editable` facets to be set for proper behavior. The E2E test updates improve selector reliability by targeting more specific button elements.
@duranb duranb deployed to test-workflow April 15, 2026 01:53 — with GitHub Actions Active
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

2 participants