Skip to content

add Server section to admin panel and setup wizard#2280

Draft
paulfitz wants to merge 3 commits intomainfrom
paulfitz/setup-server
Draft

add Server section to admin panel and setup wizard#2280
paulfitz wants to merge 3 commits intomainfrom
paulfitz/setup-server

Conversation

@paulfitz
Copy link
Copy Markdown
Member

@paulfitz paulfitz commented Apr 20, 2026

Fills in the Server piece of the /admin/setup wizard and its
admin-panel counterpart -- Base URL and Edition -- plus the shared
apply/restart plumbing the other wizard steps can plug into.

Highlights:

  • BaseUrlSection with a Test-URL-then-Confirm flow.
  • EditionSection reusing the existing ToggleEnterpriseWidget in
    admin-panel mode; a simple Community vs Full Grist picker in wizard
    mode.
  • PendingChangesManager + PartialApplyError: sections implement a
    small ConfigSection interface, the manager batches apply()s,
    restarts the server once at the end when needed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Server configuration surface (Base URL + Edition) to both the admin panel and the setup wizard, and introduces shared infrastructure to support multi-section “apply + restart” flows.

Changes:

  • Introduces new UI sections: BaseUrlSection and EditionSection, plus Storybook stories for each.
  • Adds a PendingChangesManager to batch section applies and coordinate restart/wait behavior.
  • Extends admin panel navigation and restart banner UX, and adds tests covering the new Server section and wizard step.

Reviewed changes

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

Show a summary per file
File Description
test/nbrowser/AdminPanelServer.ts New browser tests for admin panel Server section and setup wizard Server step flows.
storybook/editionSection.stories.ts Storybook coverage for the new edition selector section.
storybook/baseUrlSection.stories.ts Storybook coverage for the new base URL section.
app/server/lib/ConfigBackendAPI.ts Adds GET /api/config/server to expose effective APP_HOME_URL.
app/common/gristUrls.ts Updates Help Center URL for Full/Enterprise enablement docs.
app/common/ConfigAPI.ts Adds ServerConfig + getServerConfig() client API method.
app/client/ui/ToggleEnterpriseWidget.ts Extracts installation-id display helper; updates copy and “Full Grist” wording.
app/client/ui/QuickSetup.ts Implements the first wizard step (“Server”) using Base URL + Edition sections.
app/client/ui/PendingChanges.ts New batching/apply coordinator for config sections (restart + wait + partial apply handling).
app/client/ui/EditionSection.ts New Edition section (wizard selector + admin panel activation lifecycle integration).
app/client/ui/BaseUrlSection.ts New Base URL section with test/confirm flow and persistence via install prefs.
app/client/ui/AdminPanelCss.ts Extracts reusable section styles + confirmed-row helper + item focusing helper.
app/client/ui/AdminPanel.ts Adds “Server” section, pending-changes driven restart banner, and enterprise stub redirect.
app/client/ui/AdminLeftPanel.ts Adds conditional “Apply changes” left-nav entry tied to restart banner visibility.

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

Comment thread app/client/ui/BaseUrlSection.ts Outdated
Comment thread app/client/ui/BaseUrlSection.ts Outdated
Comment thread app/client/ui/AdminLeftPanel.ts
Comment thread app/client/ui/ToggleEnterpriseWidget.ts Outdated
Comment thread app/client/ui/EditionSection.ts Outdated
Comment thread test/nbrowser/AdminPanelServer.ts
Fills in the Server piece of the `/admin/setup` wizard and its
admin-panel counterpart -- Base URL and Edition -- plus the shared
apply/restart plumbing the other wizard steps can plug into.

Highlights:

- `BaseUrlSection` with a Test-URL-then-Confirm flow. "Leave automatic"
  actually clears a manually-set APP_HOME_URL via PATCH /install/prefs
  rather than being a no-op skip, so the label matches the effect.
- `EditionSection` reusing the existing `ToggleEnterpriseWidget` in
  admin-panel mode; a simple Community vs Full Grist picker in wizard
  mode. Availability is a constructor option so storybook can drive
  variants without runtime tricks.
- `PendingChangesManager` + `PartialApplyError`: sections implement a
  small `ConfigSection` interface, the manager batches apply()s,
  restarts the server once at the end when needed, and surfaces partial
  failures with labelled per-section errors.
- Writes go through `PATCH /api/install/prefs` (the consolidated
  envVars write path from c73044a), not a dedicated POST.
- `GET /api/config/server` reads activation prefs + process.env directly,
  bypassing the memoized `getHomeUrl()` so the admin panel reflects
  persisted writes without waiting for the restart.
- The Enterprise admin-panel stub now surfaces the installation ID via
  a shared `buildInstallationIdDisplay` helper extracted from
  `ToggleEnterpriseWidget`. Community builds omit the row since the
  activation-status endpoint isn't mounted there.
- `AdminPanelCss` gains a couple of shared helpers (`buildConfirmedRow`,
  moved `cssDangerText`/`cssErrorText`/`cssHappyText`) that other
  sections can reuse.
- Storybook stories for `BaseUrlSection` and `EditionSection` so UI
  states can be previewed without standing up a server. Aligns with
  the convention in other in-flight wizard branches.
- Browser tests in `test/nbrowser/AdminPanelServer.ts` covering the
  admin-panel item, the Test-and-Confirm flow, persistence through the
  install/prefs endpoint, and the wizard getting-through-without-changes
  and Apply-and-Continue paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

Comment thread app/client/ui/EditionSection.ts Outdated
Comment thread app/client/ui/AdminPanel.ts
Comment thread app/client/ui/BaseUrlSection.ts
Comment thread app/client/ui/AdminPanelCss.ts Outdated
paulfitz and others added 2 commits April 21, 2026 15:09
- EditionSection: start admin-panel selection at current server edition
  rather than the wizard-style availability default, so the section isn't
  dirty before the user acts. Wizard path unchanged.
- AdminInstallationPanel: initial-sync `needsRestart` from
  `_pending.needsRestart.get()` before registering the listener, so a
  pending change that precedes construction still flips the banner.
- BaseUrlSection: promote the failed-test disclosure `showDetail` to a
  `_testDetailOpen` instance field and reset it on render, so repeated
  failures don't accumulate observables on the section.
- focusAdminItem: treat bare `"0"` as collapsed alongside `""` and
  `"0px"`. The expandable item's transition writes plain `"0"`, which the
  helper missed, occasionally skipping the auto-expand on anchor-focus.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The admin panel's Base URL section needed a way to read the current
APP_HOME_URL. Rather than a bespoke endpoint, use the existing probe
mechanism: a new home-url probe reads appSettings directly and exposes
value + source, and BaseUrlSection now calls InstallAPI.runCheck.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants