Skip to content
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

feat(desktop): add settings schema and integrate settings service #1824

Merged
merged 5 commits into from
Dec 6, 2024

Conversation

Red-Asuka
Copy link
Member

@Red-Asuka Red-Asuka commented Dec 5, 2024

This pull request includes several changes that primarily focus on replacing the posts schema with a new settings schema and integrating it throughout the codebase. Additionally, it introduces a new PlatformType to differentiate between desktop and web platforms. Below are the most important changes:

Schema and Database Changes:

  • Replaced the posts schema with a new settings schema in the database configuration files (apps/desktop/src/database/db.main.ts, apps/desktop/src/database/db.renderer.ts). [1] [2] [3]
  • Removed the posts schema file and added a new settings schema file with various settings attributes (apps/desktop/src/database/schemas/posts.ts, apps/desktop/src/database/schemas/settings.ts). [1] [2]

Service and Configuration Updates:

  • Introduced useSettingsService to manage settings in the database and update the store (apps/desktop/src/database/services/SettingsService.ts).
  • Updated the createWindow function to use settings from the database for window dimensions and theme (apps/desktop/src/main/index.ts). [1] [2] [3]

Platform Type Integration:

  • Added a new PlatformType type to differentiate between desktop and web platforms (packages/types/base.ts).
  • Updated various files to provide the PlatformType and conditionally render settings based on the platform (apps/desktop/src/renderer/src/main.ts, apps/web/src/main.ts, packages/ui/src/components/SettingsView.vue). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Miscellaneous:

  • Added a new alias for the database directory in the Vite config and tsconfig.web.json files (apps/desktop/electron.vite.config.ts, apps/desktop/tsconfig.web.json). [1] [2]
  • Updated imports and usage of settings store in various files to reflect the new structure (apps/web/src/database/services/SettingsService.ts, packages/ui/src/stores/useSettingsStore.ts). [1] [2]

@Red-Asuka Red-Asuka changed the title Lyd/2.0.0 feat(desktop): add settings schema and integrate settings service Dec 5, 2024
@Red-Asuka Red-Asuka self-assigned this Dec 5, 2024
@Red-Asuka Red-Asuka added this to the v2.0.0-alpha.1 milestone Dec 5, 2024
@Red-Asuka Red-Asuka requested a review from ysfscream December 5, 2024 09:46
@Red-Asuka Red-Asuka added refactor Refactor code or architecture desktop MQTTX Desktop labels Dec 5, 2024
@Red-Asuka Red-Asuka marked this pull request as ready for review December 5, 2024 09:46
@ysfscream ysfscream merged commit 1abc5a4 into dev/2.0.0 Dec 6, 2024
5 checks passed
@ysfscream ysfscream deleted the lyd/2.0.0 branch December 6, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop MQTTX Desktop refactor Refactor code or architecture
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants