Skip to content

Hide the File menu in read-only Dashboard views #347

Description

@BorisTyshkevich

Summary

Read-only Dashboard views should not expose the Dashboard File menu.

Detached current-workspace views and one-time session-bundle views currently still show Export Dashboard…. After #341/#344, Dashboard export resolves the latest committed primary workspace through workspace.loadCurrent(). In a read-only view, that primary workspace may be unrelated to the Dashboard currently displayed.

The result is misleading and potentially exposes unrelated local content: clicking Export from a shared or preview Dashboard can download the user's primary editable Dashboard and query dependencies rather than the visible read-only Dashboard.

Required behavior

Hide the entire File button/menu whenever the Dashboard is opened read-only.

This applies to:

  • detached current-workspace Dashboard views resolved in view mode;
  • one-time session-bundle Dashboard views;
  • any future Dashboard source whose resolved mode is read-only.

Editable Dashboard mode must retain the complete File menu:

  • Export Dashboard…
  • Import Dashboard…
  • Open for viewing…

Implementation notes

renderDashboard() already resolves a readOnly boolean before building the header. Do not construct or mount buildDashboardFileMenu() when readOnly === true.

Prefer omitting the control from the DOM rather than rendering it disabled or visually hidden. This keeps keyboard navigation and the accessibility tree consistent with the available operations.

This issue intentionally removes read-only export rather than making export route-aware. A future route-local read-only export could be introduced separately if required.

Acceptance criteria

  • Editable current-workspace Dashboard shows the File button and all three actions.
  • Detached read-only Dashboard does not render .dash-file-btn or .dash-file-menu.
  • Session-bundle read-only Dashboard does not render .dash-file-btn or .dash-file-menu.
  • Keyboard tab order in read-only mode does not include a File control.
  • Opening a read-only Dashboard while a different primary workspace exists cannot export that primary workspace from the read-only page.
  • Existing editable Dashboard import/export/open-for-viewing behavior remains unchanged.

Tests

Add Dashboard header tests covering:

  1. editable current-workspace mode includes the File button;
  2. detached view mode omits the File button;
  3. session-bundle mode omits the File button;
  4. a different primary workspace may exist without exposing any export action on the read-only page.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions