feat(b2c): usage-logs ratio cleanup + playground empty state - #5
Merged
Conversation
5.A — Usage Logs B2C transformation: - Hide group/ratio metadata from per-row Token column for non-admin users. Operators get full breakdown (group + Nx); non-admin sees just the token name. Previously "5x" ratio leaked into all users' sub- label rows. - In the per-request Detail dialog, gate the "Group Ratio" / "User Exclusive Ratio" rows by isAdmin. Final cost row stays visible so users still understand what they were charged. - Sidebar nav: "Usage Logs" → "Call history" — friendlier, matches what end users mentally call it. 5.B — Playground empty state: - New PlaygroundEmptyState component with 6 click-to-send suggestion chips (Say hello / Translate / Write code / Brainstorm / etc). Renders when messages.length === 0 instead of the blank chat scroller. Casual persona (which lands here from PR #3's default route) gets a clear "what can I help with" affordance instead of staring at an empty void. - Click → handleSendMessage(prompt). No input pre-fill; matches modern chat-UI conventions (ChatGPT, Claude.ai, Cursor all do this). 15 new en + zh i18n keys. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
7 tasks
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sprint 2 — 给已经走通 funnel 的用户做质量/正确性补救。
5.A Usage Logs B2C 改造
5.B Playground 空状态
PlaygroundEmptyState,messages.length === 0 时显示 6 个"建议提示"卡片Test plan
bun run typecheck通过bunx eslint通过文件
修改:
web/default/src/features/usage-logs/components/columns/common-logs-columns.tsx— useIsAdmin gateweb/default/src/features/usage-logs/components/dialogs/details-dialog.tsx— Group Ratio gateweb/default/src/hooks/use-sidebar-data.ts— labelweb/default/src/features/playground/index.tsx— empty state branchweb/default/src/i18n/locales/{en,zh}.json— 15 keys新增:
web/default/src/features/playground/components/playground-empty-state.tsx🤖 Generated with Claude Code