transcript: badge attachments with their type - #34
Open
Mark-Life wants to merge 1 commit into
Open
Conversation
Every attachment badged as `attachment`, so a skill listing and a file opened in the IDE looked identical until expanded. `eventBadgeLabel` humanises `attachmentType` mechanically, so a type that appears tomorrow reads as words with no code change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Problem:
Every attachment row in a session transcript badges as
attachment, so a skill listing and a file opened in the IDE look identical until you expand them. Both the inspector row (session-history.tsx) and the CLI row (sessions-history.tsx) label the badgee.toolName ?? e.kind, and attachments have notoolName. The transcript already knows the difference:handleAttachmentinpackages/core/src/services/sessions/parse.tsstores the rawattachment.typeon the event asattachmentType, and nothing rendered it.Solution:
eventBadgeLabelinpackages/core/src/services/sessions/labels.tsis the one badge rule for both transcripts: tool name when there is one, elseattachmentTypewith underscores replaced by spaces, else the bare kind.skill_listingbecomesskill listing,opened_file_in_idebecomesopened file in ide. The transform is mechanical rather than a lookup table, so a type Claude starts writing tomorrow reads as words on the day it appears. A missing, empty, or whitespace-only type falls back toattachment.attachmentTypejoinsROW_FIELDSinapps/inspector/src/lib/transcript-row.ts, so the memo comparison sees a badge that changed.Badge width in the CLI: unchanged.
BADGE_MAXthere is 20, not 12, soopened file in ide(18 chars) renders whole — the render test asserts the full string in an 80-cell frame. A future type longer than 20 chars clips, as tool names already do.The kind filter's
Attachmentsoption is untouched and still selectskind === "attachment", which is not broken but is now coarser than the rows beside it. One gap worth a follow-up: history search matchestitle, which holds the rawskill_listing, so searching the humanisedskill listingfinds nothing.Security Impact:
None.
Testing:
The core tests cover
skill_listing,opened_file_in_ide, an invented type, and the missing/empty/whitespace fallbacks. The CLI test renders a session of three attachments and asserts the humanised badges appear in the frame.bun run typecheckpasses across all 9 packages. Two pre-existing failures inpackages/core/test/agents.test.tsare unrelated and fail identically on the base commit. Before, all three rows readattachment; after, only the typeless one does.