Skip to content

Commit 3bcfe08

Browse files
committed
feat(console): an administrator's first-run checklist on Home replaces the currency and time zone dialog (#30206)
The dialog that asked for the system timezone and default currency on the first page an administrator opened is gone. Its questions, and the other things a new workspace needs, are rows of a checklist at the top of Home: organization name, default language and country, system timezone, default currency, email delivery, and invite colleagues. Each row's state is read from the real setting; the localization rows edit in place with the Settings page's own fields, pre-filled from the browser and written only on the row's Confirm. Members see nothing; the close button hides it for that administrator in that workspace on that device. A country typed by name into a domain-bearing picker now commits the option's code (「中国」 → CN), and an invalid_format refusal reads in the console's words and the reader's language on the Settings page and the checklist. Claude-Session: https://claude.ai/code/session_01L6bhgVwQZbHRRM9CaXeKif Co-authored-by: Claude <noreply@anthropic.com>
1 parent fa9c0aa commit 3bcfe08

41 files changed

Lines changed: 2661 additions & 1923 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
feat(console): an administrator's first-run checklist on Home replaces the currency and time zone dialog, and a country typed by name is saved as its code (#30206)
7+
8+
Clause-②: yes (widening) — new console i18n keys `console.firstRunChecklist.*` and `console.settingsView.invalidFormat` / `.invalidFormatHelp` / `.invalidFormatPick` (all ten packs); the retired `console.workspaceTimezonePrompt.*` keys had no reader outside the removed dialog
9+
Metadata-protocol: none
10+
11+
The dialog that asked for the system timezone and default currency opened over the first page an administrator visited, before anything needed a currency, and once covered the toast that said how to share an invitation. It is gone. The same questions, and the other things a new workspace needs, are now rows of a checklist at the top of Home (`/home`):
12+
13+
1. **Organization name**: done once the organization no longer carries the name the platform gave it ("Default Organization"). Links to Setup → Organization.
14+
2. **Default language and country**, 3. **System timezone**, 4. **Default currency**: done once the setting is set (for language, country and timezone, set by someone rather than left at the platform default; for the currency, which has no default, holding any value). Each opens in place with the Settings page's own fields, pre-filled from the browser: language, country and currency from the browser's first language (so `zh-CN` offers 中文, China and CNY together), the timezone from the browser's zone. Nothing is written until the row's Confirm, which saves through the Settings page's own `PUT /api/settings/localization`.
15+
5. **Email delivery**: done once mail can deliver (a provider other than `log`, a From address, and a host for SMTP). Shown only to a session that may write mail. Links to Setup → Mail Delivery.
16+
6. **Invite colleagues**: done once there is a second member or a pending invitation. Links to Setup → Users.
17+
18+
Each row's state is read from the real setting every time, never from a click. The checklist is shown only to a session that may write `localization`; a member sees nothing, and a member's Home sends no settings namespace read. It draws nothing once every row is done, and its close button hides it for that administrator in that workspace on that device, writing nothing to the server. The rules the dialog was built on still hold: the browser's zone and currency are never written without the administrator's Confirm, and an unset currency stays on the list until it is set.
19+
20+
Typing a country's name into a country picker now saves its code: 「中国」 typed into 默认国家, whose option reads 「中国 (CN)」, saves `CN` instead of being refused by the server's two-letter format check. Only a name exactly one option carries counts; any other text is sent as typed, as before. When the server does refuse a value for its format (`invalid_format`), the Settings page and the checklist now say so in the reader's language, naming the setting by its label: "Choose a value for Default country from the list." for a picker, and "Gateway model is not in a valid format. Use provider/model." (with the field's own help line) for a typed field. Every other refusal keeps the server's sentence.

‎docs/qa/platform-checklist/RUNNER.md‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,18 @@ contradicts it, and correct it here when it does.
204204
read-only" assumption: the pair is the door, and the read-only-package lock the
205205
console renders is a *different* gate (see `access-security.readonly-package-locks-studio`).
206206

207-
- **A fresh organization's first page opens under a one-time prompt: "Set the default
208-
currency", or the system timezone, or both in one dialog.** An administrator is asked
209-
once while `localization.timezone` is still the manifest default or the organization
210-
has no default currency (`ui/apps/console/src/pages/settings/WorkspaceTimezonePrompt.tsx`,
211-
`workspaceTimezonePromptLogic.ts`), so on a fresh DB the dialog
212-
(`data-testid="workspace-timezone-prompt"`) sits over the first page the admin opens,
213-
Studio and app pages included (QA runs #29890 and #29893). Dismiss it with **Not now**
214-
(Keep the default when only the timezone is asked), `data-testid="workspace-timezone-prompt-decline"`,
215-
before any screenshot or DOM read. The answer is remembered per organization and user in
216-
that browser's `localStorage` (`os:workspace-timezone-prompt:<org>:<user>`), so a new
217-
browser context asks again. ⛔ Do not score a clause FAIL for chrome hidden under it.
207+
- **A fresh organization's Home carries a first-run checklist for the administrator; no
208+
dialog opens over any page.** Until objectstack#30206 a one-time "Set the default
209+
currency" / system timezone dialog sat over the first page an administrator opened. It
210+
is gone: the same questions are rows of a card at the top of `/home`
211+
(`ui/apps/console/src/pages/settings/FirstRunChecklist.tsx`,
212+
`data-testid="first-run-checklist"`), shown only to a session that may write
213+
`localization`, and it writes nothing until a row's own Confirm. Studio, Setup and app
214+
pages open with nothing in front of them. A screenshot of Home on a fresh DB shows the
215+
card above the page's sections; its close button
216+
(`data-testid="first-run-checklist-dismiss"`) hides it for that organization and user in
217+
that browser's `localStorage` (`os:first-run-checklist:<org>:<user>`). ⛔ Do not score a
218+
Home clause FAIL because the card pushes the page's sections down.
218219

219220
- **`objectstack verify --rls` is a separate invocation — bare `verify` prints no RLS
220221
section at all.** `runRlsProofs` runs only behind the flag

‎ui/apps/console/src/App.tsx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
} from '@object-ui/app-shell';
4242

4343
import { AppContent, ConsolePermissionsRequest, ConsolePermissionsScope } from './AppContent';
44+
import { FirstRunChecklist } from './pages/settings/FirstRunChecklist';
4445
import { publishAuthState } from './i18nSession';
4546
import { FaviconSync } from './components/FaviconSync';
4647
import { RootLandingRedirect } from './components/RootLandingRedirect';
@@ -187,11 +188,18 @@ function NativeShellRouting() {
187188
return null;
188189
}
189190

190-
/** Wraps `DefaultHomeLayout` so the FAB gets the signed-in user id. */
191+
/**
192+
* Wraps `DefaultHomeLayout` so the FAB gets the signed-in user id, and draws
193+
* an administrator's first-run checklist above the page's own sections
194+
* (objectstack#30206). The route sits under `ConsolePermissionsScope`, which
195+
* is what tells the checklist whether this session may write the settings it
196+
* lists; for anyone else it draws nothing.
197+
*/
191198
function HomeRoute() {
192199
const { user } = useAuth();
193200
return (
194201
<DefaultHomeLayout userId={user?.id}>
202+
<FirstRunChecklist />
195203
<DefaultHomePage />
196204
</DefaultHomeLayout>
197205
);

‎ui/apps/console/src/AppContent.tsx‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { createAuthenticatedFetch, useAuth } from '@object-ui/auth';
1818
import type { DataSource } from '@object-ui/types';
1919
import { LocalizationFetchProvider } from './LocalizationFetchProvider';
2020
import { InAppFormRoute } from './components/InternalFormRoute';
21-
import { WorkspaceTimezonePrompt } from './pages/settings/WorkspaceTimezonePrompt';
2221
import { APPROVAL_ACTION_OBJECT, APPROVAL_REQUEST_OBJECT, routeApprovalRecordReads } from './services/approvalRequestsDataSource';
2322

2423
const AppManagementPage = lazy(() => import('./pages/system/AppManagementPage').then(m => ({ default: m.AppManagementPage })));
@@ -528,11 +527,6 @@ export function AppContent() {
528527
/>
529528
</ApprovalRecordReads>
530529
</LocalizationFetchProvider>
531-
{/* objectui#11758 — asks an administrator once to set a still-default
532-
workspace timezone. Under `ConsolePermissionsScope`, because that
533-
provider is what answers whether this session may write the
534-
setting; mounted once for the whole app shell, beside the routes. */}
535-
<WorkspaceTimezonePrompt />
536530
</>
537531
);
538532
}

‎ui/apps/console/src/__tests__/App.homePermissions-12700.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ vi.mock('../../../../packages/app-shell/src/hooks/useAiSurface', async (importOr
178178
vi.mock('../LocalizationFetchProvider', () => ({
179179
LocalizationFetchProvider: ({ children }: { children?: ReactNode }) => <>{children}</>,
180180
}));
181-
vi.mock('../pages/settings/WorkspaceTimezonePrompt', () => ({ WorkspaceTimezonePrompt: () => null }));
181+
vi.mock('../pages/settings/FirstRunChecklist', () => ({ FirstRunChecklist: () => null }));
182182
vi.mock('../components/RootLandingRedirect', () => ({ RootLandingRedirect: () => null }));
183183
vi.mock('../components/SetupRoute', () => ({ SetupRoute: () => null }));
184184
vi.mock('../components/FormPage', () => ({ FormPage: () => null }));

‎ui/apps/console/src/__tests__/App.permissionsWave-29114.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ vi.mock('@object-ui/app-shell', async (importOriginal) => {
145145
vi.mock('../LocalizationFetchProvider', () => ({
146146
LocalizationFetchProvider: ({ children }: { children?: ReactNode }) => <>{children}</>,
147147
}));
148-
vi.mock('../pages/settings/WorkspaceTimezonePrompt', () => ({ WorkspaceTimezonePrompt: () => null }));
148+
vi.mock('../pages/settings/FirstRunChecklist', () => ({ FirstRunChecklist: () => null }));
149149
vi.mock('../components/RootLandingRedirect', () => ({ RootLandingRedirect: () => null }));
150150
vi.mock('../components/SetupRoute', () => ({ SetupRoute: () => null }));
151151
vi.mock('../components/FormPage', () => ({ FormPage: () => null }));

‎ui/apps/console/src/__tests__/AppContent.approvalRecordReads.test.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ vi.mock('@object-ui/permissions', async (importOriginal) => ({
3636
vi.mock('../LocalizationFetchProvider', () => ({
3737
LocalizationFetchProvider: ({ children }: { children: ReactNode }) => <>{children}</>,
3838
}));
39-
vi.mock('../pages/settings/WorkspaceTimezonePrompt', () => ({
40-
WorkspaceTimezonePrompt: () => null,
41-
}));
4239

4340
import { AppContent } from '../AppContent';
4441

‎ui/apps/console/src/components/FormPage.routePermissions-29187.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ vi.mock('../../../../packages/app-shell/src/hooks/useAiSurface', async (importOr
137137
vi.mock('../LocalizationFetchProvider', () => ({
138138
LocalizationFetchProvider: ({ children }: { children?: ReactNode }) => <>{children}</>,
139139
}));
140-
vi.mock('../pages/settings/WorkspaceTimezonePrompt', () => ({ WorkspaceTimezonePrompt: () => null }));
140+
vi.mock('../pages/settings/FirstRunChecklist', () => ({ FirstRunChecklist: () => null }));
141141
vi.mock('../components/RootLandingRedirect', () => ({ RootLandingRedirect: () => null }));
142142
vi.mock('../components/SetupRoute', () => ({ SetupRoute: () => null }));
143143
vi.mock('../components/FormPage', () => ({ FormPage: () => <GrantProbe testId="public-form" /> }));

‎ui/apps/console/src/loadLocales.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ let bootPainted: Promise<void> | null = null;
4040
* page load, so every reader that waits on it is released by the same paint.
4141
*
4242
* Shared by the console's two readers whose answer no first-paint surface
43-
* needs, this one and `WorkspaceTimezonePrompt`'s settings read. It waits on
44-
* the splash's DOM marker rather than on any one component, because both are
45-
* mounted beside the routes, under the splash. A tab opened in the background
43+
* needs, this one and `FirstRunChecklist`'s settings read. It waits on the
44+
* splash's DOM marker rather than on any one component, because neither is
45+
* the surface the splash waits for. A tab opened in the background
4646
* paints no frame, so it resolves when the tab is first shown.
4747
*/
4848
export function whenBootPainted(): Promise<void> {

‎ui/apps/console/src/pages/auth/SetupPage.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
Label,
3333
} from '@object-ui/components';
3434
import { withConsoleBase } from '../../utils/consoleBase';
35-
import { browserTimeZone } from '../settings/workspaceTimezonePromptLogic';
35+
import { browserTimeZone } from '../settings/firstRunChecklistLogic';
3636

3737
const AUTH_BASE = `${import.meta.env.VITE_SERVER_URL || ''}/api/v1/auth`;
3838

0 commit comments

Comments
 (0)