Commit Graph

10 Commits

Author SHA1 Message Date
wizardchen 6019c4b661 fix(frontend): polish model settings UI and fix disabled brand color
- Fix global `--td-brand-color-disabled` to use correct muted green instead of bright green
- Unify `variant="text"` buttons (refresh, download, check dimension) in model settings to inherit standard TDesign styles
- Adjust WeKnora Cloud credential status layout and change reconfigure button to outline
- Fix font size of external doc links in model settings hint blocks
- Increase font weight of KB chunking debug trigger for better visibility
2026-05-07 21:51:22 +08:00
wizardchen c77cef5a69 feat(frontend): unify external doc-link style and outline add buttons
- Add global .doc-link utility in theme.css (brand color text + link icon, underline on hover).

- Convert all external doc/console links across settings to use .doc-link with a trailing <t-icon name="link" />, matching the Ollama browse-library style.

- Switch primary section-toolbar 'Add X' buttons (Model/WebSearch/VectorStore/MCP/DataSource) to outline variant for a lighter, more consistent look.

- Drop redundant per-component CSS for builtin-hint-link, weknoracloud-hint-link, engine-doc-link, engine-link, hint-link, section-doc-link, ds-doc-link-inline, model-link, etc.
2026-05-07 21:51:22 +08:00
wizardchen cc6ac6ac50 fix(frontend): unify radio button theme and disabled selection
- Add global t-radio-button outline styles in theme.css (brand fill when checked).

- Align ModelEditor, share KB, datasource, agent/MCP settings with t-radio-button.

- Remove redundant :deep overrides in AgentEditorModal, KB editor, FAQEntryManager, etc.

- Use brand disabled tone for disabled+checked radio buttons so selection stays visible.
2026-05-07 21:51:22 +08:00
wizardchen 4a5caf54af fix(frontend): make general-settings font picker actually work
The font picker in 常规设置 silently failed in three distinct ways:

1. Font family changes were invisible on macOS because 6 of the 7 options
   (Inter / Roboto / Segoe UI / Cascadia Code / JetBrains Mono / Fira
   Code) aren't installed by default and fell back to system SF. Swap
   the picker to a platform-aware list — Mac / Windows / Linux each see
   only the fonts their OS actually ships. The "third sans slot" now
   always serves a serif face (Georgia / Times New Roman / DejaVu
   Serif) so the difference is unambiguously visible instead of being
   three near-identical sans families.

2. Font size flipped --app-font-scale on <html>, but that variable was
   only consumed by a handful of TDesign tokens and the body reset, so
   the ~1000+ hard-coded font-size: NNpx rules across the frontend
   stayed put. Apply the multiplier via `zoom` on <html> so the whole
   document scales, then fix the 15 `100vh` rules that would overflow
   under zoom (html / body / #app are already height: 100%, so the
   descendants can use 100% too).

3. The monospace picker had no visible effect even on a working stack
   because `<t-input style="font-family: ...">` is forwarded to the
   inner <input>, but TDesign applies `font: var(--td-font-body-medium)`
   — a shorthand that resets font-family. Reach the real <input> /
   <textarea> via `:deep()` instead of inline style.

Additional polish:
- Add a live preview row under each picker so users can see the effect
  without hunting for a code block or API Info screen
- Rename "等宽字体 / Monospace Font" → "代码字体 / Code Font" to match
  VSCode / GitHub / Notion convention; the old label was jargon
- Rewrite descriptions to explain the actual purpose and scope
2026-05-07 15:07:24 +08:00
Claude 2e0b423057 fix(frontend): harden font/theme preferences for production edge cases
Edge-case review identified several issues that would degrade UX or
silently break under unusual conditions:

- Anon settings chosen on the login screen were lost on first login
  because the storage namespace switched from "anon" to the user id;
  resolveStorageValue now falls through user -> anon -> legacy, so
  pre-login choices carry over and v1 unscoped keys are still picked up.
- localStorage.setItem can throw under quota / private mode; setters now
  swallow the error so the UI still updates for the session.
- applyFont reduced to String(undefined) when currentSize held an
  invalid value; runtime fallbacks to the default scale guard against
  manipulated storage.
- Added var(--app-font-scale, 1) defaults to all 32 calc() expressions
  in theme.css and the body font-size, so a missing variable cannot
  void the calc() value.
- Validation guards in setSansFont / setMonoFont / setFontSize / setTheme
  reject invalid keys instead of writing them to storage.
- GeneralSettings.vue now watches the composable refs so the form stays
  in sync if preferences change externally (e.g. user switch while on
  the page).
- Dropped the unverified t-radio-group variant prop in favour of the
  default style.

https://claude.ai/code/session_01S1FVPf4jRfWXkTSnpMmMp7
2026-05-05 00:48:40 +08:00
Claude bafcbd5e5f feat(frontend): add font size, namespace UI prefs per user
Build on the font picker with three additions per user feedback:

- Font size selector (Small / Normal / Large) wired through a new
  --app-font-scale CSS variable; the body font-size and every
  --td-font-size-* token are wrapped in calc(... * var(--app-font-scale))
  so TDesign components scale together with the body
- localStorage keys for theme, font family, mono font and font size are
  now namespaced as WeKnora_${userId}_${key}; falls back to "anon" before
  login. Each user keeps their own preferences in the same browser
- auth store calls reloadFontFromStorage / reloadThemeFromStorage on
  setUser (when the active user changes) and in logout, so a user switch
  swaps the applied preferences without a reload

https://claude.ai/code/session_01S1FVPf4jRfWXkTSnpMmMp7
2026-05-05 00:48:40 +08:00
Claude f140c12518 feat(frontend): unify font rendering and add font picker in settings
The UI used hardcoded "PingFang SC" in 50+ components, while the global
font stack in App.vue used a different fallback chain. Outside of mainland
China this caused visibly different fonts in the sidebar, breadcrumbs,
search and agent views compared to settings and document panes.

- Introduce --app-font-family / --app-font-family-mono CSS variables in
  theme.css and route TDesign's --td-font-family through them
- Add a useFont composable that persists the user's choice in localStorage
  and applies it via document.documentElement.style before mount
- Replace hardcoded font-family declarations across the app with the new
  variables (TencentSans logo and the SVG attribute list are preserved)
- Add UI font and monospace font selectors in General Settings with
  i18n strings for en-US, zh-CN, ko-KR and ru-RU

https://claude.ai/code/session_01S1FVPf4jRfWXkTSnpMmMp7
2026-05-05 00:48:40 +08:00
wizardchen 5d90019fd0 feat: enhance sidebar functionality and UI responsiveness
- Implemented sidebar collapse and expand functionality, allowing users to toggle the sidebar visibility for a more streamlined interface.
- Updated the `uiStore` to manage sidebar state, persisting the collapsed state in local storage for user preference.
- Enhanced the `menu.vue` and `UserMenu.vue` components to adapt their layout based on the sidebar state, improving usability.
- Added corresponding translations for sidebar actions in English, Korean, Russian, and Chinese, ensuring accessibility for diverse users.
- Refined CSS styles to support the new sidebar behavior, enhancing overall UI consistency and responsiveness.

These changes significantly improve the user experience by providing a more flexible and user-friendly navigation system.
2026-03-05 18:14:14 +08:00
wizardchen dbc7c32874 feat: update theme and UI styles across components
- Refactored CSS variables for consistent theming, replacing hardcoded colors with CSS variables for better maintainability.
- Updated various components including `AgentAvatar`, `AgentSelector`, and `AgentShareSettings` to utilize new theme variables for colors, backgrounds, and shadows.
- Enhanced SVG icons to use `currentColor` for better adaptability to theme changes.
- Improved overall UI consistency by aligning styles with the new theming approach, enhancing user experience across the application.

These changes significantly improve the visual coherence and maintainability of the UI, ensuring a more seamless user experience.
2026-03-05 18:14:14 +08:00
wizardchen 56eb2bce33 init commit 2025-08-05 15:08:07 +08:00