Add compact agent filter beside channel list titles with selected name
display, fix embed localStorage agentId read on rebind, add IM agent
rebind tests, and deep-link agent editor counts to the matching tab.
- Introduce mechanisms to mark assistant messages as completed and handle in-flight messages during user queries.
- Implement functions to prepare for new outgoing messages and manage the stopping of assistant messages.
- Update chat stream handling to ensure proper message state management and prevent reuse of incomplete messages.
- Integrate new functionalities into existing composables for improved chat experience.
- Implement logic to accurately detect user scroll direction, preventing false positives during content loading.
- Update scroll handling in both `useEmbedChatSession` and chat view to maintain auto-follow functionality during streaming.
- Introduce a mechanism to differentiate between actual upward scrolls and content growth, enhancing chat usability.
- Introduce a stable skeleton box for protected images during loading to prevent flickering.
- Implement a new composable `useStickyBottomOnResize` to maintain chat scroll position as content loads.
- Add `useTypewriter` for smoother text rendering in chat, improving user experience during streaming.
- Create a directive `vStableHtml` to efficiently update HTML content without losing image states.
- Enhance chat markdown rendering to handle incomplete citation tags and trailing horizontal rules during streaming.
- Add tests for new typewriter functionality and citation handling.
- Updated components to utilize the new `useChatResourcesStore` for managing knowledge bases and agents, improving data fetching and caching mechanisms.
- Refactored `AgentSelector`, `IMChannelPanel`, `Input-field`, and `menu` components to replace direct API calls with store methods, enhancing maintainability and performance.
- Adjusted knowledge base loading logic to ensure consistency across components and reduce redundant API requests.
- Improved session state handling in `settings` store to prevent overwriting user selections during state restoration.
- Introduced new components: AgentCreateContextualGuide, KbCreateContextualGuide, TenantModelsGuide, and SpotlightGuide to enhance user onboarding.
- Implemented dynamic step configurations for each guide, allowing tailored user experiences based on context.
- Enhanced the existing NewUserGuide component to utilize the new SpotlightGuide for improved visual guidance.
- Updated localization files to include new strings for contextual guides, ensuring a comprehensive user experience across languages.
- Refactored existing components to integrate with the new guide system, improving maintainability and user interaction.
Introduced a new API client for managing user favorites, allowing users to list, add, and remove starred resources. Enhanced the sidebar to display favorites and recents, improving user navigation. Updated internationalization files to include relevant labels and tooltips for the new features across multiple languages.
Refs: #1303
Polish the role-aware UI surfaces wired up in #1303 so role / tenant
context is discoverable from the main shell rather than buried in a
hover-only switcher or the settings drawer.
UserMenu sidebar trigger:
- Replace username + email with `tenant name / username · role-icon
role-name` so the active tenant + current role are always visible at
the bottom of the sidebar; long usernames elide before the role label.
- Single-tenant users keep the old username + email layout.
UserMenu dropdown:
- Promote the tenant switcher to a clickable header row at the top of
the dropdown (tenant name + swap icon, role caption underneath).
- Drop the standalone "Switch tenant" submenu entry — the header row
hosts the same hover panel.
- Switcher panel rows now lead the role label with a role icon
(owner / admin / contributor / viewer) and surface the home tenant
via a small home dot on the avatar instead of a separate badge, so
the right-edge "current" badge column lines up across rows.
Settings:
- Add SECTION_MIN_ROLE so settings nav entries are gated by the same
role matrix the backend enforces (chathistory + ollama + websearch +
vectorstore + parser + storage + mcp → admin; api → owner; rest →
viewer). UserMenu quickNav uses the same map.
- Render a role-denied empty state when a user deep-links into a
section their role can't reach.
- Split account info (id / username / email / created_at) out of the
owner-only API Info page into a new viewer-accessible UserProfile
section.
Composable:
- New useRoleLabel composable centralises role → label and role → icon
mapping (consumed by UserMenu trigger / dropdown / switcher panel).
- useHomeTenant derives the home tenant id from `user.tenant_id` (the
immutable signup-time field), not `tenant.id` which now reflects the
active tenant after a switch.
Lists:
- KnowledgeBaseList / AgentList default the sidebar selection to "all"
for viewers (who typically own nothing) so the empty "Mine" state no
longer hides the shared content they actually have access to;
contributor+ keeps "Mine" as the default.
i18n:
- Tenant role labels: 拥有者/贡献者/查看者 → 所有者/编辑/访客 (all four
locales updated, plus new userProfile / roleDenied / homeBadge keys).
The org-vs-tenant scope question raised during review is intentionally
out of scope here — that needs an RFC before any UI/backend changes.
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
QA review of the previous hardening commit identified two cross-user
infection paths created by the smart-fallback read chain (CRIT-1/2),
plus a UI-desync hazard from validation guards in setters (HIGH-1).
- Extracted localStorage helpers and migration logic into
composables/preferenceStorage.ts as a single source of truth.
- Reads now hit only the active user's namespace - no anon / legacy
fallback in the hot path. Pre-existing values are migrated **once**
per active user via migratePreferencesIntoUser, which adopts anon
and legacy keys into the user namespace and then deletes the source
keys, so a second user logging into the same browser cannot inherit
the previous user's preferences.
- Migration latch tracks which user has already been migrated this
session; auth store's reloadUserPreferences resets the latch on
setUser/logout so the next active user gets a fresh migration.
- setSansFont / setMonoFont / setFontSize / setTheme now return a
boolean; GeneralSettings.vue handlers roll the form back to the
canonical state when validation rejects a value, preventing the
UI from drifting out of sync with the source of truth.
- safeSetItem now console.warn on persistence failures so quota /
private-mode issues are at least diagnosable.
- applyFont is diff-aware: only the CSS variables that actually
changed are written to the root style, avoiding unnecessary style
recalculation when only one knob is flipped.
- applyTheme caches the last effective mode to skip redundant
attribute writes and Wails IPC calls.
https://claude.ai/code/session_01S1FVPf4jRfWXkTSnpMmMp7
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
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
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
- 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.