Skip to content

TT-7549 fix: show Switch Teams button for first-time mobile users#443

Open
nabalone wants to merge 2 commits into
developfrom
TT-7549_switch-team-button-first-time-mobile
Open

TT-7549 fix: show Switch Teams button for first-time mobile users#443
nabalone wants to merge 2 commits into
developfrom
TT-7549_switch-team-button-first-time-mobile

Conversation

@nabalone

Copy link
Copy Markdown
Collaborator

Summary

Fixes TT-7549 — the Switch Teams button was missing for first-time mobile users, leaving them able to create/access only Personal Audio Projects with no path to Add Team or Team projects.

The button was hidden for any user whose only team is their personal team (teams.length === 0). That condition is also true for a normal first-time mobile user who simply hasn't joined a team yet — so they lost the button and, with it, the route to Add Team.

Changes

  • Detect true Work-Alone-Offline / PAP-like users via the existing offlineOnly global (the canonical Work-Alone-Offline signal set at login in Access.tsx), not empty-team-list alone.
  • Extract the shared check into a new useIsPapLike hook (utils/useIsPapLike.ts, following the repo's one-hook-per-file convention) so ProjectsScreen and the SwitchTeamsGuard in SwitchTeams share one source of truth.
  • ProjectsScreen now computes isPapLike = useIsPapLike() && isPersonal, replacing the inline teams.length === 0 && teamDirectoryReady check that lacked the offlineOnly gate.

Test plan

  • As a first-time mobile user (online, no teams yet): Switch Teams button is visible and leads to the picker / Add Team.
  • As a Work-Alone-Offline (offlineOnly) user with only a personal team: Switch Teams button stays hidden (redirects to team home), preserving TT-6962 behavior.
  • npm run typecheck passes.

🤖 Generated with Claude Code

The Switch Teams button was hidden for any user whose only team is their
personal team (teams.length === 0), which incorrectly caught normal
first-time mobile users who have not yet joined a team — leaving them
unable to reach Add Team or access Team projects.

Detect true Work-Alone-Offline / PAP-like users via the existing
`offlineOnly` global instead of empty team list alone. Extract the shared
check into a `useIsPapLike` hook so ProjectsScreen and the SwitchTeamsGuard
in SwitchTeams stay in sync.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Boolean(personalTeam) &&
teams.length === 0 &&
teamDirectoryReady &&
(!isOffline || offlineOnly);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gtryus Just want to flag that I am just removing the !isOffline part because it being true allows for an undesirable isPapLike=true

The shared useIsPapLike hook gated on (!isOffline || offlineOnly), which is
true for any online user — so a first-time online mobile user (no teams yet)
was still classified PAP-like and lost the Switch Teams button. Use the
offlineOnly global alone, the reliable local-only signal set at login, and
drop the isOffline dependency (which was also undefined during transient
default-context renders).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nabalone
nabalone marked this pull request as ready for review July 18, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant