Rework message metadata, timestamps, and tool work log rows #3022
Mergedjuliusmarmingemerged 8 commits into
main fromrefs/pull/3022/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- apps/web/src/components/chat/MessagesTimeline.tsx line 699Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -615,8 +598,15 @@598+ );599+ const hasOverflow = nonEmptyEntries.length > MAX_VISIBLE_WORK_LOG_ENTRIES;615600 const visibleEntries =616601 hasOverflow && !isExpanded617- ? groupedEntries.slice(-MAX_VISIBLE_WORK_LOG_ENTRIES)618- : groupedEntries;619- const hiddenCount = groupedEntries.length - visibleEntries.length;620- const onlyToolEntries = groupedEntries.every((entry) => entry.tone === "tool");621- const showHeader = hasOverflow || !onlyToolEntries;622- const groupLabel = onlyToolEntries ? "Tool calls" : "Work log";602+ ? nonEmptyEntries.slice(-MAX_VISIBLE_WORK_LOG_ENTRIES)603+ : nonEmptyEntries;604+ const hiddenCount = nonEmptyEntries.length - visibleEntries.length;605+ const onlyToolEntries = nonEmptyEntries.every((entry) => workLogEntryIsToolLike(entry));606+ const headerTitle = onlyToolEntries607+ ? nonEmptyEntries.length === 1608+ ? "1 tool call"609+ : `${nonEmptyEntries.length} tool calls`610+ : "work log";611+612+ if (nonEmptyEntries.length === 0) return null;@@ -128,0 +226,21 @@226+export function workEntryIndicatesToolSuccess(entry: WorkLogEntry): boolean {227+ if (!workLogEntryIsToolLike(entry)) {228+ return false;229+ }230+ if (workEntryIndicatesToolFailure(entry)) {231+ return false;232+ }233+ if (entry.tone === "thinking") {234+ return false;235+ }236+ const ls = entry.toolLifecycleStatus;237+ if (ls === "failed" || ls === "declined") {238+ return false;239+ }240+ if (ls === "inProgress") {241+ return false;242+ }243+ if (ls === "stopped") {244+ return false;245+ }246+ return true;
- apps/web/src/components/chat/MessagesTimeline.tsx line 962OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -971,10 +957,6 @@971957 }972958973959 return (974- <ChatMarkdown975- text={props.text}976- cwd={props.markdownCwd}977- skills={props.skills}978- className="text-foreground"979- lineBreaks980- />960+ <div className="whitespace-pre-wrap wrap-break-word text-sm leading-relaxed text-foreground">961+ <SkillInlineText text={props.text} skills={props.skills} />962+ </div>
- @@ -1281,4 +1420,19 @@12811420 </div>12821421 </div>1283- {hasChangedFiles && !previewIsChangedFiles && (1284- <div className="mt-1 flex flex-wrap gap-1 pl-6">1422+ {expanded && canExpand && expandedBody ? (1423+ <div1424+ className="mt-2 ms-7 border-s border-border/45 ps-3 pt-0.5"1425+ onClick={stopRowToggle}1426+ onPointerDown={stopRowToggle}1427+ >1428+ <pre className="max-h-64 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-muted-foreground">1429+ {expandedBody}1430+ </pre>1431+ </div>1432+ ) : null}1433+ {hasChangedFiles && (1434+ <div1435+ className="mt-1 flex flex-wrap gap-1"1436+ onClick={stopRowToggle}1437+ onPointerDown={stopRowToggle}1438+ >
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XL
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- @@ -128,0 +227,21 @@227+export function workEntryIndicatesToolSuccess(entry: WorkLogEntry): boolean {228+ if (!workLogEntryIsToolLike(entry)) {229+ return false;230+ }231+ if (workEntryIndicatesToolFailure(entry)) {232+ return false;233+ }234+ if (entry.tone === "thinking") {235+ return false;236+ }237+ const ls = entry.toolLifecycleStatus;238+ if (ls === "failed" || ls === "declined") {239+ return false;240+ }241+ if (ls === "inProgress") {242+ return false;243+ }244+ if (ls === "stopped") {245+ return false;246+ }247+ return true;@@ -1214,0 +1307,21 @@1307+ (workEntry.sourceActivityKind === "runtime.error" || !workLogEntryIsToolLike(workEntry));1308+ const iconWrapperClass = cn(1309+ "flex size-5 shrink-0 items-center justify-center",1310+ showWarningIndicator1311+ ? "text-destructive"1312+ : showDestructiveRowStyle1313+ ? "text-destructive"1314+ : workEntry.tone === "tool" || showFailedIndicator1315+ ? "text-muted-foreground"1316+ : iconConfig.className,1317+ );1318+ const headingClass = showWarningIndicator1319+ ? "font-medium text-warning"1320+ : showDestructiveRowStyle1321+ ? "font-medium text-destructive"1322+ : "font-medium text-foreground";1323+ const turnSettled = !activity.activeTurnInProgress;1324+ const showNeutralIndicator = !turnSettled && workEntryIndicatesToolNeutralStatus(workEntry);1325+ const showSuccessIndicator =1326+ workEntryIndicatesToolSuccess(workEntry) ||1327+ (turnSettled && workEntryIndicatesToolNeutralStatus(workEntry));
juliusmarminge merged this1916ac6
juliusmarminge closed this
Sign in to join this conversation.



Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
bf6a3784-d9fc-43c7-838e-0eb2a557ffb8You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands and usage tips.