add Server section to admin panel and setup wizard#2280
Draft
add Server section to admin panel and setup wizard#2280
Conversation
b98482d to
ece3b28
Compare
Contributor
There was a problem hiding this comment.
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:
BaseUrlSectionandEditionSection, plus Storybook stories for each. - Adds a
PendingChangesManagerto 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.
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>
ece3b28 to
1e119f1
Compare
Contributor
There was a problem hiding this comment.
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.
- 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>
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.
Fills in the Server piece of the
/admin/setupwizard and itsadmin-panel counterpart -- Base URL and Edition -- plus the shared
apply/restart plumbing the other wizard steps can plug into.
Highlights:
BaseUrlSectionwith a Test-URL-then-Confirm flow.EditionSectionreusing the existingToggleEnterpriseWidgetinadmin-panel mode; a simple Community vs Full Grist picker in wizard
mode.
PendingChangesManager+PartialApplyError: sections implement asmall
ConfigSectioninterface, the manager batches apply()s,restarts the server once at the end when needed.