Polish chat UI and provider prompts #2451
Closedsandersonstabo(GitHub profile, opens in a new tab)wants to merge 16 commits into
main fromrefs/pull/2451/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
- @@ -0,0 +324,21 @@324+Matched the `Initialize Git` header action's icon-to-label spacing to `Add action` by wrapping the label with the same small left margin treatment.325+Added local Spell-style `ShimmerText` and `BlurReveal` primitives, wired compact tool-call rows to shimmer on the tool name while the friendly tool summary is pending, then blur-reveal the summary when it arrives. Success checkmarks now use the app primary blue accent.326+Added a temporary chat-page tool-call preview card with failed, in-progress, empty, and delayed-complete rows so the shimmer-to-blur-reveal transition can be inspected in the live UI.327+Adjusted the temporary tool-call preview so failed rows keep neutral text while only the status indicator is destructive, and in-progress rows use a muted spinning loading-circle icon matching the empty minus color.328+Updated the temporary empty tool-call preview row so the tool call name remains foreground; only the status icon is muted.329+Set the tool summary blur-reveal transition speed to `speedReveal={2}` in both real compact tool-call rows and the temporary preview card.330+Fixed `ShimmerText` to use explicit theme colors instead of `currentColor` with transparent clipped text. Tool-call shimmer now stays foreground at rest and mutes through `muted-foreground` during the pass.331+Reworked `ShimmerText` to use a transform-animated muted overlay instead of animating clipped background-position, reducing shimmer hitching. Restored the tool summary blur reveal to a snappier `speedReveal={0.6}`.332+Removed `ShimmerText` from the codebase. Pending tool-call names now render as plain foreground text, with the muted loading-circle status icon carrying the in-progress state.333+Removed the temporary tool-call preview pane from the chat page and deleted its component.334+Removed `truncate` from the `BlurReveal` element in compact tool-call summary rows to avoid clipping animation bugs, and set its reveal speed to `0.2`.335+Matched the composer `@` and `/` popup to the composer card by removing the inset wrapper padding, using the same `rounded-[20px]` radius, forcing full width, and rendering empty states without an empty `CommandList` spacer.336+Updated shared button, select, menu, toggle, autocomplete, and combobox primitives so unlabeled-color icons in foreground label controls render as `text-muted-foreground` while the text remains foreground; explicit icon colors, item check indicators, and destructive menu icons are preserved.337+Aligned the custom provider model picker chevron with the trailing select chevrons by giving it the same trailing auto-margin behavior inside the trigger row.338+Nudged the provider model picker chevron farther right to match the visual trailing edge of adjacent select controls.339+Reworded the Keybindings and Diagnostics settings copy so each description includes its disk path inline as a styled code chip, and removed the duplicated separate path/status helper text.340+Restyled those settings path chips to match chat inline code styling with a smaller font, muted code background, and visible border.341+Removed mono/tabular styling from the Providers section's "Checked ... ago" timestamp so the full label renders in sans.342+Removed the vertical trait separators from the Text generation model settings row by allowing `TraitsPicker` trigger separators to be disabled for that usage.343+344+Note for ongoing work: append new bullets under this file's latest section (or add dated subsections) whenever further UI or behavior changes are made in this thread.apps/web/src/components/chat/MessagesTimeline.tsx line 868OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -826,5 +864,5 @@826864 duration: string | null,827865 timestampFormat: TimestampFormat,828866 ): string {829- if (!duration) return formatTimestamp(createdAt, timestampFormat);830- return `${formatTimestamp(createdAt, timestampFormat)} • ${duration}`;867+ if (!duration) return formatChatTimestamp(createdAt);868+ return `${formatChatTimestamp(createdAt)} • worked for ${duration}`;
- @@ -272,4 +293,4 @@272293 const stripped = prompt.replace(/^Ultrathink:\s*/i, "");273294 onPromptChange(stripped);274295 }275- updateDescriptors(replaceDescriptorCurrentValue(descriptors, descriptor.id, value));296+ updateDescriptors(replaceDescriptorCurrentValue(visibleDescriptors, descriptor.id, value));@@ -372,2 +367,19 @@372- </p>373- </div>367+ </div>368+ <div className="flex items-center gap-1.5 pe-1 opacity-0 transition-opacity duration-200 focus-within:opacity-100 group-hover:opacity-100">369+ {canRevertAgentWork && (370+ <Button371+ type="button"372+ size="xs"373+ variant="ghost"374+ disabled={ctx.isRevertingCheckpoint || ctx.isWorking}375+ onClick={() => ctx.onRevertUserMessage(row.message.id)}376+ title="Revert to this message"377+ >378+ <Undo2Icon className="size-3" />379+ </Button>380+ )}381+ <Tooltip>382+ <TooltipTrigger383+ render={<p className="text-right text-muted-foreground text-sm" />}384+ >385+ {formatChatTimestamp(row.message.createdAt)}
- apps/web/src/components/chat/ModelPickerContent.tsx lines 319 to 321OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -271,3 +316,6 @@271316 // When searching, we only respect locked provider (by driver kind),272317 // ignoring sidebar selection so account-scoped searches can find a273318 // model before the user chooses a specific instance rail item.319+ const openCodeScopedMatches = showOpenCodeTabs320+ ? rankedMatches.filter((rankedModel) => matchesOpenCodeLane(rankedModel.model))321+ : rankedMatches;apps/web/src/components/chat/TraitsPicker.tsx lines 296 to 296OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -272,4 +293,4 @@272293 const stripped = prompt.replace(/^Ultrathink:\s*/i, "");273294 onPromptChange(stripped);274295 }275- updateDescriptors(replaceDescriptorCurrentValue(descriptors, descriptor.id, value));296+ updateDescriptors(replaceDescriptorCurrentValue(visibleDescriptors, descriptor.id, value));apps/web/src/components/chat/MessagesTimeline.tsx lines 867 to 868OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -826,5 +864,5 @@826864 duration: string | null,827865 timestampFormat: TimestampFormat,828866 ): string {829- if (!duration) return formatTimestamp(createdAt, timestampFormat);830- return `${formatTimestamp(createdAt, timestampFormat)} • ${duration}`;867+ if (!duration) return formatChatTimestamp(createdAt);868+ return `${formatChatTimestamp(createdAt)} • worked for ${duration}`;apps/web/src/session-logic.ts lines 219 to 241Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -122,0 +218,21 @@218+219+/** Tool/command row completed without failure (blue check affordance). */220+export function workEntryIndicatesToolSuccess(entry: WorkLogEntry): boolean {221+ if (!workLogEntryIsToolLike(entry)) {222+ return false;223+ }224+ if (workEntryIndicatesToolFailure(entry)) {225+ return false;226+ }227+ if (entry.tone === "thinking") {228+ return false;229+ }230+ const ls = entry.toolLifecycleStatus;231+ if (ls === "failed" || ls === "declined") {232+ return false;233+ }234+ if (ls === "inProgress") {235+ return false;236+ }237+ return true;238+}
sandersonstabo(GitHub profile, opens in a new tab) changed the title
- apps/server/src/provider/userInputOptions.ts line 16OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +1,16 @@1+import type { UserInputQuestionOption } from "@t3tools/contracts";2+3+export const CUSTOM_USER_INPUT_OPTION: UserInputQuestionOption = {4+ label: "Other",5+ description: "Type your own answer",6+};7+8+export function withCustomUserInputOption(9+ options: ReadonlyArray<UserInputQuestionOption>,10+): ReadonlyArray<UserInputQuestionOption> {11+ const presetOptions = options.filter((option) => option.label.trim().toLowerCase() !== "other");12+ const customOption =13+ options.find((option) => option.label.trim().toLowerCase() === "other") ??14+ CUSTOM_USER_INPUT_OPTION;15+16+ return [...presetOptions.slice(0, 3), customOption];
- apps/web/src/components/chat/TraitsPicker.tsx line 432OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -377,20 +429,4 @@377429 }378430379- const triggerLabel =380- descriptors381- .map((descriptor) => {382- if (ultrathinkPromptControlled && descriptor.id === primarySelectDescriptor?.id) {383- return "Ultrathink";384- }385- if (descriptor.type === "boolean") {386- if (descriptor.id === "fastMode") {387- return descriptor.currentValue === true ? "Fast" : "Normal";388- }389- return `${descriptor.label} ${descriptor.currentValue === true ? "On" : "Off"}`;390- }391- return getProviderOptionCurrentLabel(descriptor);392- })393- .filter((label): label is string => typeof label === "string" && label.length > 0)394- .join(" · ") || "";395-396431 const isCodexStyle = provider === "codex";432+ const [openDescriptorId, setOpenDescriptorId] = useState<string | null>(null);
- apps/web/src/components/chat/MessagesTimeline.logic.ts line 188Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -156,3 +166,16 @@156166 continue;157167 }158168169+ const showCompletionDivider =170+ timelineEntry.message.role === "assistant" &&171+ input.completionDividerBeforeEntryId === timelineEntry.id;172+173+ let completionDividerDuration: string | null = null;174+ if (showCompletionDivider && lastAssistantMessage && lastAssistantDurationStart) {175+ const start = lastAssistantDurationStart;176+ const end = lastAssistantMessage.completedAt ?? lastAssistantMessage.createdAt;177+ const elapsed = computeElapsedMs(start, end);178+ if (elapsed !== null) {179+ completionDividerDuration = formatDuration(elapsed);180+ }181+ }
- apps/web/src/components/ChatView.tsx line 2844OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -2840,3 +2841,4 @@28402841 [activePendingUserInput],28412842 );284228432844+ const onSetActivePendingUserInputCustomAnswer = useCallback(
- apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx line 155OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -137,10 +138,18 @@138+ {prompt.questions.length > 1 ? (139+ <div className="flex items-center gap-3">140+ <span className="flex h-5 items-center rounded-md bg-muted/60 px-1.5 text-[10px] font-medium tabular-nums text-muted-foreground/60">141+ {questionIndex + 1}/{prompt.questions.length}137142 </span>138143 </div>139- </div>140- <p className="mt-1.5 text-sm text-foreground/90">{activeQuestion.question}</p>144+ ) : null}145+ <p className="text-sm text-foreground/90">{activeQuestion.question}</p>141146 {activeQuestion.multiSelect ? (142147 <p className="mt-1 text-xs text-muted-foreground/65">Select one or more options.</p>143148 ) : null}144149 <div className="mt-3 space-y-1">145150 {activeQuestion.options.map((option, index) => {146- const isSelected = progress.selectedOptionLabels.includes(option.label);151+ const isOther = option.label === "Other";152+ const customAnswerActive = progress.customAnswer.trim().length > 0;153+ const isSelected = isOther154+ ? customAnswerActive155+ : !customAnswerActive && progress.selectedOptionLabels.includes(option.label);apps/web/src/components/chat/ChatComposer.tsx line 1204Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1148,21 +1139,0 @@1148- if (!questionChanged && !textChangedExternally) {1149- return;1150- }1151-1152- promptRef.current = nextCustomAnswer;1153- const nextCursor = collapseExpandedComposerCursor(nextCustomAnswer, nextCustomAnswer.length);1154- setComposerCursor(nextCursor);1155- setComposerTrigger(1156- detectComposerTrigger(1157- nextCustomAnswer,1158- expandCollapsedComposerCursor(nextCustomAnswer, nextCursor),1159- ),1160- );1161- setComposerHighlightedItemId(null);1162- }, [1163- activePendingProgress?.customAnswer,1164- activePendingProgress?.activeQuestion?.id,1165- activePendingUserInput?.requestId,1166- promptRef,1167- ]);1168-
- apps/web/src/components/ChatView.tsx line 1440OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1437,3 +1437,4 @@14371437 // than the default Codex's. Falls back to first-match-by-kind when no14381438 // saved instance id is available or the instance no longer exists.14391439 const activeProviderInstanceId =1440+ selectedProviderByThreadId ??
- apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx line 149OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -113,3 +146,4 @@113146 const option = activeQuestion.options[optionIndex];114147 if (!option) return;115148 event.preventDefault();149+ if (option.label === "Other") {
- @@ -179,5 +205,16 @@179- </span>180- ) : null}181- </div>182- {isSelected ? <CheckIcon className="size-3.5 shrink-0 text-blue-400" /> : null}183- </button>205+ </>206+ );207+ return (208+ <div209+ key={`${activeQuestion.id}:${option.label}`}210+ role="button"211+ tabIndex={isResponding ? -1 : 0}212+ aria-disabled={isResponding}213+ onClick={() => {214+ if (isResponding) return;215+ handleOptionSelection(activeQuestion.id, option.label);216+ }}217+ className={className}218+ >219+ {content}220+ </div>
- apps/web/src/components/settings/settingsLayout.tsx lines 116 to 116OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -104,4 +113,4 @@104113 onClick();105114 }}106115 >107- <Undo2Icon className="size-3" />116+ <Undo2Icon className="mx-4 size-3" />
- @@ -1209,13 +1209,15 @@12091209 if (conflictsWithActiveTurn || missingTurnForActiveTurn) {12101210 return false;12111211 }1212- // Only the active turn may close the lifecycle state.12131212 if (activeTurnId !== null && eventTurnId !== undefined) {12141213 return sameId(activeTurnId, eventTurnId);12151214 }1216- // If no active turn is tracked, accept completion scoped to this thread.12171215 return true;12181216 default:12191217 return true;12201218 }12211219 })();1220+1221+ const shouldForceClearActiveTurn = shouldApplyThreadLifecycle1222+ ? false1223+ : event.type === "turn.completed" && activeTurnId !== null;@@ -1550,4 +1581,13 @@15501581 ? { providerInstanceId: event.providerInstanceId }15511582 : {}),15521583 runtimeMode: thread.session?.runtimeMode ?? "full-access",1553- activeTurnId: eventTurnId ?? null,1584+ activeTurnId: null,1585+ lastError: runtimeErrorMessage,1586+ updatedAt: now,1587+ },1588+ createdAt: now,1589+ });1590+ } else if (activeTurnId !== null) {1591+ yield* Effect.logWarning(1592+ "provider runtime ingestion: lifecycle guard blocked runtime.error but active turn is stuck — force-clearing",1593+ {
- @@ -0,0 +70,21 @@70+ : hue < 30071+ ? [x, 0, chroma]72+ : [chroma, 0, x];73+74+ return `#${[red, green, blue]75+ .map((channel) =>76+ Math.round((channel + match) * 255)77+ .toString(16)78+ .padStart(2, "0"),79+ )80+ .join("")}`;81+}82+83+function ProviderCustomColorPanel(props: {84+ readonly value: string;85+ readonly onCommit: (value: string) => void;86+}) {87+ const { onCommit } = props;88+ const initialHsv = useMemo(() => hexToHsv(props.value), [props.value]);89+ const [hsv, setHsv] = useState(initialHsv);90+ const currentColor = hsvToHex(hsv.h, hsv.s, hsv.v);
- @@ -6,0 +171,21 @@171+ lower.includes("enoent")172+ ) {173+ return new TextGenerationError({174+ operation,175+ detail: `${cliLabel(cliName)} is required but not available on PATH.`,176+ cause: error,177+ });178+ }179+ return new TextGenerationError({180+ operation,181+ detail: `${fallback}: ${error.message}`,182+ cause: error,183+ });184+ }185+186+ return new TextGenerationError({187+ operation,188+ detail: fallback,189+ cause: error,190+ });191+}@@ -0,0 +1,7 @@1+import type { UserInputQuestionOption } from "@t3tools/contracts";2+3+export function withCustomUserInputOption(4+ options: ReadonlyArray<UserInputQuestionOption>,5+): ReadonlyArray<UserInputQuestionOption> {6+ return options.filter((option) => option.label.trim().toLowerCase() !== "other");7+}
- @@ -648,3 +617,3 @@648617 );649618650619 const authRowNode = (@@ -0,0 +111,21 @@111+ workEntry.id,112+ workEntry.label,113+ workEntry.toolTitle,114+ workEntry.itemType,115+ workEntry.requestKind,116+ workEntry.command,117+ workEntry.detail,118+ workEntry.tone,119+ ],120+ );121+122+ useEffect(() => {123+ const workEntry = workEntryRef.current;124+ const modelSelection = modelSelectionRef.current;125+126+ if (!toolCallSummaries || !cwd || !shouldSummarizeWorkLogEntry(workEntry)) {127+ setLine(null);128+ return;129+ }130+131+ const key = cacheKey(environmentId, workEntry.id, modelKey);
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:
3084fa53-0cea-44f7-95f5-54e879fdf0fdYou 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)
Tip
💬 Introducing Slack Agent: The best way for teams to turn conversations into code.
Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack.
👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value).
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share