[PR #5617] [MERGED] fix: make theme uploads more tolerant #6916

Closed
opened 2026-03-23 23:17:15 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/5617
Author: @Xazin
Created: 6/24/2024
Status: Merged
Merged: 6/25/2024
Merged by: @Xazin

Base: mainHead: fix/tolerant-upload-theme


📝 Commits (1)

  • ae2e6b9 fix: make theme uploads more tolerant

📊 Changes

5 files changed (+109 additions, -21 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/theme_upload/theme_upload_view.dart (+5 -3)
📝 frontend/appflowy_flutter/packages/flowy_infra/lib/colorscheme/colorscheme.dart (+35 -0)
📝 frontend/appflowy_flutter/packages/flowy_infra/lib/plugins/bloc/dynamic_plugin_bloc.dart (+28 -14)
📝 frontend/appflowy_flutter/packages/flowy_infra/lib/plugins/service/models/flowy_dynamic_plugin.dart (+9 -4)
frontend/appflowy_flutter/test/unit_test/settings/theme_missing_keys_test.dart (+32 -0)

📄 Description

If there are missing keys in the light or dark theme file, we simply replace them with default values.

This is not a good way of handling errors, but it's better than failing indiscriminately without any proper feedback.

I've added a getMissingKeys to compare and see which values are missing, and written some quick unit tests for it. We should find a way to use it so we can let users know if their theme has missing values.

Relates: #5359

PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/5617 **Author:** [@Xazin](https://github.com/Xazin) **Created:** 6/24/2024 **Status:** ✅ Merged **Merged:** 6/25/2024 **Merged by:** [@Xazin](https://github.com/Xazin) **Base:** `main` ← **Head:** `fix/tolerant-upload-theme` --- ### 📝 Commits (1) - [`ae2e6b9`](https://github.com/AppFlowy-IO/AppFlowy/commit/ae2e6b9ec0e32c3715c38427924a046e3d6a2dbd) fix: make theme uploads more tolerant ### 📊 Changes **5 files changed** (+109 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/theme_upload/theme_upload_view.dart` (+5 -3) 📝 `frontend/appflowy_flutter/packages/flowy_infra/lib/colorscheme/colorscheme.dart` (+35 -0) 📝 `frontend/appflowy_flutter/packages/flowy_infra/lib/plugins/bloc/dynamic_plugin_bloc.dart` (+28 -14) 📝 `frontend/appflowy_flutter/packages/flowy_infra/lib/plugins/service/models/flowy_dynamic_plugin.dart` (+9 -4) ➕ `frontend/appflowy_flutter/test/unit_test/settings/theme_missing_keys_test.dart` (+32 -0) </details> ### 📄 Description If there are missing keys in the light or dark theme file, we simply replace them with default values. This is not a good way of handling errors, but it's better than failing indiscriminately without any proper feedback. I've added a `getMissingKeys` to compare and see which values are missing, and written some quick unit tests for it. We should find a way to use it so we can let users know if their theme has missing values. Relates: #5359 #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [x] I've listed at least one issue that this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [x] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:17:15 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#6916
No description provided.