-
-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: add all Draw.io themes to settings panel (#499) #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the Draw.io theme selection functionality by expanding from 2 themes to 5 themes (Classic, Simple, Minimal, Sketch, Atlas) and replacing the toggle button with a more scalable dropdown selector. The changes include proper internationalization support for all theme names across English, Chinese, and Japanese languages.
- Introduced a new theme configuration module with
DrawioThemetype and constants - Replaced toggle button UI with Select dropdown component for better scalability
- Added complete i18n translations for all 5 theme names in three languages
- Added CSS fix for Chrome iframe touch events (though implementation is incomplete)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
lib/drawio-themes.ts |
New configuration file defining DrawioTheme type and available themes array |
app/[lang]/page.tsx |
Updated theme type from binary choice to DrawioTheme enum, modified change handler to accept theme parameter instead of toggling |
components/settings-dialog.tsx |
Replaced Button toggle with Select dropdown, updated to use new theme selection API |
components/chat-panel.tsx |
Updated props interface to use DrawioTheme type and theme change handler |
lib/i18n/dictionaries/en.json |
Added theme name translations under nested themes object |
lib/i18n/dictionaries/zh.json |
Added Chinese translations for all 5 theme names |
lib/i18n/dictionaries/ja.json |
Added Japanese translations for all 5 theme names |
app/globals.css |
Added diagrams-iframe CSS class with touch-action property for Chrome compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@xinyang20, please try to resolve the Copilot-suggested changes. |
|
Okay, got it. |
|
@Biki-dev I have resolved all Copilot-suggested changes, please review my code again, thanks. |
|
@xinyang20 Thanks for the contribution, could you also check the CI result? |
|
Okey, I will check and fix it later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const DRAWIO_THEME_LABELS: Record< | ||
| DrawioTheme, | ||
| keyof typeof DRAWIO_THEMES | string | ||
| > = { |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect type definition in DRAWIO_THEME_LABELS. The type 'keyof typeof DRAWIO_THEMES | string' is incorrect because DRAWIO_THEMES is an array, not an object with named keys. The values should simply be 'string' type since they represent translation dictionary keys like "classic", "simple", etc.
| const DRAWIO_THEME_LABELS: Record< | |
| DrawioTheme, | |
| keyof typeof DRAWIO_THEMES | string | |
| > = { | |
| const DRAWIO_THEME_LABELS: Record<DrawioTheme, string> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot is correct. It is better to apply its sugguestion.
…i-draw-io into feature/add-more-themes
|
@DayuanJiang Hello! I have fixed the previous issues. As shown in the checks, all code-level workflows (including E2E Tests, Docker Build, and Lint) have passed successfully. The only failure is the Vercel deployment, which explicitly shows the error: Account is blocked. This appears to be an infrastructure configuration issue unrelated to my changes. Could you please check your Vercel account status so that this PR can be merged? Thanks!
|
DayuanJiang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xinyang20 Thanks for the fix! I tested it locally and it works well. However, I spotted a few minor issues. Once you address them, I'll merge the PR.
Also, please update the PR description—it mentions change to global.css, but there aren't any in this PR.
| const DRAWIO_THEME_LABELS: Record< | ||
| DrawioTheme, | ||
| keyof typeof DRAWIO_THEMES | string | ||
| > = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot is correct. It is better to apply its sugguestion.
| drawioUi: "min" | "sketch" | ||
| onToggleDrawioUi: () => void | ||
| drawioUi: import("@/lib/drawio-themes").DrawioTheme | ||
| onDrawioUiChange: (theme: import("@/lib/drawio-themes").DrawioTheme) => void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works but is unconventional. Better to add an explicit import.
| "sketch": "Sketch", | ||
| "atlas": "Atlas" | ||
| }, | ||
| "closeProtection": "Close Protection", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The close projection has been delete from the main. Could you rebase on the latest main first?
|
Got it. I'll work on these changes and commit soon. |

Summary
Closes #499
Changes
app/[lang]/page.tsx: AddDrawioThemetype andDRAWIO_THEMESconstantcomponents/chat-panel.tsx: Update props type for theme selectioncomponents/settings-dialog.tsx: Replace Button with Select dropdownlib/i18n/dictionaries/*.json: Add theme translationsapp/globals.css: Add touch-action fix for ChromeTest plan