Skip to content

fix(theme): support tweakcn registry json imports#107

Merged
BunsDev merged 1 commit into
mainfrom
meow/tweakcn-import-json-modal-fixes
May 21, 2026
Merged

fix(theme): support tweakcn registry json imports#107
BunsDev merged 1 commit into
mainfrom
meow/tweakcn-import-json-modal-fixes

Conversation

@BunsDev

@BunsDev BunsDev commented May 21, 2026

Copy link
Copy Markdown
Member

Summary

  • add shadcn registry JSON parsing for tweakcn cssVars.light / cssVars.dark themes
  • route the import modal through CSS-or-JSON parsing and allow .json drag/drop
  • keep the existing debounced parse and bounded editor behavior that resolves the paste/overflow path on current main

Closes #91.
Closes #92.
Supersedes #99.
Supersedes #106.

Verification

  • ./script/check_ai_attribution
  • ./script/check_rebrand
  • git diff --check
  • cargo test -p warp-app themes::tweakcn_import --features local_fs
  • cargo check -p warp-app --bin cast-codes --features gui

Copilot AI 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.

Pull request overview

Adds support for importing tweakcn themes from shadcn registry JSON (in addition to the existing CSS export format), and wires the import modal to accept/paste/drag-drop JSON input.

Changes:

  • Introduces parse_blocks_or_json and a JSON registry parser that extracts cssVars.light / cssVars.dark OKLCH tokens.
  • Refactors OKLCH parsing into shared helpers used by both CSS and JSON paths.
  • Updates the import modal to route parsing through the CSS-or-JSON entrypoint and accept .json files via drag/drop.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
app/src/themes/tweakcn_import.rs Adds registry JSON parsing and shared OKLCH/CSS-decls parsing helpers plus tests.
app/src/settings_view/import_theme_modal.rs Switches parsing to CSS-or-JSON and extends drag/drop to accept .json.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/themes/tweakcn_import.rs
Comment thread app/src/themes/tweakcn_import.rs
@BunsDev BunsDev merged commit 269d29a into main May 21, 2026
17 of 28 checks passed
@BunsDev BunsDev deleted the meow/tweakcn-import-json-modal-fixes branch May 21, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants