feat(settings): enable Pad-wide Settings by default; fix misleading modal title#7679
feat(settings): enable Pad-wide Settings by default; fix misleading modal title#7679JohnMcLear wants to merge 2 commits intodevelopfrom
Conversation
…odal title The creator-owned Pad-wide Settings feature (#7545) shipped behind a flag that defaulted to false. With the flag off the modal still rendered an H1 of `pad.settings.padSettings` ("Pad-wide Settings") for *every* user, even though no pad-wide controls were ever shown. Two readers in different browsers both saw "Pad-wide Settings" as the modal title, which looked like a creator-gate regression but was just a copy bug. Two changes: 1. Flip the default of `enablePadWideSettings` to `true` (Settings.ts plus both settings templates). With the feature on, the creator (revision-0 author) gets a real "Pad-wide Settings" section gated by `clientVars.canEditPadSettings`, while every other user sees only "User Settings" — matching the design intent of #7545. This is a behavior change, so the settings comments are expanded to describe what the toggle now does. 2. Drop the conditional H1 in `src/templates/pad.html` and always use `pad.settings.title` ("Settings"). Operators who explicitly disable the feature shouldn't see a label that lies about a section that isn't rendered. Adds backend regression coverage in `tests/backend/specs/socketio.ts`: - Different browsers (different cookie jars => different authorIDs): only the first joiner gets `canEditPadSettings: true`. - Same browser, two tabs (shared HttpOnly token cookie => same authorID): both connections are the same identity, both correctly land on the creator path.
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
Review Summary by QodoEnable Pad-wide Settings by default and fix modal title
WalkthroughsDescription• Enable Pad-wide Settings by default for better UX • Fix misleading modal title that showed "Pad-wide Settings" for all users • Add backend regression tests for creator gate logic • Expand settings documentation to clarify feature behavior Diagramflowchart LR
A["enablePadWideSettings: false"] -->|Flip default| B["enablePadWideSettings: true"]
B -->|Creator sees| C["Pad-wide Settings section"]
B -->|Others see| D["User Settings only"]
E["Conditional H1 logic"] -->|Remove| F["Always use Settings title"]
G["No creator gate tests"] -->|Add| H["Creator gate regression tests"]
File Changes1. src/node/utils/Settings.ts
|
Code Review by Qodo
1. enablePadWideSettings default enabled
|
| updateServer: "https://static.etherpad.org", | ||
| enableDarkMode: true, | ||
| enablePadWideSettings: false, | ||
| enablePadWideSettings: true, |
There was a problem hiding this comment.
1. enablepadwidesettings default enabled 📘 Rule violation ☼ Reliability
The PR flips enablePadWideSettings to default to true, enabling the feature without explicit operator opt-in. This violates the requirement that new/flagged functionality be disabled by default and can also change behavior for deployments with older configs that omit this key.
Agent Prompt
## Issue description
`enablePadWideSettings` is now enabled by default (`true`) in runtime defaults and shipped config templates, which violates the requirement that feature-flagged functionality be disabled by default and may change behavior for installs that do not set this config key.
## Issue Context
The PR flips defaults in:
- runtime defaults (`src/node/utils/Settings.ts`)
- `settings.json.template`
- `settings.json.docker`
## Fix Focus Areas
- src/node/utils/Settings.ts[370-373]
- settings.json.template[733-741]
- settings.json.docker[247-255]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Intentional. The maintainer (@JohnMcLear) explicitly approved flipping this default in conversation prior to opening the PR — see the PR description under "Why this is a behavior change worth taking." The creator-only canEditPadSettings server gate is unchanged, so this widens UI defaults but does not widen access. Operators who want the legacy single-section modal can still set enablePadWideSettings: false; the comment in both shipped settings files documents that path.
| <div id="settings" class="popup" role="dialog" aria-modal="true" aria-labelledby="settings-title"><div class="popup-content"> | ||
| <% if (settings.enablePadWideSettings) { %> | ||
| <h1 id="settings-title" data-l10n-id="pad.settings.title">Settings</h1> | ||
| <% } else { %> | ||
| <h1 id="settings-title" data-l10n-id="pad.settings.padSettings">Pad Settings</h1> | ||
| <% } %> | ||
| <div class="settings-sections"> |
There was a problem hiding this comment.
2. No test for modal h1 📘 Rule violation ☼ Reliability
The PR fixes the settings modal heading logic by removing the conditional title, but it does not add a regression test that would fail if the old misleading heading behavior returned. This makes the UI bug fix unverifiable and prone to regression.
Agent Prompt
## Issue description
The settings modal heading bug fix (always using `pad.settings.title` / `Settings`) has no automated regression coverage.
## Issue Context
This PR changes the modal `<h1 id="settings-title">` rendering logic in `src/templates/pad.html`, but does not add a test that asserts the heading text/label under the relevant configuration states.
## Fix Focus Areas
- src/templates/pad.html[129-138]
- src/tests/frontend-new/specs/pad_settings.spec.ts[1-40]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Addressed in 912da32. Added tests/backend/specs/settingsModalHeading.ts which asserts data-l10n-id="pad.settings.title" is rendered for the modal H1 in both enablePadWideSettings states. If the old conditional (pad.settings.padSettings when the flag is off) is reintroduced, the disabled-flag test fails.
Asserts the rendered `/p/<id>` HTML always uses `data-l10n-id="pad.settings.title"` for the modal heading, regardless of `enablePadWideSettings`. Catches a re-introduction of the old conditional that printed "Pad-wide Settings" for every user when the feature was off. Action of Qodo review feedback on PR #7679.
Summary
enablePadWideSettingsfromfalsetotrueinsrc/node/utils/Settings.tsand both shipped settings files (settings.json.template,settings.json.docker). The creator-owned pad-wide settings feature (Add creator-owned pad settings defaults #7545) is now on out of the box.<h1>insrc/templates/pad.htmland always usepad.settings.title("Settings"). With the feature off, the H1 was renderingpad.settings.padSettings("Pad-wide Settings") for everyone — a label that lied about a section that wasn't rendered.src/tests/backend/specs/socketio.tsfor the creator gate (different cookie jars vs. shared cookie jar / same authorID).Why this is a behavior change worth taking
/p/fooin two different browsers. Both see the modal heading "Pad-wide Settings", even though there are no pad-wide controls in the body. That looked like a creator-gate regression but turned out to be the H1 copy bug above.isPadCreator=authorId === pad.getRevisionAuthor(0)) gets a "Pad-wide Settings" section to set defaults / optionally enforce them, while everyone else sees only "User Settings" (their personal view). That's the better default UX, and is what most operators will expect on a fresh install.enablePadWideSettings: false. The settings comments are expanded to describe what the toggle now does.Server-side gate is unchanged
canEditPadSettingsis still computed by:Non-creator clients still receive
canEditPadSettings: false, andpad_editor.ts:235still gates the unhide on it. Flipping the default does not widen who can edit pad-wide settings.Test plan
tests/backend/specs/socketio.ts— newPad-wide settings creator gatedescribe block:canEditPadSettings: true); the second is not (false)./p/foofrom two different browsers — only the first sees "Pad-wide Settings"; the second sees only "User Settings".enablePadWideSettings: false— modal H1 reads "Settings", body still has the legacy "My View" section.Reviewer notes
This is a default flip (not a code-path change), so existing operators who rely on the legacy single-modal layout need to set
enablePadWideSettings: falseafter upgrade. Worth highlighting in release notes.