refactor: rework review queue with internal sidebar workspace#173
Closed
YumemiDream wants to merge 2 commits into
Closed
refactor: rework review queue with internal sidebar workspace#173YumemiDream wants to merge 2 commits into
YumemiDream wants to merge 2 commits into
Conversation
- Add a dedicated review workspace layout with sticky sidebar containing 6 category buttons: persona / style / jargon / persona-state / reviewed / batches - Each button shows live count badges; counts update whenever persona, style, jargon, persona-state, backup or batch data is loaded - Add setReviewTab(tab) / updateReviewNavCounts(counts) helpers and bind button clicks + page-revisit restore (state.reviews.tab) - Add new integration test test_dashboard_review_queue_uses_sidebar_categories to lock in the new structure
Contributor
Reviewer's GuideRefactors the review queue section of dashboard.html into a sidebar-driven, tabbed workspace with category badges and counts, adds JS state and helpers to manage tabs and sidebar metrics, tweaks jargon stats/labels, and introduces an integration test to assert the new sidebar structure is present. Sequence diagram for review queue sidebar tab switchingsequenceDiagram
actor User
participant DashboardPage
participant setReviewTab
User->>DashboardPage: click [data-review-tab]
DashboardPage->>setReviewTab: setReviewTab(dataset.reviewTab)
activate setReviewTab
setReviewTab->>setReviewTab: update state.reviews.tab
setReviewTab->>setReviewTab: toggle .active on [data-review-tab]
setReviewTab->>setReviewTab: set aria-selected on [data-review-tab]
setReviewTab->>setReviewTab: toggle .active on [data-review-panel]
setReviewTab->>setReviewTab: set hidden on [data-review-panel]
deactivate setReviewTab
Sequence diagram for insights jumping into a specific review tabsequenceDiagram
actor User
participant DashboardPage
participant getInsightTargetId
participant getInsightTargetPage
participant getReviewTabForInsightTarget
participant navigateToPage
participant setReviewTab
User->>DashboardPage: click insight item
DashboardPage->>getInsightTargetId: getInsightTargetId(target)
getInsightTargetId-->>DashboardPage: targetId
DashboardPage->>getInsightTargetPage: getInsightTargetPage(target)
getInsightTargetPage-->>DashboardPage: pageId
DashboardPage->>navigateToPage: navigateToPage(pageId, { keepScroll: true })
DashboardPage->>getReviewTabForInsightTarget: getReviewTabForInsightTarget(target)
getReviewTabForInsightTarget-->>DashboardPage: reviewTab
alt [reviewTab]
DashboardPage->>setReviewTab: setReviewTab(reviewTab)
end
Flow diagram for updating review sidebar badge countsflowchart TD
A[state.data] --> B[updateReviewNavCounts]
B --> C[extractJargonStats]
B --> D[safeArray persona.updates]
B --> E[safeNumber style.total]
B --> F[safeNumber persona.total]
B --> G[compute personaBacklog
styleBacklog
pendingJargon
reviewedTotal
backupTotal
batchTotal
pendingTotal]
G --> H[formatCount]
H --> I[setText reviewSidebarSummary]
H --> J[setText reviewNavPersonaCount]
H --> K[setText reviewNavStyleCount]
H --> L[setText reviewNavJargonCount]
H --> M[setText reviewNavPersonaStateCount]
H --> N[setText reviewNavReviewedCount]
H --> O[setText reviewNavBatchCount]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
pendingJargoncomputation logic is duplicated in bothupdateReviewNavCountsand the dashboard render path; consider extracting a small helper (e.g.getPendingJargonCount(jargonStats)) to keep the formula consistent and easier to adjust later. - The review tab buttons currently set
aria-selectedbut are missing explicit tab semantics; addingrole="tablist"/role="tab"(and possibly keyboard handling) would make the new sidebar navigation more accessible to assistive technologies.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `pendingJargon` computation logic is duplicated in both `updateReviewNavCounts` and the dashboard render path; consider extracting a small helper (e.g. `getPendingJargonCount(jargonStats)`) to keep the formula consistent and easier to adjust later.
- The review tab buttons currently set `aria-selected` but are missing explicit tab semantics; adding `role="tablist"`/`role="tab"` (and possibly keyboard handling) would make the new sidebar navigation more accessible to assistive technologies.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
背景
原版审查队列页(
#page-reviews)是一个 2 列网格布局,所有面板平铺在一起,随着面板增多页面越来越长,用户需要不断滚动才能在"概览"和"待办操作"之间切换。
改动
将审查队列重构为"左侧固定侧边栏 + 右侧内容区"布局,按功能分为 6 个分类。
6 个分类
personastylejargonpersona-statereviewedbatches视觉
position: sticky侧边栏交互
setReviewTab(tab)切换函数updateReviewNavCounts(counts)角标更新state.reviews.tab持久化aria-selected无障碍属性后端
无任何后端改动。所有改动均在
web_res/static/html/dashboard.html一个文件内完成。配套测试
tests/integration/test_webui_static_assets.py新增test_dashboard_review_queue_uses_sidebar_categories,断言关键字符串必须存在,防止未来误删侧边栏结构。
风险评估
测试