Skip to content

[Website] Add an opt-in Dock presentation to the file editor - #4042

Merged
adamziel merged 2 commits into
trunkfrom
dock-file-editor-presentation
Jul 14, 2026
Merged

[Website] Add an opt-in Dock presentation to the file editor#4042
adamziel merged 2 commits into
trunkfrom
dock-file-editor-presentation

Conversation

@adamziel

@adamziel adamziel commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a dockPresentation option to PlaygroundFileEditor so the existing file editor can fit inside the bottom Dock without changing its current screens.

The option is off by default. When it is on, the editor uses the Dock's compact spacing, colors, icons, tooltips, and narrow-screen layout. It replaces the passive save status with a button that says Save file, Saving…, File saved, or Retry save as the write moves through those states. Files that are too large to preview get a download button.

The file explorer also accepts the small presentation controls needed by Dock callers, such as its title and whether to show the binary-preview header. The file tree keeps its existing appearance by default and exposes CSS variables for the Dock colors.

No current website call site enables this option, so this PR does not change the visible website UI by itself. It prepares the shared file editor for the Dock work in #3965; #4053 is the first PR that enables it.

Tested with:

  • npm exec -- nx test playground-components --testFile=playground-file-editor.spec.tsx
  • npm exec -- nx run-many -t lint,typecheck -p playground-components,playground-website
  • npm exec -- nx build:vite playground-components

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an opt-in dockPresentation mode to the shared Playground file editor so the website’s Dock can use a tailored layout (styling + behavior) without forking existing consumers.

Changes:

  • Introduces dockPresentation rendering mode in PlaygroundFileEditor, including a Dock-specific save/retry button and styles.
  • Extends FileExplorerSidebar to support Dock-specific header/title, tooltips, binary-preview header toggling, and a “download too-large file” flow.
  • Exposes Dock-scoped theming hooks by converting FilePickerTree hard-coded styles into CSS variables (with fallbacks), and adds a basic regression test for the opt-in class.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/playground/components/src/PlaygroundFileEditor/playground-file-editor.tsx Adds dockPresentation prop, Dock-specific save button, and passes Dock presentation down to the sidebar.
packages/playground/components/src/PlaygroundFileEditor/playground-file-editor.spec.tsx Adds a regression test ensuring the Dock class is applied only when requested.
packages/playground/components/src/PlaygroundFileEditor/playground-file-editor.module.css Adds Dock presentation styling and save button styles (including responsive behavior).
packages/playground/components/src/PlaygroundFileEditor/file-explorer.module.css Adds Dock presentation styling and CSS variable values for the file tree.
packages/playground/components/src/PlaygroundFileEditor/file-explorer-sidebar.tsx Adds Dock options (title/tooltips/header hiding) and a user-triggered download path for too-large files.
packages/playground/components/src/FilePickerTree/style.module.css Replaces hard-coded colors/sizing with CSS variables + fallbacks for theming.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/playground/components/src/PlaygroundFileEditor/file-explorer-sidebar.tsx Outdated
@adamziel
adamziel merged commit 4e51d7b into trunk Jul 14, 2026
53 checks passed
@adamziel
adamziel deleted the dock-file-editor-presentation branch July 14, 2026 23:16
adamziel added a commit that referenced this pull request Jul 14, 2026
This PR lets the Blueprint editor show Dock file and export controls
when `dockPresentation` is enabled.

The Blueprint editor currently shows a file path and separate icon
buttons for copying a link and downloading a zip. The Dock version needs
a file list title, a documentation link, and one Export menu.

Add a `dockPresentation` prop that enables those controls and the Dock
colors and spacing. The prop is off by default, so the current Site
Manager does not change.

This PR is based on #4042 because it uses the File Explorer Dock props.
The controls will be enabled by #3965.

Verified with `npm exec nx test playground-website
--output-style=static` and `npm exec nx typecheck playground-website
--output-style=static`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment