Commit b22bad0
fix(pad): keep menu_right visible on readonly pads by default
PR #X (issue #5182) added a client-side `$('#editbar .menu_right').hide()`
for readonly pads, opt-out via `?showMenuRight=true`. The intent — clean
chrome for iframe-embedded readonly announcement pads — was good but the
implementation hid the userlist toggle along with import/export.
That has two unwanted effects on non-embed deployments:
* Plugins like ep_guest inject their "Log In" button into `#myuser`
inside the userlist popup, which lives under `.menu_right`. When
the guest user (readOnly: true) lands on a readonly pad, the button
they need to escape readonly is hidden. Chicken-and-egg.
* Settings, embed, home, timeslider, showusers are all legitimately
useful for readonly viewers and got removed alongside the actual
write-only controls.
The server already does the right thing without help from the client:
* src/node/utils/toolbar.ts:282-290 strips `savedrevision` from the
right toolbar when isReadOnly is true.
* src/static/css/pad/popup_import_export.css:1 has
`.readonly .acl-write { display: none }`, which hides the Import
column of the import/export popup. Export stays visible (and is
legitimately useful in readonly).
Drop the client-side blanket hide. The iframe-embed use case from #5182
is still served by `?showMenuRight=false` (the existing handler at
src/static/js/pad.ts:91-107), and `?showControls=false` continues to
hide the entire editbar for callers who want even the left menu gone.
Tests: rewrite `hide_menu_right.spec.ts`. The "readonly pad hides
.menu_right by default" assertion is inverted; a new test confirms
`?showMenuRight=false` still hides on readonly pads.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 294158e commit b22bad0
2 files changed
Lines changed: 34 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
787 | 789 | | |
788 | 790 | | |
789 | 791 | | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
798 | 804 | | |
799 | 805 | | |
800 | 806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
| |||
0 commit comments