Fix connections list#1630
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates how the frontend determines UI theme (dark vs light) and applies it to code editor widgets and the connections list, including adding a dedicated dark-mode Cassandra icon.
Changes:
- Replace the
UiSettingsService.editorThemeAPI withUiSettingsService.isDarkModeand update consumers accordingly. - Apply the computed Monaco editor theme (
vs/vs-dark) across record view/edit code editors and dashboard editors. - Fix the connections list empty-state wording and swap Cassandra’s icon in dark mode by registering and using a new
cassandra-darkSVG.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/services/ui-settings.service.ts | Introduces isDarkMode and removes editorTheme getter. |
| frontend/src/app/components/ui-components/record-view-fields/json-editor/json-editor.component.ts | Computes editor theme from isDarkMode. |
| frontend/src/app/components/ui-components/record-view-fields/code/code.component.ts | Computes editor theme from isDarkMode. |
| frontend/src/app/components/ui-components/record-edit-fields/markdown/markdown.component.ts | Computes editor theme from isDarkMode. |
| frontend/src/app/components/ui-components/record-edit-fields/markdown/markdown.component.spec.ts | Updates mocks to use isDarkMode. |
| frontend/src/app/components/ui-components/record-edit-fields/json-editor/json-editor.component.ts | Injects UiSettingsService and computes editor theme from isDarkMode. |
| frontend/src/app/components/ui-components/record-edit-fields/json-editor/json-editor.component.html | Binds editor theme dynamically via [theme]. |
| frontend/src/app/components/ui-components/record-edit-fields/code/code.component.ts | Computes editor theme from isDarkMode. |
| frontend/src/app/components/ui-components/record-edit-fields/code/code.component.spec.ts | Updates mocks to use isDarkMode. |
| frontend/src/app/components/dashboard/db-table-view/db-table-widgets/db-table-widgets.component.ts | Computes editor theme from isDarkMode. |
| frontend/src/app/components/dashboard/db-table-view/db-table-actions/db-table-actions.component.ts | Computes editor theme from isDarkMode. |
| frontend/src/app/components/connections-list/own-connections/own-connections.component.ts | Adds isDarkMode state for template usage. |
| frontend/src/app/components/connections-list/own-connections/own-connections.component.html | Updates empty-state text and switches Cassandra icon in dark mode. |
| frontend/src/app/components/charts/chart-edit/chart-edit.component.ts | Computes editor theme from isDarkMode. |
| frontend/src/app/components/charts/chart-edit/chart-edit.component.spec.ts | Updates mocks to use isDarkMode. |
| frontend/src/app/app.component.ts | Registers the new cassandra-dark SVG icon. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| get isDarkMode(): boolean { | ||
| return this._isDarkMode; | ||
| } | ||
|
|
There was a problem hiding this comment.
Theme selection logic (isDarkMode ? 'vs-dark' : 'vs') is now duplicated across multiple components. Consider reintroducing a derived editorTheme (or similar) getter on UiSettingsService that maps isDarkMode to the code-editor theme string, so callers don’t need to repeat this mapping in many places.
| get editorTheme(): string { | |
| return this.isDarkMode ? 'vs-dark' : 'vs'; | |
| } |
| } | ||
|
|
||
| updateGlobalSetting(key: string, value: any) { | ||
| updateGlobalSetting(key: string, value: any) { |
There was a problem hiding this comment.
updateGlobalSetting is not indented like the other class methods, which makes the class formatting inconsistent and can trip up linting/formatting tools. Please align its indentation with the surrounding methods.
| updateGlobalSetting(key: string, value: any) { | |
| updateGlobalSetting(key: string, value: any) { |
No description provided.