Skip to content

fix(ui): prioritize displayName over label in webchat session picker#13108

Merged
gumadeiras merged 2 commits intoopenclaw:mainfrom
mcaxtr:fix/6645-webchat-session-display-name
Feb 10, 2026
Merged

fix(ui): prioritize displayName over label in webchat session picker#13108
gumadeiras merged 2 commits intoopenclaw:mainfrom
mcaxtr:fix/6645-webchat-session-display-name

Conversation

@mcaxtr
Copy link
Copy Markdown
Contributor

@mcaxtr mcaxtr commented Feb 10, 2026

Summary

  • Fix: resolveSessionDisplayName() in app-render.helpers.ts checked label before displayName and formatted displayName entries as key (displayName) instead of displayName (key), causing the session picker dropdown to show raw session keys prominently instead of human-readable names.
  • Change: Swap priority so displayName is checked first, and use a consistent humanName (key) format for both displayName and label fallbacks.
  • Tests: 10 new unit tests covering all fallback combinations (displayName, label, both, neither, whitespace, key-matching, trimming).

Test plan

  • All 10 new tests fail before the fix, pass after (TDD)
  • pnpm build passes
  • pnpm check passes (format + typecheck + lint)
  • CI passes

Fixes #6645

Greptile Overview

Greptile Summary

This PR adjusts resolveSessionDisplayName() in ui/src/ui/app-render.helpers.ts so the session picker renders a human-friendly displayName ahead of label, and formats both as "<name> (<key>)" when the name differs from the raw session key. It also adds a focused node-only Vitest suite (ui/src/ui/app-render.helpers.node.test.ts) covering fallback/whitespace/trim/key-match cases to lock in the intended dropdown display behavior.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • The change is localized to string selection/formatting for session dropdown labels, with deterministic unit tests covering key edge cases (missing values, key matches, whitespace trimming). No other consumers parse this string, and the session row type matches the test fixture shape.
  • No files require special attention

The session picker dropdown in the webchat UI was showing raw session
keys instead of human-readable display names. resolveSessionDisplayName()
checked label before displayName and formatted displayName-based entries
as key (displayName) instead of displayName (key).

Swap the priority so displayName is checked first, and use a consistent
humanName (key) format for both displayName and label fallbacks.

Fixes openclaw#6645
@openclaw-barnacle openclaw-barnacle bot added the app: web-ui App: web-ui label Feb 10, 2026
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@mcaxtr
Copy link
Copy Markdown
Contributor Author

mcaxtr commented Feb 10, 2026

@greptile please re-review this PR.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +7 to +9
function row(overrides: Partial<SessionRow> & { key: string }): SessionRow {
return { kind: "direct", updatedAt: Date.now(), ...overrides };
}
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.

Nondeterministic updatedAt

row() sets updatedAt: Date.now(), which makes the test data time-dependent. If any logic in SessionsListResult["sessions"][number] consumers (or future changes to resolveSessionDisplayName) starts to incorporate updatedAt, these tests will become flaky across runs. Prefer a fixed constant timestamp in the helper (e.g. updatedAt: 0) to keep the fixtures deterministic.

Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/ui/app-render.helpers.node.test.ts
Line: 7:9

Comment:
**Nondeterministic `updatedAt`**

`row()` sets `updatedAt: Date.now()`, which makes the test data time-dependent. If any logic in `SessionsListResult["sessions"][number]` consumers (or future changes to `resolveSessionDisplayName`) starts to incorporate `updatedAt`, these tests will become flaky across runs. Prefer a fixed constant timestamp in the helper (e.g. `updatedAt: 0`) to keep the fixtures deterministic.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed — changed Date.now() to 0 in the test helper for deterministic fixtures.

@mcaxtr
Copy link
Copy Markdown
Contributor Author

mcaxtr commented Feb 10, 2026

@greptile please re-review this PR.

@gumadeiras gumadeiras self-assigned this Feb 10, 2026
@gumadeiras gumadeiras merged commit 137b7d9 into openclaw:main Feb 10, 2026
24 checks passed
@gumadeiras
Copy link
Copy Markdown
Member

Landed on main via 137b7d9.

Thanks @mcaxtr!

ProgramCaiCai pushed a commit to ProgramCaiCai/openclaw that referenced this pull request Feb 10, 2026
…penclaw#13108)

* fix(ui): prioritize displayName over label in webchat session picker

The session picker dropdown in the webchat UI was showing raw session
keys instead of human-readable display names. resolveSessionDisplayName()
checked label before displayName and formatted displayName-based entries
as key (displayName) instead of displayName (key).

Swap the priority so displayName is checked first, and use a consistent
humanName (key) format for both displayName and label fallbacks.

Fixes openclaw#6645

* test: use deterministic updatedAt in session display name tests
YanHaidao added a commit to YanHaidao/clawdbot that referenced this pull request Feb 10, 2026
* 'main' of github.com:YanHaidao/clawdbot: (94 commits)
  fix(auto-reply): prevent sender spoofing in group prompts
  Discord: add exec approval cleanup option (openclaw#13205)
  CI: extend stale timelines to be contributor-friendly (openclaw#13209)
  fix: enforce Discord agent component DM auth (openclaw#11254) (thanks @thedudeabidesai)
  refactor(security,config): split oversized files (openclaw#13182)
  Commands: add commands.allowFrom config
  CI: configure stale automation
  fix(signal): enforce mention gating for group messages (openclaw#13124)
  fix(ui): prioritize displayName over label in webchat session picker (openclaw#13108)
  Chore: add testflight auto-response
  Docker: include A2UI sources for bundle (openclaw#13114)
  fix: unify session maintenance and cron run pruning (openclaw#13083)
  docs: expand vulnerability reporting guidelines in SECURITY.md
  docs: add vulnerability reporting guidelines to CONTRIBUTING.md
  refactor: consolidate fetchWithTimeout into shared utility
  fix(memory): default batch embeddings to off
  Improve code analyzer for independent packages, CI: only run release-check on push to main
  fix(tools): correct Grok response parsing for xAI Responses API (openclaw#13049)
  chore(deps): update dependencies, remove hono pinning
  Update contributing, deduplicate more functions
  ...
Hansen1018 pushed a commit to Hansen1018/openclaw that referenced this pull request Feb 10, 2026
…penclaw#13108)

* fix(ui): prioritize displayName over label in webchat session picker

The session picker dropdown in the webchat UI was showing raw session
keys instead of human-readable display names. resolveSessionDisplayName()
checked label before displayName and formatted displayName-based entries
as key (displayName) instead of displayName (key).

Swap the priority so displayName is checked first, and use a consistent
humanName (key) format for both displayName and label fallbacks.

Fixes openclaw#6645

* test: use deterministic updatedAt in session display name tests
michaelleone pushed a commit to michaelleone/openclaw that referenced this pull request Feb 11, 2026
…penclaw#13108)

* fix(ui): prioritize displayName over label in webchat session picker

The session picker dropdown in the webchat UI was showing raw session
keys instead of human-readable display names. resolveSessionDisplayName()
checked label before displayName and formatted displayName-based entries
as key (displayName) instead of displayName (key).

Swap the priority so displayName is checked first, and use a consistent
humanName (key) format for both displayName and label fallbacks.

Fixes openclaw#6645

* test: use deterministic updatedAt in session display name tests
skyhawk14 pushed a commit to skyhawk14/openclaw that referenced this pull request Feb 13, 2026
…penclaw#13108)

* fix(ui): prioritize displayName over label in webchat session picker

The session picker dropdown in the webchat UI was showing raw session
keys instead of human-readable display names. resolveSessionDisplayName()
checked label before displayName and formatted displayName-based entries
as key (displayName) instead of displayName (key).

Swap the priority so displayName is checked first, and use a consistent
humanName (key) format for both displayName and label fallbacks.

Fixes openclaw#6645

* test: use deterministic updatedAt in session display name tests
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…penclaw#13108)

* fix(ui): prioritize displayName over label in webchat session picker

The session picker dropdown in the webchat UI was showing raw session
keys instead of human-readable display names. resolveSessionDisplayName()
checked label before displayName and formatted displayName-based entries
as key (displayName) instead of displayName (key).

Swap the priority so displayName is checked first, and use a consistent
humanName (key) format for both displayName and label fallbacks.

Fixes openclaw#6645

* test: use deterministic updatedAt in session display name tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webchat session picker shows raw keys instead of displayName

2 participants