[Website] Add an opt-in Dock presentation to the file editor - #4042
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
dockPresentationrendering mode inPlaygroundFileEditor, including a Dock-specific save/retry button and styles. - Extends
FileExplorerSidebarto support Dock-specific header/title, tooltips, binary-preview header toggling, and a “download too-large file” flow. - Exposes Dock-scoped theming hooks by converting
FilePickerTreehard-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.
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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a
dockPresentationoption toPlaygroundFileEditorso 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, orRetry saveas 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.tsxnpm exec -- nx run-many -t lint,typecheck -p playground-components,playground-websitenpm exec -- nx build:vite playground-components