Skip to content

refactor(web): resolve #5513 TODO by using branchUserLabel in agent-shell-layout - #5548

Open
pedrofrxncx wants to merge 1 commit into
mainfrom
refactor/agent-shell-branch-label-w3
Open

refactor(web): resolve #5513 TODO by using branchUserLabel in agent-shell-layout#5548
pedrofrxncx wants to merge 1 commit into
mainfrom
refactor/agent-shell-branch-label-w3

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves a TODO in agent-shell-layout that was waiting for #5513 to land. That PR added the branchUserLabel helper to handle Better Auth's quirk of storing an unset display name as "" (not null), which made the previous ??-based fallback skip the email local-part and always slug to "user".

Replaces the manual fallback expression with a call to branchUserLabel, reducing code duplication and moving the logic to its single authorized home in the shared branch-name module.

Change

  • Added branchUserLabel to the import from @decocms/shared/branch-name
  • Replaced the inline session?.user?.name || session?.user?.email?.split("@")[0] expression with branchUserLabel(session?.user)
  • Removed the TODO comment

Net: -3 lines, behavior unchanged (the branchUserLabel implementation uses || instead of ??, which is the fix #5513 made)

Testing

No existing test file for this component. Verified with:

  • bun run fmt — passing
  • cd apps/web && bunx tsc --noEmit — no type errors
  • bunx oxlint apps/web/src/layouts/agent-shell-layout/index.tsx — no lint errors

CI runs full type check and test suite.


Summary by cubic

Use branchUserLabel from @decocms/shared/branch-name in agent-shell-layout to centralize user label fallback and keep branch names correct when Better Auth sets an empty display name.

  • Refactors
    • Replaced inline name || email local-part with branchUserLabel(session?.user).
    • Updated import and removed the TODO.

Written for commit 49914a3. Summary will update on new commits.

Review in cubic

…hell-layout

The branchUserLabel helper was added in #5513 to handle Better Auth's empty
display name issue (stored as "" not null). This resolves the TODO that was
waiting for that PR to land, reducing code duplication and using the single
authorized place for that fallback logic.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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