Skip to content

Conversation

@xinyang20
Copy link

@xinyang20 xinyang20 commented Jan 4, 2026

Summary

  • Expand Draw.io style options from 2 to 5 themes (Classic, Simple, Minimal, Sketch, Atlas)
  • Replace toggle button with dropdown selector in settings dialog
  • Add i18n support for all theme names (English, Chinese, Japanese)
  • Add CSS fix for Chrome touch events on iframe

Closes #499

Changes

  • app/[lang]/page.tsx: Add DrawioTheme type and DRAWIO_THEMES constant
  • components/chat-panel.tsx: Update props type for theme selection
  • components/settings-dialog.tsx: Replace Button with Select dropdown
  • lib/i18n/dictionaries/*.json: Add theme translations
  • app/globals.css: Add touch-action fix for Chrome

Test plan

  • Verify all 5 themes work correctly in Draw.io editor
  • Test theme persistence after page refresh
  • Verify theme names display correctly in all 3 languages
  • Test dark mode + theme combinations
  • Test on Edge browsers

Copilot AI review requested due to automatic review settings January 4, 2026 11:44
Copy link
Contributor

Copilot AI left a 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 DrawioTheme type 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.

@Biki-dev
Copy link
Collaborator

Biki-dev commented Jan 4, 2026

@xinyang20, please try to resolve the Copilot-suggested changes.

@xinyang20
Copy link
Author

Okay, got it.

@xinyang20
Copy link
Author

@Biki-dev I have resolved all Copilot-suggested changes, please review my code again, thanks.

@Biki-dev Biki-dev requested a review from DayuanJiang January 4, 2026 12:19
@DayuanJiang
Copy link
Owner

@xinyang20 Thanks for the contribution, could you also check the CI result?

@xinyang20
Copy link
Author

Okey, I will check and fix it later.

Copilot AI review requested due to automatic review settings January 12, 2026 14:15
Copy link
Contributor

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

Comment on lines +63 to +66
const DRAWIO_THEME_LABELS: Record<
DrawioTheme,
keyof typeof DRAWIO_THEMES | string
> = {
Copy link

Copilot AI Jan 12, 2026

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.

Suggested change
const DRAWIO_THEME_LABELS: Record<
DrawioTheme,
keyof typeof DRAWIO_THEMES | string
> = {
const DRAWIO_THEME_LABELS: Record<DrawioTheme, string> = {

Copilot uses AI. Check for mistakes.
Copy link
Owner

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.

@xinyang20
Copy link
Author

@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!

image

Copy link
Owner

@DayuanJiang DayuanJiang left a 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.

Comment on lines +63 to +66
const DRAWIO_THEME_LABELS: Record<
DrawioTheme,
keyof typeof DRAWIO_THEMES | string
> = {
Copy link
Owner

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
Copy link
Owner

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",
Copy link
Owner

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?

@xinyang20
Copy link
Author

Got it. I'll work on these changes and commit soon.

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.

[Feature] Add all Draw.io themes to settings panel

3 participants