feat(editor): add showMenuRight URL param to hide right-side toolbar#7553
feat(editor): add showMenuRight URL param to hide right-side toolbar#7553JohnMcLear wants to merge 4 commits intoether:developfrom
Conversation
Adds a showMenuRight URL/embed parameter. When set to false, the right-side toolbar (.menu_right — import/export, timeslider, settings, share, users) is hidden. Default behavior (menu shown) is unchanged. Motivated by read-only / announcement-pad embeds where viewers shouldn't see those controls, but the same server hosts editable pads where the buttons must remain available (so globally disabling them in settings.json is not a fit). Closes ether#5182 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review Summary by QodoAdd showMenuRight URL parameter to hide right-side toolbar
WalkthroughsDescription• Add showMenuRight URL parameter to conditionally hide right toolbar • Hides import/export, timeslider, settings, share, users controls • Follows existing showControls parameter pattern • Includes comprehensive Playwright test coverage for all scenarios Diagramflowchart LR
A["URL Parameter<br/>showMenuRight=false"] -- "triggers callback" --> B["Hide menu_right<br/>element"]
C["Default behavior<br/>or showMenuRight!=false"] -- "no change" --> D["menu_right<br/>remains visible"]
File Changes1. src/static/js/pad.ts
|
Code Review by Qodo
1.
|
…ght=true override Addresses Qodo review feedback on ether#7553: 1. Readonly pads now hide the right-side toolbar automatically. The original issue (ether#5182) was specifically about readonly embeds; the previous implementation only honoured an explicit `?showMenuRight=false` URL parameter, which meant that vanilla readonly pads still showed import/export/timeslider/settings/share/users controls — all noise for viewers who can't interact with the pad anyway. 2. Callers who still want the menu visible on readonly pads can opt back in with `?showMenuRight=true`. The URL-param callback now accepts both values instead of just `false`. 3. The Playwright spec's `browser.newContext() + clearCookies()` pattern was a no-op because the test navigated with the existing `page` fixture (different context). Switch to `page.context().clearCookies()`, and cover both the auto-hide and the explicit-override paths on a readonly-URL navigation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous test looked up (capital-I) and called inputValue() on it. The real element is (lowercase) and it's a toggle checkbox, not a URL field. The readonly URL itself is in `#linkinput`, updated live when the readonly checkbox is checked. Wire the test to that flow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e921b77 to
f2a97a9
Compare
Playwright's stability check kept retrying the click while the popup
was animating open ("element is not stable"). Wait for
#embed.popup-show and use click({force: true}) so a trailing CSS
transform doesn't retrigger the instability backoff. Also wait for
#linkinput to update to the readonly URL before reading it — the
checkbox change is asynchronous.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Qodo's |
Summary
Adds a new URL/embed parameter
showMenuRight=falsethat hides the right-side toolbar (menu_right— import/export, timeslider, settings, share, users) without disabling those features for other pads.Requested for read-only / announcement-pad use cases where viewers shouldn't see those controls, but the same server also hosts editable pads where those buttons should remain. Globally disabling via
settings.toolbar.rightis not a fit.Follows the same pattern as the existing
showControlsURL parameter. Default behavior (menu visible) is unchanged.Closes #5182
Test plan
?showMenuRight=false→.menu_righthidden,.menu_leftstill visible.menu_rightvisible (regression guard)?showMenuRight=true(or any non-falsevalue) →.menu_rightvisiblepnpm run ts-checkclean locally🤖 Generated with Claude Code