Skip to content

feat(chatui): reuse Shiki for workspace code previews - #10023

Merged
Soulter merged 1 commit into
masterfrom
codex/chatui-workspace-syntax-highlighting
Sep 10, 2026
Merged

Soulter merged 1 commit into
masterfrom
codex/chatui-workspace-syntax-highlighting

Conversation

@Soulter

@Soulter Soulter commented Sep 10, 2026

Copy link
Copy Markdown
Member

Workspace source files currently appear as plain text. Reuse the existing shared Shiki highlighter in both the sidebar preview and the larger preview dialog, with language detection from filenames and GitHub light/dark themes.

This PR is based directly on master and can be merged independently of #10022. It adds no workspace tabs, PDF support, dependencies, or additional language bundles. Plain text remains available while highlighting loads or fails, unsupported languages use the shared text fallback, and stale results are ignored when files or themes change.

Validation:

  • pnpm build and pnpm exec vue-tsc --noEmit passed on the independent master-based branch.
  • Shiki smoke checks passed for singleton reuse, Python highlighting in both themes, unsupported-language fallback, and HTML escaping.
  • Prettier, ruff format ., ruff check ., and git diff --check passed.
  • Browser interaction testing is left to the maintainer.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. The preview now inserts generated markup with v-html; if the Shiki rendering path fails to escape workspace-file contents, a malicious file could execute script in the dashboard and expose data before the change is reverted. Reverting removes the new execution path, but any data exposed during the affected sessions cannot be recovered.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
astrbot-docs f0c9fda Commit Preview URL

Branch Preview URL
Sep 10 2026, 03:00 PM

@Soulter
Soulter added this pull request to stack #10032 September 10, 2026 14:07
@Soulter
Soulter removed this pull request from stack #10032 September 10, 2026 14:48
@Soulter
Soulter force-pushed the codex/chatui-workspace-syntax-highlighting branch from d07b56b to f0c9fda Compare September 10, 2026 14:57
@Soulter
Soulter changed the base branch from codex/chatui-workspace-preview to master September 10, 2026 14:57
@Soulter
Soulter merged commit 5cc5617 into master Sep 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant