feat: [ENG-2490] add provider chip column to WebUI task list#586
feat: [ENG-2490] add provider chip column to WebUI task list#586ncnthien wants to merge 1 commit intoproj/persis-task-historyfrom
Conversation
|
Claude finished @ncnthien's task in 1m 42s —— View job PR Review: feat: [ENG-2490] add provider chip column to WebUI task listTasks
SummaryOverall score: 4 / 5 Clean, well-scoped addition. The utility function is minimal and correct, the component is a natural fit alongside What's good
Issues1. Missing edge-case test — The empty-string block covers 2. Implicit empty-string handling in
3. Long className string in Minor readability nitpick — the class string is 130+ characters on one line. No functional issue; only matters if the formatter enforces a print-width rule. No concerns about
|
| @@ -0,0 +1,5 @@ | |||
| export function formatProviderModel(provider?: string, model?: string): string | undefined { | |||
| if (!provider) return undefined | |||
There was a problem hiding this comment.
nitpick: The falsy check !provider silently treats an empty string '' as missing, which is the intended behavior (covered by the test on line 23). However, the logic is slightly implicit. If there's ever a scenario where an empty string slips through from the wire type, the function already handles it correctly — just worth knowing this is intentional falsy-coercion, not an explicit === undefined guard.
| it('treats empty strings as missing', () => { | ||
| expect(formatProviderModel('', '')).to.equal(undefined) | ||
| expect(formatProviderModel('', 'gpt-5-pro')).to.equal(undefined) | ||
| }) | ||
| }) |
There was a problem hiding this comment.
suggestion: The empty-string block covers ('', '') and ('', 'gpt-5-pro') but misses the symmetric case: ('openai', ''). Based on the implementation !'' is truthy, so it would return just 'openai' — same as the "byterover internal" case. Adding one more assertion here would make the contract explicit:
| it('treats empty strings as missing', () => { | |
| expect(formatProviderModel('', '')).to.equal(undefined) | |
| expect(formatProviderModel('', 'gpt-5-pro')).to.equal(undefined) | |
| }) | |
| }) | |
| it('treats empty strings as missing', () => { | |
| expect(formatProviderModel('', '')).to.equal(undefined) | |
| expect(formatProviderModel('', 'gpt-5-pro')).to.equal(undefined) | |
| expect(formatProviderModel('openai', '')).to.equal('openai') | |
| }) |
| const label = formatProviderModel(provider, model) | ||
| if (!label) return null | ||
| return ( | ||
| <Badge className="text-muted-foreground mono max-w-full truncate text-[10px] tracking-wider" title={label} variant="outline"> |
There was a problem hiding this comment.
nitpick: The className string is quite wide (130+ chars). The existing TypeBadge keeps its className on one line too, so this is stylistically consistent — but if a linter or formatter run flags it, splitting into a cn(...) call would be the natural fix:
| <Badge className="text-muted-foreground mono max-w-full truncate text-[10px] tracking-wider" title={label} variant="outline"> | |
| <Badge | |
| className={cn('text-muted-foreground mono max-w-full truncate text-[10px] tracking-wider')} | |
| variant="outline" | |
| > | |
| {label} | |
| </Badge> |
(or simply wrap into a multi-line JSX if the formatter enforces it)
Summary
Type of change
Scope (select all touched areas)
Linked issues
Root cause (bug fixes only, otherwise write
N/A)Test plan
User-visible changes
List user-visible changes (including defaults, config, or CLI output).
If none, write
None.Evidence
Attach at least one:
Checklist
npm test)npm run lint)npm run typecheck)npm run build)mainRisks and mitigations
List real risks for this PR. If none, write
None.