Skip to content

feat(web): include appearance in data bundles#75

Merged
qqqqqf-q merged 2 commits into
mainfrom
split/pr63-theme-export-gtd
May 19, 2026
Merged

feat(web): include appearance in data bundles#75
qqqqqf-q merged 2 commits into
mainfrom
split/pr63-theme-export-gtd

Conversation

@kilockok

@kilockok kilockok commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Split from #63.

内容:

  • 桌面端“导出数据 / 导入数据”的 themes section 额外携带 themePreset、backgroundImage、backgroundImageOpacity
  • 数据导入时恢复这些外观字段
  • 数据导出/导入同步 sidebarGrouping
  • 集中 GTD enabled storage 订阅逻辑,Sidebar 与 AppearanceSettings 复用同一入口

说明:

  • 这不是独立的“主题导入/导出”入口;入口仍然是高级设置里的数据导入/导出。

验证:

  • pnpm test -- src/tests/appearanceStorage.test.ts src/tests/advancedSettings.test.tsx
  • pnpm type-check 受 main 既有 modelPicker.test.tsx is_default 类型错误阻塞

@kilockok kilockok changed the title feat(web): export theme appearance feat(web): include appearance in data bundles May 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86501003a2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/apps/web/src/storage.ts Outdated
Comment on lines +2504 to +2506
localStorage.setItem(GTD_ENABLED_STORAGE_KEY, String(v))
if (typeof window !== 'undefined') {
window.dispatchEvent(new CustomEvent(GTD_ENABLED_CHANGED_EVENT, { detail: v }))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Emit GTD change event even when storage write fails

When localStorage.setItem throws (e.g., quota exceeded or storage temporarily unavailable), writeGtdEnabled now swallows the error and skips dispatching arkloop:gtd-enabled-changed. In that case, components relying on subscribeGtdEnabled (like Sidebar) do not observe the toggle even though the settings UI already updated its local state, so grouping becomes inconsistent within the same tab. Previously this path still broadcasted the change from the click handler.

Useful? React with 👍 / 👎.

@qqqqqf-q qqqqqf-q left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. normalizeThemeBackgroundImage 校验逻辑严谨,导入原子性正确(校验失败不写入部分状态)。subscribeGtdEnabled 集中化是合理改进。

@qqqqqf-q qqqqqf-q merged commit 28da80f into main May 19, 2026
10 of 13 checks passed
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.

2 participants