You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f18adce
Browse filesBrowse the repository at this point in the historyBrowse files
feat(app-shell): prefill the first organization name from the sign-up e-mail (#30305)
Fixes#30136
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:云端注册后自动弹出的「创建组织」对话框,名称不再是空的。企业邮箱用域名推出公司名(`jane@acme.com` →
`Acme`),公共邮箱(gmail、qq、163 等,代码里的闭合清单)预填现成的「我的组织」/ "My
Organization"。名称可改,也可直接点创建;不会自动建组织,只对第一个组织生效。
- 为什么改:objectstack-ai/cloud#3559 裁决 A(预填默认名、一键继续)。公共邮箱的写法按 #30136 上的裁决
6652952865(A:复用 `workspace.default`),不新增文案键,不碰 ADR-0060 冻结的 `workspace`
命名空间。
- 风险与回滚:只改控制台对话框的初始值和一个中立的域名工具函数,不改接口与数据;回滚即 revert 本 PR。
- 先看:`ui/packages/app-shell/src/utils/emailDomain.ts`(域名规则与公共邮箱清单),以及
`CreateWorkspaceDialog.tsx` 里只在打开那一刻取默认值的那段。
- 两分钟验证:用 gmail 账号注册,看到「我的组织」;用 `@acme.com` 账号注册,看到 `Acme`。
- 需要你做的:无,席位复核后落地。
## What changes
- **New `ui/packages/app-shell/src/utils/emailDomain.ts`**:
product-neutral helpers named for what they compute: `emailDomain`,
`registrableLabel` (multi-part public suffixes such as `acme.co.uk`,
`acme.com.cn` → `acme`), `isPublicMailboxDomain` and the closed
`PUBLIC_MAILBOX_DOMAINS` list (subdomains included). It decides nothing
about what a caller shows, and it is not added to the utils barrel or
the package index.
- **`CreateWorkspaceDialog.tsx`** keeps only the company-versus-default
choice: a work domain gives its registrable label, capitalised
(`acme.com` → `Acme`). A public mailbox, or a punycode label, gives
`t('workspace.default')`. An address with no domain gives an empty name.
The default is read once when the dialog opens, for a user with no
organization yet; the field stays editable; nothing is created
automatically.
- **No i18n change.** `@object-ui/i18n` is untouched
(`workspace.default` already exists in all ten packs). ADR-0060 and
`product-specific.allowlist.json` are untouched. The product-neutral
ratchet passes.
- Changeset: `@object-ui/app-shell` patch.
## Tests
- `utils/__tests__/emailDomain.test.ts` (new) covers the domain rule
(multi-part suffixes, the generic-TLD control), every entry of the
closed list, subdomain and look-alike domains, punycode, and null
inputs.
- `CreateWorkspaceDialog.test.tsx` covers a gmail user (en "My
Organization", zh 「我的组织」, with one-submit create plus environment
provision); an `@acme.com` user (`Acme`); an editable field; empty-name
controls; and the name staying put while the organization list moves off
zero mid-submit.
- Local readings are in the dev's report on #30136 (comment 6653627193).
On the ratchet, the organizations tests, the util test and the i18n
parity/vocabulary tests: 22 files / 327 tests passed.
`@object-ui/app-shell` type-check passes. One ablation (public-mailbox
branch forced off) turns exactly the three public-mailbox cases red.
- The whole app-shell suite runs in CI's 16-shard Test UI.
## Acceptance notes
- Public-mailbox users get the generic 「我的组织」, not 「张三的组织」. This is the
accepted cost of ruling 6652952865, which keeps ADR-0060's frozen
`workspace` namespace shrink-only.
- ADR-0060 rule 3 says a frozen surface may only shrink. This PR still
grows `CreateWorkspaceDialog.tsx`, and objectstack-ai/cloud#3559 A
(2026-11-04), which names this dialog, is read as authorizing that
growth (recorded in 6652952865).
- Hyphenated labels keep their hyphen (`acme-labs.com` → `Acme-labs`);
only the first letter is capitalised.
- Not browser-verified against a live cloud stack; the behaviour is
pinned at component level with the real en/zh pack values.
- Out of scope, held for the cloud lane: the stale comment in cloud's
`packages/service-cloud/src/cloud-stack.ts` (objectstack-ai/cloud#3559's
cloud half).
## Verification
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at `7749a01a` derived 35 commands, and all
35 ran with exit 0 (`Run reconciliation — 35 derived, 35 run, 0
NOT-MEASURED, 0 UNRUN`). An earlier `Lint UI` red at `spec
check:liveness` (`query/searchFields → packages/objectql/src/engine.ts`)
came from main, not this diff (#30367). The
seat merged `origin/main` into this branch to pick up that fix.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Q4EjjRhUZjdy8VXs6Kkur2)_
<!-- signed: repo:cloud#3 · hotlong · session_01Q4EjjRhUZjdy8VXs6Kkur2
-->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
feat(app-shell): the first organization's create dialog opens with a default name, so one click continues
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
For a user with no organization yet — the dialog that opens right after sign-up — the organization name is prefilled from the user's e-mail. A work domain names the company from the domain's registrable label, capitalised (`jane@acme.com` → `Acme`, `jane@acme.co.uk` → `Acme`). A public mailbox domain (a closed list in code: gmail.com, outlook.com, qq.com, 163.com, proton.me and similar, subdomains included) names no company, so it takes the existing default organization name, "My Organization" / 「我的组织」 (`workspace.default`, already in every built-in pack; no translation key is added). An unlisted domain is treated as a work domain. The field stays editable, nothing is created until the user clicks, and creating a further organization still opens with an empty name. The e-mail domain rules live in a product-neutral app-shell util (`utils/emailDomain`), outside the organization pages.
0 commit comments