Repository navigation
Commit 8018e00
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
File tree
- .changeset
- ui
- apps/console/src
- pages/settings
- __tests__
- packages
- app-shell/src
- layout
- __tests__
- i18n/src
- __tests__
- locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
422 | 424 | | |
423 | 425 | | |
424 | 426 | | |
425 | | - | |
426 | | - | |
427 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
428 | 431 | | |
429 | 432 | | |
430 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
431 | 444 | | |
432 | 445 | | |
433 | 446 | | |
| |||
486 | 499 | | |
487 | 500 | | |
488 | 501 | | |
489 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
490 | 508 | | |
491 | 509 | | |
492 | 510 | | |
| |||
0 commit comments