ref(seer): simplify block component states#115589
Conversation
📊 Type Coverage Diff
🔍 4 new type safety issues introduced
This is informational only and does not block the PR. |
ce5a2f8 to
c63c12e
Compare
|
@cursoragent bugbot review |
Bugbot Review CompleteI've completed a thorough review of this Seer Agent chat components refactor against production bug patterns. Here's what I found: SummaryOverall: Clean refactor with good defensive coding practices. No high-confidence runtime bugs detected. The code demonstrates solid engineering:
Findings1. Type Safety (MEDIUM confidence) - Inherited from type definitionLocation: The type coverage bot correctly flagged const toolLinkByCallId = useMemo(() => {
const map = new Map<string, Record<string, any> | undefined>();
(block.tool_results || []).forEach((result, idx) => {
if (result?.tool_call_id) {
map.set(result.tool_call_id, block.tool_links?.[idx]?.params);
}
});
return map;
}, [block.tool_links, block.tool_results]);Context: This matches the source type definition in Impact: Weakens type safety but unlikely to cause runtime errors since the code defensively accesses properties with optional chaining ( Recommendation: Consider tightening the 2. React Key Using Non-Unique Content (LOW confidence)Location: {todos.map(todo => {
const checked = todo.status === 'completed';
return (
<Flex key={todo.content} as="li" gap="sm" align="center">Issue: Using Impact: Low - todos typically have unique descriptions, but edge cases could cause list rendering bugs. Fix suggestion: // If TodoItem has an ID field, use that:
<Flex key={todo.id} as="li" gap="sm" align="center">
// Or combine with index as fallback:
{todos.map((todo, idx) => (
<Flex key={`${todo.content}-${idx}`} as="li" gap="sm" align="center">Positive Observations✅ Null safety: Consistent use of optional chaining throughout ( ConclusionThis refactor maintains or improves code quality compared to the original monolithic implementation. The type coverage regression is due to inherited type definitions, and the defensive coding patterns used make runtime errors unlikely. The only minor improvement would be using stable React keys for todo lists. No blocking issues found. This PR is safe to merge from a bug pattern perspective. |
1660b45 to
4339a8e
Compare
4339a8e to
8b16858
Compare
|
Works inconsistently ("here's the breakdown..")
Link https://sentry.dev.getsentry.net:7999/issues/7306809142/events/c6582c5f284e4f8a9fd8a63745ce370a/ |
- Thread readOnly through BlockContext so BlockActionBar hides in read-only sessions (regression caught by Sentry review bot) - Replace Record<string, any> with typed ToolLinkParams interface for known tool link metadata keys - Split monolithic index.spec.tsx into colocated per-component test files (user.spec, assistant.spec, toolUse.spec) Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Co-authored-by: Priscila Oliveira <priscila.oliveira@sentry.io>
Co-authored-by: Priscila Oliveira <priscila.oliveira@sentry.io>
Co-authored-by: Priscila Oliveira <priscila.oliveira@sentry.io>
Replace styled components with scraps layout props and use CopyToClipboardButton per review feedback.
Text and InlineCode overrides in SeerMarkdown can produce nested <a> tags when the content is already inside a markdown link. Add a context provider on the Link override so both skip linkification in that case. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>





Deep refactor of Seer Agent chat components.
MarkedTextrenderer with the newMarkdowncomponent (see feat(scraps): Markdown component #115025), unblocks streaming animation, component customizatinBlockContext.blockComponents.tsxinto focused per-role modules (chat/assistant.tsx,chat/toolUse.tsx,chat/user.tsx) that match the actual data shapes from the backendpostProcessLLMMarkdowninto theMarkdownText component overridetodosToMarkdownin favor of a directTodoListcomponentstyled(MarkedText)wrappers<Markdown component={{ }} />overridesonMouseEnter,onMouseExitcallbacks—action buttons are toggled via CSS and now support:focus-within