The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 20:45 UTC
fix(web): thread links render as chips, and thread chips show the project icon (#22621)
oliver committed
Oct 20, 2026 at 23:24 UTC
15dc7b0130cac797de6330c47ebd15e672546cf3
3 files changed
+30
-32
apps/web/src/components/ThreadContextChip.tsx
+9
-2
@@ -1,9 +1,11 @@
1
+import { scopeProjectRef } from "@t3tools/client-runtime/environment";
2
import type { ThreadContextRecord } from "@t3tools/contracts";
3
import { Link } from "@tanstack/react-router";
4
import { MessagesSquareIcon } from "lucide-react";
5
5
-import { useThreadShell } from "~/state/entities";
6
+import { useProject, useThreadShell } from "~/state/entities";
7
import { ContextChip, ContextChipLabel } from "./ContextChip";
8
+import { ProjectFavicon } from "./ProjectFavicon";
9
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
10
11
export function ThreadContextChip(props: {
@@ -13,6 +15,7 @@ export function ThreadContextChip(props: {
15
}) {
16
const { environmentId, threadId } = props.record;
17
const shell = useThreadShell({ environmentId, threadId });
18
+ const project = useProject(shell ? scopeProjectRef(environmentId, shell.projectId) : null);
19
const title = shell?.title?.trim() || props.record.title;
20
return (
21
<Tooltip>
@@ -26,7 +29,11 @@ export function ThreadContextChip(props: {
29
data-markdown-copy={props.copyMarkdown}
30
className="no-underline"
31
>
29
- <MessagesSquareIcon />
32
+ {project ? (
33
+ <ProjectFavicon project={project} className="size-[1.17em] self-center" />
34
+ ) : (
35
+ <MessagesSquareIcon />
36
+ )}
37
<ContextChipLabel>{title}</ContextChipLabel>
38
</ContextChip>
39
}
apps/web/src/components/chat/MarkdownThreadLink.tsx
+7
-26
@@ -1,15 +1,13 @@
1
-import { scopeProjectRef, scopeThreadRef } from "@t3tools/client-runtime/environment";
1
+import { scopeThreadRef } from "@t3tools/client-runtime/environment";
2
import type { EnvironmentId, ThreadId } from "@t3tools/contracts";
3
import {
4
formatThreadLink,
5
percentDecodedThreadLinkId,
6
resolveThreadLinkRef,
7
} from "@t3tools/shared/threadLinks";
8
-import { Link } from "@tanstack/react-router";
9
-import { MessageSquareTextIcon } from "lucide-react";
8
11
-import { useProject, useThreadRefs, useThreadShell } from "../../state/entities";
12
-import { ProjectFavicon } from "../ProjectFavicon";
9
+import { useThreadRefs, useThreadShell } from "../../state/entities";
10
+import { ThreadContextChip } from "../ThreadContextChip";
11
12
export function MarkdownThreadLink(props: {
13
readonly environmentId: EnvironmentId;
@@ -31,28 +29,11 @@ export function MarkdownThreadLink(props: {
29
const thread = local ?? remote;
30
const environmentId = thread?.environmentId ?? props.environmentId;
31
const threadId = thread?.id ?? props.threadId;
34
- const project = useProject(
35
- thread === null ? null : scopeProjectRef(environmentId, thread.projectId),
36
- );
32
const title = thread?.title.trim() || props.label;
33
return (
39
- <Link
40
- to="/$environmentId/$threadId"
41
- params={{ environmentId, threadId }}
42
- title={thread === null ? "Thread no longer available" : project?.title}
43
- data-markdown-copy={formatThreadLink(threadId, title)}
44
- >
45
- <span
46
- className="ms-[0.25em] me-[0.2em] inline-flex size-[14px] [vertical-align:-0.125em]"
47
- aria-hidden
48
- >
49
- {project === null ? (
50
- <MessageSquareTextIcon className="block size-full shrink-0" />
51
- ) : (
52
- <ProjectFavicon project={project} className="size-full" />
53
- )}
54
- </span>
55
- {title}
56
- </Link>
34
+ <ThreadContextChip
35
+ record={{ environmentId, threadId, title: props.label }}
36
+ copyMarkdown={formatThreadLink(threadId, title)}
37
+ />
38
);
39
}
apps/web/src/index.css
+14
-4
@@ -1955,13 +1955,23 @@ code {
1955
text-decoration: none;
1956
}
1957
1958
-/* File links are Chips and own their color and focus ring. */
1959
-.chat-markdown a:not(.chat-markdown-file-link) {
1958
+/* File links and context chips own their color and focus ring. */
1959
+.chat-markdown a:not(.chat-markdown-file-link, :has([data-slot="context-chip-label"])) {
1960
color: var(--info-foreground);
1961
}
1962
1963
-.chat-markdown a:not(.chat-markdown-file-link, [data-markdown-image-link]):hover,
1964
-.chat-markdown a:not(.chat-markdown-file-link, [data-markdown-image-link]):focus-visible {
1963
+.chat-markdown
1964
+ a:not(
1965
+ .chat-markdown-file-link,
1966
+ :has([data-slot="context-chip-label"]),
1967
+ [data-markdown-image-link]
1968
+ ):hover,
1969
+.chat-markdown
1970
+ a:not(
1971
+ .chat-markdown-file-link,
1972
+ :has([data-slot="context-chip-label"]),
1973
+ [data-markdown-image-link]
1974
+ ):focus-visible {
1975
background-image: radial-gradient(circle, currentcolor 0.75px, transparent 1px);
1976
background-position: left bottom;
1977
background-repeat: repeat-x;