Repository navigation
feat: added "流畅阅读" (FluentRead) as a new chat provider option. - #1541
Conversation
WalkthroughA new chat provider entry "流畅阅读" ("fluentread") was added to the global chat list. The frontend sidebar now filters out chat entries whose links start with "fluent", preventing their display. The token notification UI was updated to reference "FluentRead(流畅阅读)", adjust button logic, and refine suppression and model selection behaviors. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Sidebar
participant LocalStorage
User->>Sidebar: Load sidebar
Sidebar->>LocalStorage: Get chats array
loop For each chat in chats
Sidebar->>Sidebar: Check if link starts with "fluent"
alt Link starts with "fluent"
Sidebar->>Sidebar: Skip chat
else Link does not start with "fluent"
Sidebar->>Sidebar: Add chat to sidebar
end
end
sequenceDiagram
participant User
participant TokensPage
participant LocalStorage
User->>TokensPage: Trigger openFluentNotification
TokensPage->>TokensPage: Check if modelOptions is empty
alt modelOptions is empty
TokensPage->>TokensPage: Call loadModels()
end
TokensPage->>LocalStorage: Check SUPPRESS_KEY
alt Key is provided
TokensPage->>TokensPage: Show "请选择模型。" message
TokensPage->>TokensPage: Hide "Do not remind again" button
else
TokensPage->>TokensPage: Show original message
TokensPage->>TokensPage: Show "Do not remind again" button
end
User->>TokensPage: Click "一键填充到 FluentRead" or "Do not remind again"
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
setting/chat.go (2)
15-17: Align display name with UI copy for consistency.Frontend uses “FluentRead(流畅阅读)”. Consider matching it here to keep UX consistent across surfaces.
- { - "流畅阅读": "fluentread", - }, + { + "FluentRead(流畅阅读)": "fluentread", + },
8-30: Consider replacing []map[string]string with a typed struct for maintainability.Using a slice of single-entry maps is error-prone (unordered keys, harder to validate). A struct clarifies intent and enables validation.
Example:
type ChatProvider struct { Name string `json:"name"` URL string `json:"url"` } var Chats = []ChatProvider{ {Name: "Cherry Studio", URL: "cherrystudio://providers/api-keys?v=1&data={cherryConfig}"}, {Name: "FluentRead(流畅阅读)", URL: "fluentread"}, // ... }web/src/components/table/tokens/index.jsx (2)
91-95: Gate model preloading to avoid unnecessary network calls when suppressed or container missing.Currently, models are preloaded before suppression and container checks, causing background API calls even when the notice won’t show. Optional optimization: check suppression and container first, then preload.
const SUPPRESS_KEY = 'fluent_notify_suppressed'; - if (modelOptions.length === 0) { - // fire-and-forget; a later effect will refresh the notice content - loadModels() - } - if (!key && localStorage.getItem(SUPPRESS_KEY) === '1') return; + if (!key && localStorage.getItem(SUPPRESS_KEY) === '1') return; const container = document.getElementById('fluent-new-api-container'); - if (!container) { - Toast.warning(t('未检测到 FluentRead(流畅阅读),请确认扩展已启用')); - return; - } + if (!container) { + Toast.warning(t('未检测到 FluentRead(流畅阅读),请确认扩展已启用')); + return; + } + if (modelOptions.length === 0) { + // fire-and-forget; a later effect will refresh the notice content + loadModels(); + }
150-198: Unify copy: replace “Fluent” with “FluentRead(流畅阅读)” in handler messages.Two strings still reference the old name.
- Toast.error(t('未检测到 Fluent 容器')); + Toast.error(t('未检测到 FluentRead(流畅阅读)')); @@ - Toast.success(t('已发送到 Fluent')); + Toast.success(t('已发送到 FluentRead(流畅阅读)'));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
setting/chat.go(1 hunks)web/src/components/table/tokens/index.jsx(2 hunks)
🔇 Additional comments (6)
web/src/components/table/tokens/index.jsx (6)
98-99: LGTM: updated container-missing warning copy.Message now matches the new provider name.
105-105: LGTM: updated notification title.Consistent naming with “FluentRead(流畅阅读)”.
109-112: LGTM: simplified conditional content.Clearer guidance when a key is already provided.
127-127: LGTM: primary action label updated.Matches provider naming.
129-137: LGTM: conditionally render “不再提醒” only when no key is provided.Prevents hiding prompts in key-specific flows; correct onClick side effects.
218-224: Confirm duplicate prevention with Semi UI NotificationWe’ve verified that in Semi UI v2.45.0 and later, calling
Notification.openwith the sameidupdates the existing notification rather than stacking a new one ([semi.design/feedback/notification][1]). YouruseEffectwill therefore refresh the open notice as intended—no duplicates will appear.• Ensure your
openFluentNotificationimplementation consistently passes the sameidwhen reopening the notice.Citations:
[1] https://semi.design/zh-CN/feedback/notification?utm_source=openai
feat: added "流畅阅读" (FluentRead) as a new chat provider option.
feat: added "流畅阅读" (FluentRead) as a new chat provider option.
feat: added "流畅阅读" (FluentRead) as a new chat provider option.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes