Skip to content

Feature/20260714 product design upgrade 1 - #49

Merged
donfaquir merged 16 commits into
mainfrom
feature/20260714-product-design-upgrade-1
Jul 15, 2026
Merged

Feature/20260714 product design upgrade 1#49
donfaquir merged 16 commits into
mainfrom
feature/20260714-product-design-upgrade-1

Conversation

@donfaquir

Copy link
Copy Markdown
Owner

摘要

变更类型

  • 缺陷修复
  • 新功能或行为变更
  • 文档或元数据(LICENSE、CI 等)
  • 重构或性能(无行为变化)
  • 其他:

检查清单

  • 本地已运行 npm run build(若改动前端)
  • 本地已运行 cd src-tauri && cargo test(若改动 Rust)
  • 不包含无权再许可的第三方素材或机密信息
  • 已阅读并遵守 CONTRIBUTING.mdCODE_OF_CONDUCT.md

备注

donfaquir and others added 16 commits July 14, 2026 16:55
…ks from App.tsx

Reduce App.tsx from 1788 to 1034 lines (-42%) by extracting:

- ContentArea: view routing (graph/thoughts/files) + right panel
- EditorView: editor rendering (doc bar, markdown editor, find bar)
- AppTopToolbar: top toolbar (tab bar, save button, window controls)
- useGlobalShortcuts: Cmd+L/Cmd+Shift+P/Cmd+Shift+W/Cmd+F
- useWindowLifecycle: beforeunload + Tauri onCloseRequested flush
- useHeadingNavigation: ProseMirror heading scroll with retry

This prepares a clean insertion point in ContentArea for the upcoming
Practice Mode (leftPanelView === "practice") without touching App.tsx.

No behavioral changes — pure structural extraction.
- Add "practice" to LeftPanelView type
- Add brain icon + due-count badge to ActivityBar
- Add practice branch in ContentArea (full-view takeover)
- Create PracticeMode shell with review/discovery sub-tab switching
- Pass reviewDueCount from App to ActivityBar for badge display
- Add i18n keys for practice label (en/zh)

Implements spec 01-practice-mode-routing.
Create PracticeReviewPane based on ChallengeReviewPanel with:
- All candidate/sourceType branches removed (thoughts only)
- Front-end filter: items.filter(i => i.sourceType === 'thought')
- Simplified stats line: 'Today N/cap · M thoughts due'
- Keyboard flow: Enter to submit, Tab/Arrow to next
- onFocusThought callback for future source preview integration
- onReviewCompleted callback for completion transition

Integrate into PracticeMode shell with review completed state.

Implements spec 02-practice-review-pane.
- Create PracticeSourcePreview: read-only markdown rendering with
  paragraph highlight using react-markdown + remark-gfm
- Split PracticeMode body into left (review/discovery) and right
  (source preview) panes using CSS grid
- Source preview loads file via existing read_markdown_file command
- Highlights thought paragraph (startLine..endLine) with yellow accent
- Auto-scrolls to highlighted section on thought focus change
- Empty/loading/error states handled

Implements spec 03-practice-source-preview.
…ates commands

- Add DiscoveryFilter, DiscoveryListResponse, DiscoveryReasonCounts types
- Implement list_candidates_filtered with:
  - marking_reason filter
  - sort_by (similarity/age/freshness via file mtime)
  - offset/limit pagination
  - count_by_reason for filter tab badges
- Implement batch_dismiss for multi-select dismiss operations
- Register both commands in Tauri handler list
- sort_by_freshness uses fs::metadata mtime (Phase 1 approach)

All 453 existing tests pass.

Implements spec 04-backend-discovery-list.
Co-authored-by: OpenCode <noreply@opencode.ai>
Review functionality now lives exclusively in Practice Mode.
Keyboard shortcut (Cmd+Shift+Y) and onboarding both navigate to Practice.

Co-authored-by: OpenCode <noreply@opencode.ai>
- New InlineReviewReminder shows a one-line prompt to visit Practice Mode
- No LLM call needed: fetches review queue and picks first due thought
- Daily cap raised from 2 to 3 (low-cost reminder can show more often)
- App listens for 'knowforge:goToPractice' event to navigate
- Removed ChallengeReviewInline component and CSS

Co-authored-by: OpenCode <noreply@opencode.ai>
- DiscoveryDetailView routes to type-specific sub-components
- DiscoverySimilarityCompare: side-by-side excerpt comparison
- DiscoveryClusterView: cross-doc recurrence with cluster info
- DiscoveryIsolatedContext: source context with highlighted paragraph
- Right column in discovery mode now shows detail view (not raw preview)
- Promote/dismiss from detail view refreshes the left pane list
- 'View in source' navigates back to editor mode

Co-authored-by: OpenCode <noreply@opencode.ai>
…omote)

Backend:
- New batch_promote function with per-file reverse-line-order processing
- New batch_promote_candidates Tauri command (limit: 50)

Frontend:
- Multi-select mode with checkboxes on candidate cards
- Batch operations bar: select all, batch dismiss, batch promote, clear
- Individual card actions hidden during multi-select mode
- refreshKey prop for external refetch trigger

Co-authored-by: OpenCode <noreply@opencode.ai>
Backend:
- New list_daily_picks function with day-of-year rotation across reason types
- New list_discovery_daily_picks Tauri command

Frontend:
- PracticeReviewCompletion component with daily picks teaser
- 'Back to notes' exits Practice Mode, 'Explore discoveries' switches tab
- App.tsx listens for 'knowforge:goToFiles' navigation event

Co-authored-by: OpenCode <noreply@opencode.ai>
…wReminder

Adds 42 translation keys covering:
- practice.* (tabs, stats, source preview, completion screen)
- discovery.* (filters, cards, batch ops, detail views)
- reviewReminder.* (inline post-conversation prompt)

Previously these relied solely on inline fallback strings.

Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
@donfaquir
donfaquir merged commit 642eb41 into main Jul 15, 2026
2 checks passed
@donfaquir
donfaquir deleted the feature/20260714-product-design-upgrade-1 branch July 15, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant