Skip to content

Commit b4fd84a

Browse files
donjor-agent[bot]donjor
authored andcommitted
fix(web): rich Markdown file links follow upstream chip class removal
## What Changed `markdownEditorPresentation.ts` owns the file-link chip class string instead of importing `CHAT_FILE_TAG_CHIP_CLASS_NAME`. The value is copied verbatim from the current base, so rich Markdown file links render unchanged. ## Why Upstream `266d70c` (`pingdotgg#13192`) removed `CHAT_FILE_TAG_CHIP_CLASS_NAME` in favor of a React `ContextChip`. The editor decorates raw DOM and cannot render that component, so it keeps the class itself. Syncing `v0.0.43-nightly.20260923.2150` fails web typecheck on the removed import, blocking the sync. ## Checklist - [x] This PR is small and focused - [x] I explained what changed and why - [ ] I included before/after screenshots for any UI changes - [ ] I included a video for animation/interaction changes ## Fork trailers Refs #1277 Fork-Domain: markdown-editing Fork-Tier: bugfix Fork-Upstreamable: no Co-authored-by: donjor <[email protected]>
1 parent 50bb9de commit b4fd84a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎apps/web/src/components/files/markdownEditorPresentation.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { codeBlockSchema, linkSchema } from "@milkdown/preset-commonmark";
66
import { extendListItemSchemaForTask } from "@milkdown/preset-gfm";
77
import { $prose, $view } from "@milkdown/utils";
88

9-
import { CHAT_FILE_TAG_CHIP_CLASS_NAME } from "~/components/chat/FileTagChip";
109
import { resolvePierreIconColor } from "~/components/chat/PierreEntryIcon";
1110
import { resolveDiffThemeName } from "~/lib/diffRendering";
1211
import { getSyntaxHighlighterPromise } from "~/lib/syntaxHighlighting";
@@ -17,6 +16,11 @@ import {
1716
} from "~/pierre-icons";
1817
import { resolveRichMarkdownEditorLinkMeta } from "./richMarkdownEditorLinks";
1918

19+
// The chat file-mention chip look, owned here because the editor decorates raw DOM and
20+
// cannot render the React chip component.
21+
const FILE_LINK_CHIP_CLASS_NAME =
22+
"inline-flex h-[1.41em] max-w-full items-center gap-[0.33em] rounded-[0.5em] px-[0.5em] font-medium leading-none align-middle border border-border/70 bg-accent/40 text-foreground text-[12px] border-[color-mix(in_oklab,var(--context-chip-accent)_34%,var(--contrast-border))] bg-[color-mix(in_oklab,var(--context-chip-accent)_11%,transparent)] text-[color-mix(in_oklab,var(--context-chip-accent)_22%,var(--contrast-foreground))] [--context-chip-accent:oklch(0.62_0.11_215)]";
23+
2024
interface MarkdownEditorPresentationOptions {
2125
readonly cwd: { current: string };
2226
readonly sourcePath: { current: string };
@@ -205,7 +209,7 @@ function linkView(options: MarkdownEditorPresentationOptions) {
205209
iconSlot.replaceChildren();
206210
if (!file?.workspaceRelativePath) return;
207211

208-
dom.className = `${CHAT_FILE_TAG_CHIP_CLASS_NAME} t3-markdown-editor__file-link`;
212+
dom.className = `${FILE_LINK_CHIP_CLASS_NAME} t3-markdown-editor__file-link`;
209213
dom.dataset["filePath"] = file.workspaceRelativePath;
210214
dom.title = file.displayPath;
211215
const icon = iconElement(file.filePath, options.theme.current);

0 commit comments

Comments
 (0)