Skip to content

Add project dashboard with entry progress tracking#2397

Merged
hahn-kev merged 5 commits into
developfrom
project-dashboard
Jul 3, 2026
Merged

Add project dashboard with entry progress tracking#2397
hahn-kev merged 5 commits into
developfrom
project-dashboard

Conversation

@hahn-kev

@hahn-kev hahn-kev commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a dev-only project dashboard at /dashboard showing dictionary progress toward a 10,000 entry goal
  • Track total entries, entries with senses, entries with example sentences, and per-writing-system field completion using filtered countEntries API calls
  • Introduce a compact CircularProgress component for inline completion indicators beside count labels

Screenshot

image

Test plan

  • Enable dev mode in FieldWorks Lite viewer
  • Navigate to /project/{code}/dashboard via the sidebar Dashboard button
  • Verify total entry count and 10k goal progress display correctly
  • Verify summary cards for senses and example sentences update after editing entries
  • Verify per-writing-system rows show aligned counts and circular progress rings
  • Run pnpm run check in frontend/viewer

Wire the dev-only dashboard route and show dictionary progress toward 10k entries, including per-writing-system field completion with compact circular progress indicators.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e1eb8ab5-3b3b-4a8c-b18a-f6ffd8e7e196

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a new Project Dashboard feature: a /dashboard route rendering statistics on entries, senses, examples, and per-writing-system field completion, backed by a new stats-fetching hook. It introduces a circular-progress UI component, a shared community-links module used by the feedback dialog, and corresponding translated strings across nine locale files.

Changes

Dashboard feature

Layer / File(s) Summary
Dashboard stats contract and data fetching
frontend/viewer/src/project/dashboard/dashboard-stats.ts
Defines FieldCompletion, MilestoneProgress, DashboardStats types and MILESTONES; implements fetchDashboardStats querying entry/writing-system counts and useDashboardStats() caching results with debounced refetch on project events.
Circular progress UI component
frontend/viewer/src/lib/components/ui/circular-progress/circular-progress.svelte, .../index.ts
Adds an SVG-based circular progress component with props for value/max/size/strokeWidth/classes, exported as Root/CircularProgress.
Dashboard view and routing
frontend/viewer/src/project/dashboard/DashboardView.svelte, frontend/viewer/src/ShadcnProjectView.svelte
Renders milestone/summary cards, vernacular/analysis writing-system field completion rows, empty states, and a loading fallback; wires a new /dashboard route.
Community links and feedback dialog
frontend/viewer/src/lib/about/community-links.ts, frontend/viewer/src/lib/about/FeedbackDialog.svelte
Adds featureRequestsUrl, supportForumUrl, dashboardSuggestionUrl constants and updates FeedbackDialog buttons to use them instead of hardcoded URLs.
Localization additions
frontend/viewer/src/locales/{en,es,fr,id,ko,ms,sw,vi}.po
Adds new dashboard-related msgid strings and extends source references for shared fields (Citation form, Definition, Gloss, Lexeme form) to the Dashboard view.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: rmunn

Poem

A dashboard bloomed, so bright and new,
With rings that spin as progress grew,
Milestones counted, one by one,
"Add your first entry!" — and it's done! 🐇
Links now shared, no copy-paste,
Nine tongues await their translated place.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a project dashboard with entry progress tracking.
Description check ✅ Passed The description matches the changeset and covers the dashboard, progress tracking, circular progress, and test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch project-dashboard

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Jul 1, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@argos-ci

argos-ci Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 4 changed Jul 3, 2026, 9:16 AM

@myieye

myieye commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

I also wanted to have some fun 😉

So, I made a few adjustments and an addition at the end.

I tried to change the first card, so it doesn't have a generic, overwhelming 10,000 goal. AI whipped up some milestones.
And I removed what used to be the total entries card and tried to make the first card fill that role.

image image image

@hahn-kev

hahn-kev commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

@myieye you didn't push your changes...

- Replace fixed 10,000-entry goal with a next-milestone progress hero; drop
  the redundant Total entries card (the count is now the hero number)
- Add a "What would you like to see here?" feedback card that deep-links to a
  prefilled forum suggestion; share the community URLs via community-links.ts
- Encouraging, non-servile, translation-friendly copy; scrollbar padding fix

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
frontend/viewer/src/project/dashboard/DashboardView.svelte (1)

105-134: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated percent-calculation logic instead of reusing shared completion() helper.

Lines 113-116 and 127-130 reimplement the same total === 0 ? 0 : Math.round((filled / total) * 100) formula already defined as completion() in dashboard-stats.ts. Exporting completion (or better, having DashboardStats.entriesWithSenses/entriesWithExamples be FieldCompletion objects computed once in fetchDashboardStats) would remove this duplication and prevent the two implementations from silently diverging.

♻️ Suggested change
-export type DashboardStats = {
-  totalEntries: number;
-  entriesWithSenses: number;
-  entriesWithExamples: number;
+export type DashboardStats = {
+  totalEntries: number;
+  entriesWithSenses: FieldCompletion;
+  entriesWithExamples: FieldCompletion;
   milestone: MilestoneProgress | undefined;
   vernacular: VernacularWritingSystemStats[];
   analysis: AnalysisWritingSystemStats[];
 };

Then in DashboardView.svelte, use dashboard.entriesWithSenses.filled/.percent directly via formatCompletion(dashboard.entriesWithSenses, dashboard.totalEntries).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/viewer/src/project/dashboard/DashboardView.svelte` around lines 105
- 134, The percent calculation is duplicated in DashboardView instead of reusing
the shared completion helper from dashboard-stats. Update DashboardStats or
fetchDashboardStats so entriesWithSenses and entriesWithExamples are computed
once as FieldCompletion values via completion(), then have DashboardView.svelte
pass those objects directly to formatCompletion rather than recalculating
filled/percent inline. Use the completion symbol and the DashboardStats fields
to locate the affected logic.
frontend/viewer/src/project/dashboard/dashboard-stats.ts (1)

101-120: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Large fan-out of concurrent countEntries calls per writing system.

For N vernacular + M analysis writing systems, this issues 1 + 2 + 3N + 2M concurrent countEntries calls. For dev-only usage with few writing systems this is fine, but could add noticeable load/latency as writing systems or corpus size grow.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/viewer/src/project/dashboard/dashboard-stats.ts` around lines 101 -
120, The fetchDashboardStats routine is creating too many concurrent
countEntries requests by expanding per-writing-system checks inside Promise.all,
which scales to 1 + 2 + 3N + 2M calls. Refactor fetchDashboardStats and its
filledCount usage so the per-writing-system counts are batched or computed in
fewer requests, grouping vernacular and analysis lookups instead of firing one
request per field per writing system. Keep the same DashboardStats output while
reducing the fan-out in this function.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/viewer/src/project/dashboard/dashboard-stats.ts`:
- Around line 72-99: The vernacular and analysis stat mappers are relying on
fragile positional ordering from `fetchDashboardStats`, so a change in
`filledCount` call order can silently assign counts to the wrong fields.
Refactor `mapVernacularStats` and `mapAnalysisStats` to consume named values
instead of `index++` over a flat array, and update `fetchDashboardStats` to
return per-field objects (for example, one object per writing system) that the
mappers can destructure by property name.

---

Nitpick comments:
In `@frontend/viewer/src/project/dashboard/dashboard-stats.ts`:
- Around line 101-120: The fetchDashboardStats routine is creating too many
concurrent countEntries requests by expanding per-writing-system checks inside
Promise.all, which scales to 1 + 2 + 3N + 2M calls. Refactor fetchDashboardStats
and its filledCount usage so the per-writing-system counts are batched or
computed in fewer requests, grouping vernacular and analysis lookups instead of
firing one request per field per writing system. Keep the same DashboardStats
output while reducing the fan-out in this function.

In `@frontend/viewer/src/project/dashboard/DashboardView.svelte`:
- Around line 105-134: The percent calculation is duplicated in DashboardView
instead of reusing the shared completion helper from dashboard-stats. Update
DashboardStats or fetchDashboardStats so entriesWithSenses and
entriesWithExamples are computed once as FieldCompletion values via
completion(), then have DashboardView.svelte pass those objects directly to
formatCompletion rather than recalculating filled/percent inline. Use the
completion symbol and the DashboardStats fields to locate the affected logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: aa14056d-125d-419e-9d11-15f9b7c63f20

📥 Commits

Reviewing files that changed from the base of the PR and between 208b520 and d374756.

📒 Files selected for processing (15)
  • frontend/viewer/src/ShadcnProjectView.svelte
  • frontend/viewer/src/lib/about/FeedbackDialog.svelte
  • frontend/viewer/src/lib/about/community-links.ts
  • frontend/viewer/src/lib/components/ui/circular-progress/circular-progress.svelte
  • frontend/viewer/src/lib/components/ui/circular-progress/index.ts
  • frontend/viewer/src/locales/en.po
  • frontend/viewer/src/locales/es.po
  • frontend/viewer/src/locales/fr.po
  • frontend/viewer/src/locales/id.po
  • frontend/viewer/src/locales/ko.po
  • frontend/viewer/src/locales/ms.po
  • frontend/viewer/src/locales/sw.po
  • frontend/viewer/src/locales/vi.po
  • frontend/viewer/src/project/dashboard/DashboardView.svelte
  • frontend/viewer/src/project/dashboard/dashboard-stats.ts

Comment thread frontend/viewer/src/project/dashboard/dashboard-stats.ts
hahn-kev and others added 2 commits July 3, 2026 16:03
Use named per-field counts instead of positional arrays, and compute senses/examples as FieldCompletion in one place.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove the dev-mode gate so the Dashboard nav item is visible without enabling developer mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hahn-kev hahn-kev merged commit cbfb68d into develop Jul 3, 2026
28 checks passed
@hahn-kev hahn-kev deleted the project-dashboard branch July 3, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants