Skip to content

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

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

refactor(web): resolve stale TODO by using branchUserLabel in agent-shell-layout#5534
pedrofrxncx wants to merge 1 commit into
mainfrom
refactor/branch-user-label-agent-shell-w2

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Follows #5513 (which added branchUserLabel to packages/shared/src/branch-name.ts to fix empty-display-name branches falling back to the literal "user"). This call site in agent-shell-layout/index.tsx had its own TODO: swap for branchUserLabel once decocms/studio#5513 lands comment, sitting on hand-rolled session?.user?.name || session?.user?.email?.split("@")[0] logic — a duplicate of exactly what branchUserLabel does. #5513 merged a while ago; this closes the loop so the fallback logic lives in one place (branch-name.ts) instead of being copy-pasted at each generateBranchName call site (as header-actions.tsx and apps/api/src/tools/thread/create.ts already do).

No behavior change: || in the old code and branchUserLabel's || chain are equivalent (both skip empty-string name and fall through to the email local-part), so this is a pure duplication removal, not a bug fix.

Reviewer check: cd apps/web && bunx tsc --noEmit (green), bunx oxlint apps/web/src/layouts/agent-shell-layout/index.tsx (0 warnings/errors).

Locally ran: bun run fmt, bunx tsc --noEmit in apps/web, bunx oxlint on the touched file. No test file covers this specific effect, and the change is behavior-preserving, so no new test was added; full CI validates the rest.


Summary by cubic

Replaced the hand-rolled name/email fallback in agent-shell-layout with branchUserLabel from @decocms/shared/branch-name to centralize and keep branch naming consistent. No behavior change; this removes duplication and clears the old TODO.

Written for commit e5bec82. Summary will update on new commits.

Review in cubic

…hell-layout

The auto-adopt-branch effect hand-rolled the same name||email fallback that
branchUserLabel already encapsulates, with a TODO to swap once #5513 landed.
It has landed; use the shared helper so this call site can't drift from the
canonical fallback (branch-name.ts) again.
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