Skip to content

Feature/add more themes scheme#4

Open
KanoCifer wants to merge 5 commits into
HarryHello:mainfrom
KanoCifer:feature/add-more-themes
Open

Feature/add more themes scheme#4
KanoCifer wants to merge 5 commits into
HarryHello:mainfrom
KanoCifer:feature/add-more-themes

Conversation

@KanoCifer

Copy link
Copy Markdown
Contributor

Change

  • 增加六套主题和Auto模式

Preview

截屏2026-05-14 13 09 37

KanoCifer added 4 commits May 8, 2026 19:18
- Redesign all components to Material Design 3 spec
- Add collapsible MissionCard with chevron toggle and smooth animation
- Replace purple MD3 palette with Google Blue color system
- Update cards, buttons, inputs, modals, and drawer to MD3 surface containers
- Increase nav height to 64px and adjust layout spacing
- Center search form and quick links in DashboardHeader
Replace 2-theme system with 6 schemes (google-blue, forest-green,
paper, sage, mist, blush) × light/dark/auto via data-color-scheme
attribute. Migrate hardcoded colors in 8 components to CSS vars.
Add config v2 export/import with v1 backward compatibility.
Copilot AI review requested due to automatic review settings May 14, 2026 05:10

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR introduces a multi-scheme theming system (6 color schemes × light/dark/auto modes) replacing the previous simple light/dark theme toggle. It refactors the theme store, adds Material Design 3 color tokens, and extends the config import/export format to v2 while maintaining backwards compatibility with v1.

Changes:

  • Reworked theme store to support colorScheme + colorMode (with auto/system listener) and added 6 CSS theme files plus MD3 surface tokens.
  • Introduced configV2 schema for config import/export with backwards-compatible v1 import handling.
  • Updated UI components extensively to use new MD3 tokens, added collapsible mission cards, accessibility attributes to the popup, and an isExcludedTabUrl helper for tab filtering.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/stores/theme.ts Rewrote store for color scheme/mode separation with system-preference listener.
src/types/config.ts Added configV2 interface.
src/utils/configs.ts Export v2 configs; import supports v1 and v2.
src/stores/tabs.ts Added isExcludedTabUrl helper; updated tab event handlers.
src/components/settings/SettingsPanel.vue New color scheme grid + light/dark/auto mode toggle UI.
src/components/tabs/MissionCard.vue Added collapse/expand interaction for tab groups.
src/components/dashboard/DashboardHeader.vue Centered search/quick-links layout; disposition: NEW_TAB for search.
src/components/popup/PopupApp.vue Added ARIA attributes; loads settings; uses theme vars.
src/assets/themes/*.css Added 6 theme CSS files + index aggregator.
src/assets/variables.scss Removed hardcoded theme vars; added MD3 radius scale.
Various style files Migrated to MD3 / theme tokens.
src/App.vue Awaited nextTick().
package.json Minor dependency bumps.
Comments suppressed due to low confidence (5)

src/stores/theme.ts:1

  • When importing a v1 config via themeStore.setTheme(v1.theme.themeId), the v1 themeId was 'light' | 'dark' representing the theme mode. This function silently does nothing for any other value. More importantly, since v1 only had light/dark, this works, but the comment says "兼容旧版 localStorage 单 key 'theme'" which is misleading — this function is also called from the v1 config import path. Consider renaming the function or adding handling for unexpected values (e.g., log a warning), and updating the comment to reflect both usages.
    src/stores/theme.ts:1
  • Indentation is inconsistent here — the comment has a leading space before // while surrounding function declarations use two-space indentation. Align with the surrounding code style.
    src/utils/configs.ts:1
  • When importing a v1 config, the user's currently selected colorScheme is preserved (only the mode is set via setTheme). The comment says "默认配色为 google-blue" but the code does not actually reset the color scheme to google-blue. Either explicitly call themeStore.setColorScheme('google-blue') to match the comment, or update the comment to reflect that the current color scheme is retained.
    src/utils/configs.ts:1
  • JSON.parse is followed only by a configVersion check. The rest of the import code accesses many fields (e.g., raw.deferred.map, raw.todos.map, raw.quickLinks) without runtime validation of their types/shapes. A malformed config file could cause runtime errors mid-import, potentially leaving the store in a partially-mutated state. Consider validating each section's shape before mutating stores, or wrap individual imports in try/catch so one bad section doesn't corrupt others.
    src/stores/theme.ts:1
  • Using non-null assertion mediaQuery! inside the handler is unsafe if stopSystemListener() is called before the handler fires (though unlikely due to removeEventListener being called first). Capture mediaQuery in a local variable inside startSystemListener to avoid the assertion and make ownership clearer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/stores/tabs.ts
Comment on lines +148 to +164
if (isExcludedTabUrl(tab.url || '')) {
tabs.value = tabs.value.filter(t => t.id !== tabId)
return
}
const index = tabs.value.findIndex(t => t.id === tabId)
if (index === -1) return

if (index === -1) {
tabs.value.push({
id: tabId,
url: tab.url || '',
title: tab.title || 'Untitled',
windowId: tab.windowId,
active: tab.active || false,
favIconUrl: tab.favIconUrl || '',
isTabOut: false,
})
return
}
Comment on lines +24 to +29
function applyHeight() {
nextTick(() => {
if (!contentEl.value) return;
contentHeight.value = collapsed.value ? '0px' : `${contentEl.value.scrollHeight}px`;
});
}
themeStore.setColorScheme(scheme);
}

import type { ColorMode } from '@/stores/theme';
import { MoonIcon, SunIcon } from '@/components/icons';
import { useSettingsStore } from '@/stores/settings';
import { type ThemeId, useThemeStore } from '@/stores/theme';
import { useThemeStore, type ColorScheme, COLOR_SCHEMES } from '@/stores/theme';
Comment thread src/assets/variables.scss
Comment on lines +31 to +32
// 动态计算 active-bg(基于当前强调色)
--theme-c-active-bg: color-mix(in srgb, var(--theme-c-accent) 8%, transparent);
Comment thread src/stores/tabs.ts
Comment on lines +59 to +62
const newTabUrl = chrome.runtime.getURL('index.html')

function isExcludedTabUrl(url: string): boolean {
return url === 'chrome://newtab/' || url === '' || url === newTabUrl
Comment on lines 41 to +42
if (typeof chrome !== 'undefined' && chrome.search) {
chrome.search.query({ text: props.searchQuery });
chrome.search.query({ text: props.searchQuery, disposition: 'NEW_TAB' });
…tem listener

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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