refactor(web): resolve stale TODO by using branchUserLabel in agent-shell-layout - #5534
Open
pedrofrxncx wants to merge 1 commit into
Open
refactor(web): resolve stale TODO by using branchUserLabel in agent-shell-layout#5534pedrofrxncx wants to merge 1 commit into
pedrofrxncx wants to merge 1 commit into
Conversation
…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.
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.
Follows #5513 (which added
branchUserLabeltopackages/shared/src/branch-name.tsto fix empty-display-name branches falling back to the literal "user"). This call site inagent-shell-layout/index.tsxhad its ownTODO: swap for branchUserLabel once decocms/studio#5513 landscomment, sitting on hand-rolledsession?.user?.name || session?.user?.email?.split("@")[0]logic — a duplicate of exactly whatbranchUserLabeldoes. #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 eachgenerateBranchNamecall site (asheader-actions.tsxandapps/api/src/tools/thread/create.tsalready do).No behavior change:
||in the old code andbranchUserLabel's||chain are equivalent (both skip empty-stringnameand 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 --noEmitin apps/web,bunx oxlinton 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-layoutwithbranchUserLabelfrom@decocms/shared/branch-nameto 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.