feat(console): group tenancy posture affordances — org switcher as write context + org attribution (ADR-0105 Phase 1)#2858
Merged
Conversation
…ite context + org attribution (ADR-0105 Phase 1)
Under the group posture the server widens reads to the member's whole
organization set while writes land in the ACTIVE organization, so the
console must stop presenting the active org as a read boundary:
- @object-ui/auth: features.tenancyPosture ('single'|'group'|'isolated',
exported as TenancyPosture) mirrors the server's public auth config key.
- useTenancyPosture() (app-shell): posture from the cached config fetch;
undefined/unrecognized keeps every group affordance off, so non-group
deployments render pixel-identical to today.
- WorkspaceSwitcher: under group, labels the active org 'Working
organization' and explains the read/write split.
- RecordFormPage (create): org-walled objects show a 'Creates in <org>'
badge naming the D5 write target.
- Default list columns (ObjectView / InterfaceListPage / ObjectDataPage):
under group, org-walled objects get a TRAILING organization_id
attribution column — render-time only, never persisted into saved
view/page metadata.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015FebXPaaGrLhGKw1LHPbpL
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 27, 2026 08:55
21 tasks
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.
Closes the remaining Phase 1 console item of framework ADR-0105 (tracking: objectstack-ai/objectstack#3541; engine side landed in objectstack-ai/objectstack#3559).
Why
Under the new
grouptenancy posture the server widens reads to every organization the member belongs to (organization_id IN accessible_org_ids) while writes land in the ACTIVE organization (engine-stamped, D5). The console's existing presentation — "which org am I in = which org's data I see" — becomes wrong the moment a deployment switches postures, which is why the ADR's Risks section requires these affordances to land with Phase 1, not after.The switching mechanism is untouched: better-auth
organization.setActive→ sessionactiveOrganizationId→ engine write stamping is already the single channel, client and server agree on it. This PR only changes what the console communicates.What
@object-ui/auth—AuthPublicConfig.features.tenancyPosture('single' | 'group' | 'isolated', exported asTenancyPosture) mirrors the server's public auth config key (public-auth-features.ts, non-flag by design:multiOrgEnabledstays the capability gate; this only tells the console how to render org context).useTenancyPosture()(app-shell) — reads the posture from the promise-cached auth config fetch.undefined(older server, unrecognized value, fetch failure) keeps every group affordance off — non-group deployments render pixel-identical to today.WorkspaceSwitcher— undergroupthe dropdown labels the active org "Working organization" with the hint "New records are created here. Views show data from all your organizations."RecordFormPage(create mode) — org-walled objects (they carryorganization_id) show a "Creates in <active org>" badge naming the engine's write target.ObjectView,InterfaceListPage,ObjectDataPage) — undergroup, org-walled objects get a TRAILINGorganization_idattribution column so cross-org rows are attributable at a glance. Render-time only — never persisted into saved view/page metadata (a saved view must not fossilize a posture-dependent column set); the view-creation prefill path is deliberately left untouched.Verification
turbo build(29 tasks) andturbo lintclean for@object-ui/auth+@object-ui/app-shelland dependents.vitest run packages/app-shell packages/auth— 231 files, 1950 tests, all passing.WorkspaceSwitcher.test.tsx(group label + hint; isolated/unknown postures keep today's rendering),ObjectView.defaultColumns.test.tsx+InterfaceListPage.defaults.test.tsxorg-attribution cases (append-last, non-walled objects untouched, no dupes, off-flag is a no-op).Not in this PR
Deeper "all my organizations" console affordances (aggregated cross-org views, org quick-filters) are tracked as Phase 2 in objectstack-ai/objectstack#3541. The three-plants-one-group dogfood acceptance runs against a
group-posture backend once this lands.🤖 Generated with Claude Code
https://claude.ai/code/session_015FebXPaaGrLhGKw1LHPbpL
Generated by Claude Code