Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
094acc6
refactor(ui): bump --type-body line-height to 160%
Astro-Han May 9, 2026
41739ad
refactor(ui): rewrite markdown.css per W3 lock 2026-05-10
Astro-Han May 9, 2026
4f3d66e
feat(ui): tighten markdown DOMPurify allowlist
Astro-Han May 9, 2026
f67b9b5
feat(ui): render markdown task list as 16px svg circles
Astro-Han May 9, 2026
62188fc
feat(ui): wire markdown task-list rewriter + tests
Astro-Han May 9, 2026
76a99eb
feat(ui): route markdown link clicks via desktop bridge
Astro-Han May 9, 2026
05c36fb
feat(ui): default markdown links to window.api desktop bridge
Astro-Han May 9, 2026
bcd2125
docs(ui): add W3 markdown body storybook coverage
Astro-Han May 9, 2026
79ef9fe
fix(ui): apply crosscheck round-1 P1/P2 fixes
Astro-Han May 9, 2026
c2d6ba1
fix(ui): in-document anchor links and tabular path wrapping
Astro-Han May 9, 2026
ac8ec04
fix(ui): route only true remote links through desktop handler; refram…
Astro-Han May 9, 2026
f79d8a5
fix(ui): mirror link routing in main-process parser; switch table to …
Astro-Han May 9, 2026
b420773
fix(ui): tighten table padding to W3 lock densities; drop #top specia…
Astro-Han May 9, 2026
228c03d
chore(ui): add temporary diagnostic logs to markdown link handler
Astro-Han May 9, 2026
21e5b1f
fix(desktop): resolve relative reveal paths to absolute in main process
Astro-Han May 9, 2026
035cbd9
chore(desktop): diagnostic log in show-item-in-folder ipc handler
Astro-Han May 9, 2026
55a5d35
fix(ui): inject session workspace cwd into markdown reveal links
Astro-Han May 9, 2026
4513bc3
refactor(ui): switch resolveLinkAction to a denylist for unsafe schemes
Astro-Han May 9, 2026
d74021f
fix(ui): land W3 markdown-body Phase 4 revisions and hand-test fixes
Astro-Han May 10, 2026
08a474d
feat(ui): three-dim hover on markdown links for stronger affordance
Astro-Han May 10, 2026
0c328de
refactor(ui): drop hover offset shift to remove visual jump
Astro-Han May 10, 2026
253afdb
chore(deps): bump dompurify 3.3.1 → 3.4.2
Astro-Han May 10, 2026
5ff7791
fix(ui): recognize Windows UNC paths and strip ./ in reveal join
Astro-Han May 10, 2026
0a16f46
fix(ui): keep markdown link/image handlers reactive to prop changes
Astro-Han May 10, 2026
7663c25
fix(ui): show markdown copy-button on keyboard focus
Astro-Han May 10, 2026
e6d6fae
fix(ui): wrap task-item label so nested blocks stay below the icon
Astro-Han May 10, 2026
970f1a5
fix(ui): treat Windows drive-letter paths as reveal targets
Astro-Han May 10, 2026
9e09307
fix(ui): only show zoom-in cursor when onImageClick is wired
Astro-Han May 10, 2026
b275c2c
fix(ui): reject protocol-relative URLs in DOMPurify allowlist
Astro-Han May 10, 2026
c2f8270
docs(ui): align W3 Blockquote story with current left-rule CSS
Astro-Han May 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions packages/desktop-electron/src/main/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,13 @@ export function registerIpcHandlers(deps: Deps) {
})
})

ipcMain.handle("show-item-in-folder", (_event: IpcMainInvokeEvent, path: string) => {
shell.showItemInFolder(path)
ipcMain.handle("show-item-in-folder", (_event: IpcMainInvokeEvent, target: string) => {
// shell.showItemInFolder needs an absolute path; relative resolves go
// through the renderer where the chat session knows its workspace cwd.
// process.cwd() in a packaged Electron main process is not the user's
// workspace (typically `/Users/<user>` on macOS), so absolutizing here
// would silently reveal the wrong file.
shell.showItemInFolder(target)
})

ipcMain.handle("stat-paths", async (_event: IpcMainInvokeEvent, paths: string[]) => {
Expand Down
11 changes: 10 additions & 1 deletion packages/desktop-electron/src/main/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ const renderer = new marked.Renderer()

renderer.link = ({ href, title, text }: Tokens.Link) => {
const titleAttr = title ? ` title="${title}"` : ""
return `<a href="${href}"${titleAttr} class="external-link" target="_blank" rel="noopener noreferrer">${text}</a>`
// The desktop renderer's document-level handler grabs every .external-link
// and routes it to shell.openExternal. Only mark true remote links so hash
// anchors and repo paths fall through to the markdown component's own
// click handler (scroll / Finder reveal). Keep this in sync with the
// jsParser branch in packages/ui/src/context/marked.tsx.
const remote = /^(?:https?:\/\/|mailto:)/i.test(href)
if (remote) {
return `<a href="${href}"${titleAttr} class="external-link" target="_blank" rel="noopener noreferrer">${text}</a>`
}
return `<a href="${href}"${titleAttr}>${text}</a>`
}

export function parseMarkdown(input: string) {
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
preload = ["./happydom.ts"]
3 changes: 3 additions & 0 deletions packages/ui/happydom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { GlobalRegistrator } from "@happy-dom/global-registrator"

GlobalRegistrator.register()
3 changes: 2 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"generate:tailwind": "bun run script/tailwind.ts"
},
"devDependencies": {
"@happy-dom/global-registrator": "20.0.11",
"@tailwindcss/vite": "catalog:",
"@tsconfig/node22": "catalog:",
"@types/bun": "catalog:",
Expand All @@ -55,7 +56,7 @@
"@solidjs/meta": "catalog:",
"@solidjs/router": "catalog:",
"diff": "catalog:",
"dompurify": "3.3.1",
"dompurify": "3.4.2",
"fuzzysort": "catalog:",
"katex": "0.16.27",
"luxon": "catalog:",
Expand Down
Loading
Loading