Skip to content

fix(mobile): keep organization management reachable from Profile in Personal context - #8454

Merged
iscekic merged 4 commits into
mainfrom
drain/profile-organization-personal
Oct 22, 2026
Merged

iscekic merged 4 commits into
mainfrom
drain/profile-organization-personal

Conversation

@iscekic

@iscekic iscekic commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Change

  • apps/mobile/src/components/profile-screen.tsx renders the Organization section
    whenever the signed-in account has memberships, not only while an organization is
    the active credit account.
  • In Personal context the row reads "Select an organization" and opens the existing
    account picker (useContextPicker, the same sheet the Credits card uses). After a
    choice, the section shows the selected organization's "Manage organization" /
    "View organization" row, which opens the organization hub.
  • The chooser waits for the stored selection to restore, so it never paints for a
    frame before the active organization's row.
  • Accounts with no memberships are unchanged: no section, and the hub keeps its own
    boundary.
  • No copy changes: the row reuses the existing organization.boundary.selectOrganization
    key, so no catalog or translation updates.

Verification

Mounted tests in apps/mobile (pnpm exec vitest run src/components/profile-screen):

  • Personal context with two memberships renders the section; its row opens the picker
    with Personal and both organizations listed and the current account checked; picking
    the second organization publishes it and stays on Profile.
  • Personal context with no memberships keeps the section hidden.
  • A selection that has not finished restoring renders no chooser.

Also run: pnpm typecheck, oxlint on the changed files, and the full mobile vitest
suite.

Android E2E on this VM at head 766440b: local dev stack, omp36 emulator,
disposable local account in two organizations (owner of one, member of the other).

  • Profile with the credits account on an organization: ORGANIZATION →
    "Manage organization" with that organization's name.
  • Credits account picker → Personal: the ORGANIZATION section stays on Profile and
    reads "Select an organization".
  • Tapping that row opens the account picker with Personal and both organizations;
    choosing the member-role organization stays on Profile and flips the section to
    "View organization" with that name, and tapping it opens that organization's hub
    (organization seats and the Members row).
  • Memberships removed, credits account on Personal: no ORGANIZATION section, so the
    no-membership boundary is unchanged.
  • Memberships restored, app restarted with Personal persisted: the section renders the
    select row again once the stored selection restores.

Screen captures from that run are published in a comment on this pull request.

Proxy answers

The owner's proxy gave these answers in the owner's place.

  1. Question: Personal control: In Personal context with memberships, how should the Organization section let the user reach organization management?
    Answer: Open the existing account picker
    Confidence: 0.72 · Precedent: Keep similar elements consistent across surfaces and do the least work possible: the thought row was asked to match the tool call row, and "do the least amount of work possible, with no drop in quality".
  2. Question: After choosing: After the user picks an organization from the Profile Organization row, where should it land?
    Answer: Stay on Profile
    Confidence: 0.55 · Precedent: Do the least work possible with no drop in quality: "skip work that doesn't need to be done".
  3. Question: Restore timing: The organization selection is restored from secure storage after mount. Should the Personal-context row wait for that restore?
    Answer: Wait for the restore
    Confidence: 0.85 · Precedent: Hold all UI work to the best-in-class standard with no layout shift: "CLS is a massive enemy".
  4. Question: Row copy: Which copy should the Personal-context row in the Organization section use?
    Answer: 'Select an organization' only
    Confidence: 0.72 · Precedent: Speed and least work: "do the least amount of work possible, with no drop in quality". The existing key is accurate for every role, so no new string is needed.
  5. Question: Sheet heading: When the Organization row opens the existing account picker, what heading should the sheet show?
    Answer: Keep 'Select account'
    Confidence: 0.70 · Precedent: Speed and least work: "skip work that doesn't need to be done". The sheet still lists Personal plus organizations, so 'Select account' is accurate and the shared hook stays unchanged.

…ersonal context

The Profile screen rendered the Organization section only while an
organization was the active credit account. Selecting Personal therefore
removed the section, and the organization hub has no account control of its
own, so organization management was reachable only by switching the credit
account back.

The section now renders in every credit-account context when the account has
memberships. In Personal context its row reads "Select an organization" and
opens the existing account picker (the same sheet the Credits card uses);
after a choice the section shows the selected organization's Manage/View row,
which opens the hub. The row waits for the stored selection to restore, so the
chooser never paints before the active organization's row. Accounts with no
membership keep the section hidden.

The row reuses the existing "Select an organization" key, so no catalog
changes were needed.

Verified on the Android emulator with a local test account in two
organizations: Personal keeps the Organization section, the row opens the
picker listing the memberships, and choosing the member-role organization
flips the row to View organization and opens its hub.
@iscekic iscekic added drain Work item from the findings drain explorer:android Finding surfaced by the Android explorer labels Oct 21, 2026
@iscekic

iscekic commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Android emulator evidence for the Profile Organization section, captured on a local dev build with a local test account in two organizations.

  • Personal selected: the Organization section stays on Profile and offers the select row.
  • That row opens the existing account picker, which lists Personal and both organizations.
  • After choosing an organization, the section shows that organization's View organization row.
  • Tapping the row opens that organization's hub.

The section captures are cropped above and below the changed area; the picker and hub captures are full-screen.

Profile with Personal selected showing the Organization section and its select row

Account picker opened from the Organization row

Organization row after choosing an organization

Organization hub reached from the row

@kilo-code-bot

kilo-code-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental change moves the Profile Organization section cases into profile-screen.organization.mounted.test.tsx and drops an unused helper export; the relocated cases keep their setup and assertions, the remaining imports in the queries suite are all still used, and no defect was found in the changed lines.

Assumptions: [INFERENCE] The mobile vitest suite and pnpm typecheck/oxlint results reported in the PR description were not re-run in this read-only review; the upstream origin/main merge commits are outside this PR's changed-file set and were not re-reviewed here.

Files Reviewed (5 files)
  • apps/mobile/src/components/profile-screen.organization.mounted.test.tsx
  • apps/mobile/src/components/profile-screen.queries.mounted.test.tsx
  • apps/mobile/src/components/profile-screen.signout.mounted.test.tsx
  • apps/mobile/src/components/profile-screen.test-helpers.tsx
  • apps/mobile/src/components/profile-screen.tsx
Previous Review Summary (commit 4b6dd40)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 4b6dd40)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the Profile screen Organization section change and its mounted tests; the picker wiring, restore gating, and member/no-membership paths are consistent with the existing account-picker implementation, and no changed-code defect was found.

Assumptions: [INFERENCE] The mobile vitest suite and pnpm typecheck/oxlint results reported in the PR description were not re-run in this read-only review.

Files Reviewed (4 files)
  • apps/mobile/src/components/profile-screen.tsx
  • apps/mobile/src/components/profile-screen.queries.mounted.test.tsx
  • apps/mobile/src/components/profile-screen.signout.mounted.test.tsx
  • apps/mobile/src/components/profile-screen.test-helpers.tsx

Reviewed by deepseek-flash-latest · Input: 61.6K · Output: 4.8K · Cached: 514.7K

Review guidance: REVIEW.md from base branch main

@iscekic iscekic added the merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. label Oct 21, 2026
@iscekic iscekic removed the merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. label Oct 21, 2026
@iscekic iscekic added merge:blocked:insufficient-e2e Verification does not cover the change merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. labels Oct 21, 2026
@iscekic

iscekic commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Android emulator run at the pull request head (766440b), on this work VM's local dev stack with a disposable local account that belongs to two organizations (owner of one, member of the other).

Steps and observations, in order:

  1. Profile with the credits account on an organization: the ORGANIZATION section reads "Manage organization" with the organization name.
  2. Credits account picker → Personal: the ORGANIZATION section stays on Profile and reads "Select an organization".
  3. Tapping that row opens the app's account picker: Personal and both organizations.
  4. Choosing the member-role organization stays on Profile and the section flips to "View organization" with that organization's name; tapping it opens that organization's hub (organization seats and the Members row).
  5. Account with the memberships removed: Personal Profile shows no ORGANIZATION section, so the no-membership boundary is unchanged.
  6. Memberships restored, app restarted, Personal still selected: the section renders the select row again after the stored selection restores.

All captures are full-screen, from the local dev build.

Profile in Personal context with the Organization section and its select row

Account picker opened from the Organization section

Organization section showing the chosen organization View organization row

Organization hub reached from the section row

Personal Profile without memberships with no Organization section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

drain Work item from the findings drain explorer:android Finding surfaced by the Android explorer merge:bot Bot-owned review; merge when ready once readiness passes and a review approves.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants