Skip to content

Commit 8018e00

Browse files
feat(console): org basics in one form, optional rows, 「Get started」 sidebar pill (#36791)
<!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8XYaHK8tRcyeRzCsYgtTSbs)_ Fixes #36739 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 管理员清单只剩一项必填:「组织基本信息」一张表单(名称、语言、国家/地区、时区、货币),点一次保存全部写入;邮件、邀请、内置 AI、外部 AI 改为「可选」,做了仍会自动打勾。 - 管理员在每个应用的侧栏底部看到「开始使用 n/m」,点开就地显示清单;必填项做完后自动消失。成员看不到。手机上放在应用首页菜单之后。 - 系统设置首页始终保留完整清单(含已完成项),做完后折成一行「查看清单」。 - 三个提议(手机位置、「本机隐藏」范围、自托管 SetupPage 暂不合并)你已同意,记录在 #36739;席位 L2 已通过,合并由席位落地。 ## What changes Following the maintainer's ruling on #36739 (one form, other rows optional, sidebar pill, no wizard): - **One required row, one save.** The administrator's first-run checklist folds the separate name / language-and-country / timezone / currency rows into one `organization_basics` row. Its form holds the organization's name and the four `localization` settings; values the server does not hold are suggested from the browser; a setting with neither a value nor a suggestion is required like the name; nothing is written before **Save**. Save renames the organization only when the name changed (`updateOrganization`), then writes the changed settings in one `saveSettingsNamespace('localization', …)` call. A refused rename or a refused/locked setting shows on its field, as before. The row is done when the organization has a real name (not the seeded `Default Organization`) and all four settings are set — read from the server, never from the click. - **Everything else is optional.** `mail`, `invite`, `ai_provider` and `connect_assistant` carry an 「Optional」 badge and still tick themselves. On the hosted profile `first_app` stays required and `first_record` stays optional. `checklistCompletion` now counts every drawn row in `done/total`, but `complete` is judged on required rows only; rows are ordered required first. - **Shared state.** The reads the Home card used to make (settings after boot paint, members, invitations, connected access, first record, launcher apps) move into `FirstRunChecklistProvider` (`firstRunChecklistState.tsx`), mounted once in the console's permissions scope, so Home's card, the Setup first page and the pill read one answer. Answers are keyed by org, user and permissions. - **「Get started n/m」 pill.** `FirstRunChecklistPill` renders for the administrator only (the provider answers `null` for anyone else), in every app: from 768 px up in the sidebar footer above the account button (on the folded icon rail only the icon stays; the count is in its accessible name and tooltip); on a phone after the app's menu on the app home. A press opens the checklist in place in a popover; a row's link closes it as its page loads, and going Back to the page it was opened on does not reopen it. The popover's X only closes it; 「Hide on this device」 under the list is the separate action that hides the pill and Home's card. It disappears once the required rows are done, or when the administrator hides it on this device. - **App-shell slot.** `@object-ui/app-shell` exports a product-neutral `SidebarFooterSlotProvider` (`'sidebar' | 'phoneAppHome'`); `UnifiedSidebar` draws the host's element in those two places (2 lines). The shell names no checklist (ADR-0060). This is the `Clause-②: yes (widening)`. - **Setup first page** (`placement="setupPage"`) always shows the full list with done rows, has no dismiss, and folds to one line with 「Show list」 once complete. - **i18n:** all eleven packs replace the per-setting strings with `console.firstRunChecklist.organizationBasics.*`, `pill.*` and `showList`; zh-Hant regenerated from zh-Hans. ## Tests - `firstRunChecklistLogic.test.ts`: `organizationBasics` (fields included only when declared, offers only for unset keys, done = named + all set); completion — optional rows never hold the list open, progress counts all rows, exactly four rows are optional. - `firstRunChecklistProfile.test.ts`: hosted profile with `organization_basics` + `first_app` required. - `FirstRunChecklist.test.tsx` (84 tests): admin-only reads; one required row on a fresh org (`0 of 3 done`); the basics form — prefill, one Save writes the name and the four keys, name required, a setting with no value and no browser suggestion required too (an `es-419` browser: no write, no 「saved」, the form stays open), only changed values sent, Cancel, refused settings write, refused rename, zh/en; Setup page full list; the pill — admin sees `0/3` and opens the popover, a member sees nothing, it disappears once basics are done, save from the popover, the popover's X only closes it (no hidden record), a row's link closes it and Back does not reopen it, 「Hide on this device」 hides it, zh label. - `UnifiedSidebar.footerSlot-36739.test.tsx`: the slot draws in the sidebar footer at 1440 px (`'sidebar'`) and after the app menu on the phone app home at 375 px (`'phoneAppHome'`); dropping either line in `UnifiedSidebar` fails its test; no provider draws nothing. - i18n: `de-quote-pairing-3876` count 134 → 132 after the merge of main (the removed `organizationName.todo` and `timezone.todo` lines are the only two de spans that go), `untranslated-identity-4376` allows `pill.count` (`{{done}}/{{total}}`, a pure format string). ## Acceptance notes - **Phone placement (accepted by the maintainer, recorded on #36739):** the pill sits after the app's menu on the phone app home (`PhoneAppHome`), the page that lists what the sidebar lists. On the phone app home the page's own end padding does not scroll out from under the bottom bar (the `h-full` route slot is overflowed by the page), so the pill's phone slot keeps the bar's height free below itself. The same defect hides ~33 px of the last menu row on a long phone app home without the pill; that pre-existing layout issue is reported to the seat, not fixed here. - **「Hide on this device」 kept (accepted by the maintainer):** it hides only the pill and Home's card; Setup's first page always shows the full list. - **Self-hosted SetupPage unchanged (accepted by the maintainer; not built):** SetupPage already writes the organization name; adding the four regional fields there would let the row start done on a fresh self-hosted install. Left for a follow-up card if wanted. - **Cost:** every console load (not only Home) now lists the settings manifests once after boot paint for any session that holds system permissions; only a session that may write `localization` goes on to read the namespaces, members and invitations. A session with no permissions spends nothing. - **Overlap:** `overlap-check` — merges cleanly with `origin/main`. The branch has merged main twice; `de-quote-pairing-3876` now reads main's 134 minus this PR's two spans = 132. ## Verification - `tsc --noEmit` for the console: clean. - Local vitest: the three checklist files (115), `packages/i18n` + app-shell `UnifiedSidebar*` / `ConsoleLayout*` / `console/__tests__` + console `pages`, `components` and `App.*` boot tests — about 6,600 tests, all green. - `dispatch-gates.mjs --commands` gates: all 41 named commands exit 0 (including `pnpm --dir ui exec vitest run scripts/`; 16 of them are checker `--self-test`s, which judge the checker, not this diff). - Browser, showcase stack (`objectstack dev --seed-admin --fresh`) + console dev server, zh-CN, frames attached in the project thread (`/mnt/project-files/issue-36739/`): 1. desktop admin — pill 「开始使用 1/4」 at the sidebar bottom; 2. popover open — 组织基本信息 (required), 邮件发送 / 连接外部 AI 助手 (可选), 显示已完成的项 (1); 3. the basics form in the popover — name empty (org still default), language/country prefilled from the browser, timezone set by the server; 4. Setup first page — full list with the done 邀请同事 row; 5. phone (iPhone 13) — pill after the app menu, clear of the bottom bar; popover above it; 6. member — no pill; 7. admin saves name + basics from the popover → pill gone; Setup first page folds to 「完成初始设置 已完成 2/4 · 查看清单」. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbY2FR4RafB2fexxeuA <!-- signed: repo:objectstack#1 · os-warren · session_01JQwxbY2FR4RafB2fexxeuA --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 236c804 commit 8018e00

26 files changed

Lines changed: 1942 additions & 1414 deletions
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/app-shell': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
feat(console): the first-run checklist asks for the organization's basics in one form, leaves the rest optional, and follows the administrator as a 「Get started n/m」 pill in the sidebar
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: none
11+
12+
The administrator's first-run checklist had five setup rows that each saved on their own (the organization's name, language and country, timezone, currency) and counted every row, so it only went away once mail, invitations and AI were set up too. Following the maintainer's ruling on objectstack#36739:
13+
14+
- **One form, one save.** A single 「Organization basics」 row opens one form with the organization's name, default language, country, timezone and currency. Values the server does not hold yet are suggested from the browser, and a setting with neither a value nor a suggestion must be filled in like the name; nothing is written until Save, which renames the organization (when the name changed) and writes the four settings in one call. A refused rename or a refused setting shows on its field, as before. The row is done once the organization has a real name and all four settings are set.
15+
- **Only the basics are required.** Mail, invitations, the built-in AI provider and connecting an outside assistant become optional rows (marked 「Optional」); they still tick themselves when the server says they are done. On the hosted profile, 「Put in your first app」 stays required. The checklist is complete, and stands aside on Home, once the required rows are done; its progress (n/m) still counts every row.
16+
- **A pill in every app.** For the administrator only, a 「Get started n/m」 pill sits at the bottom of every app's sidebar (on the folded icon rail it keeps its icon, with the count in its accessible name and tooltip). A press opens the checklist in place in a popover; the popover's X only closes it, and 「Hide on this device」 under the list hides the pill and Home's card. On a phone, which has no resident sidebar, the pill sits after the app's menu on the app's home page. It disappears once the required rows are done, or once the administrator hides it on this device.
17+
- **Setup's first page keeps the full list**, done rows included, even after the checklist is complete or hidden; a completed list folds to one line with 「Show list」.
18+
19+
`@object-ui/app-shell` exports a product-neutral `SidebarFooterSlotProvider` (with its `SidebarFooterSlot` and `SidebarFooterSlotPlace` types; places `'sidebar' | 'phoneAppHome'`) that the console fills; the shell names no checklist. `@object-ui/i18n` replaces the per-setting checklist strings in all eleven packs. Added under `console.firstRunChecklist`: `showList`, `hideHere`, `organizationBasics.{title,todo,name,nameRequired,prefilled,save,saved}`, `pill.{label,count,aria}`. Removed from `console.firstRunChecklist` (no reader is left in the console; a consumer that indexed them reads the new keys instead): `showDoneSplit`, `confirm`, `prefilled`, `organizationName.{title,todo,action}`, `languageCountry.{title,todo,saved}`, `timezone.{title,todo,saved}`, `currency.{title,todo,saved}`.

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

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
import { lazy, Suspense, useEffect, useMemo, type ReactNode } from 'react';
1313
import { Route, useParams, useLocation, Navigate } from 'react-router-dom';
14-
import { DefaultAppContent, ENVIRONMENT_SCOPE_QUERY, LauncherAppsProvider, LoadingFallback, LoadingScreen, SetupFirstPageSlotProvider, setupMetadataStudioPath, useAdapter } from '@object-ui/app-shell';
14+
import { DefaultAppContent, ENVIRONMENT_SCOPE_QUERY, LauncherAppsProvider, LoadingFallback, LoadingScreen, SetupFirstPageSlotProvider, SidebarFooterSlotProvider, setupMetadataStudioPath, useAdapter, type SidebarFooterSlotPlace } from '@object-ui/app-shell';
1515
import { AdapterCtx } from '@object-ui/react';
1616
import { MePermissionsProvider, ServerReadScope, releaseMePermissionsRequest, startMePermissionsRequest } from '@object-ui/permissions';
1717
import { createAuthenticatedFetch, useAuth } from '@object-ui/auth';
1818
import type { DataSource } from '@object-ui/types';
1919
import { LocalizationFetchProvider } from './LocalizationFetchProvider';
2020
import { FirstRunChecklist } from './pages/settings/FirstRunChecklist';
21+
import { FirstRunChecklistPill } from './pages/settings/FirstRunChecklistPill';
22+
import { FirstRunChecklistProvider } from './pages/settings/firstRunChecklistState';
2123
import { InAppFormRoute } from './components/InternalFormRoute';
2224
import { APPROVAL_ACTION_OBJECT, APPROVAL_REQUEST_OBJECT, routeApprovalRecordReads } from './services/approvalRequestsDataSource';
2325
import { studioLandingPath } from '@object-ui/app-shell';
@@ -422,12 +424,23 @@ export function ConsolePermissionsRequest(): null {
422424
/**
423425
* objectstack#36732 (item 5, option A) — an administrator's first-run
424426
* checklist at the top of the Setup app's first page, now that the desktop's
425-
* home page retired. The checklist decides who sees it (a session that may
426-
* write the settings it lists) and hides once the list is done; this route
427-
* sits under `ConsolePermissionsScope`, which answers the first.
427+
* home page retired. Since objectstack#36739 this is the FULL list, done rows
428+
* included, kept for looking back once it is finished. The checklist decides
429+
* who sees it (a session that may write the settings it lists); this route
430+
* sits under `ConsolePermissionsScope`, which answers that.
428431
*/
429432
function setupFirstPageChecklist() {
430-
return <FirstRunChecklist placement="top" />;
433+
return <FirstRunChecklist placement="setupPage" />;
434+
}
435+
436+
/**
437+
* objectstack#36739 — the administrator's 「Get started n/m」 pill at the bottom
438+
* of every app's sidebar (after the app's menu on a phone), opening the
439+
* first-run checklist in place. It stands aside for a member and once the
440+
* required rows are done.
441+
*/
442+
function sidebarFooterPill(where: SidebarFooterSlotPlace) {
443+
return <FirstRunChecklistPill where={where} />;
431444
}
432445

433446
/**
@@ -486,7 +499,12 @@ export function ConsolePermissionsScope({ children }: { children: ReactNode }) {
486499
drops an app the user's permission sets hide. One read for Home and
487500
every app, so this common ancestor holds it, beside the answer above. */}
488501
<LauncherAppsProvider endpoint={`${serverUrl}/api/v1/me/apps`} fetcher={authFetch}>
489-
{children}
502+
{/* objectstack#36739 — the first-run checklist's reads, made once for
503+
every place it is drawn (the sidebar pill, Setup's first page,
504+
Home), so moving between apps asks nothing again. */}
505+
<FirstRunChecklistProvider>
506+
<SidebarFooterSlotProvider value={sidebarFooterPill}>{children}</SidebarFooterSlotProvider>
507+
</FirstRunChecklistProvider>
490508
</LauncherAppsProvider>
491509
</MePermissionsProvider>
492510
);

0 commit comments

Comments
 (0)