Skip to content

#31: Build My Work tab#45

Merged
mattrace-gloo merged 7 commits into
mainfrom
feature/31-build-my-work-tab
Jun 8, 2026
Merged

#31: Build My Work tab#45
mattrace-gloo merged 7 commits into
mainfrom
feature/31-build-my-work-tab

Conversation

@mattrace-gloo

@mattrace-gloo mattrace-gloo commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

🔥 TLDR

Implements the My Work tab: assigned chapters from SQLite, workflow badges, recording sync clouds, and offline download progress—styled to match the Lovable mock. Depends on #32 for the shared home shell.

📋 Summary

  • Issue: Mobile app needs a functional My Work tab (GitHub Build My Work Tab #31) listing the translator’s assigned chapters with workflow and sync affordances per the mock.
  • Root Cause: My Work was a placeholder; chapter assignment data was not surfaced in a dedicated query/UI, and verse download progress was not wired through sync.
  • Solution: Added getMyWorkChapters, useMyWorkChapters, row components (MyWorkRow, badges, progress ring, cloud icons), theme/layout tokens, API→SQLite verse counts, and mock-aligned home list styling. Refactored shared sync/display helpers for maintainability.
  • Impact: Translators see Bible-ordered assigned work offline after sync, with clear draft/peer-check/not-started states and download progress on not-started chapters.

Related Issue: #31

Depends on (merge first): #32 — Projects tab, PageHeader/TabBar, theme foundation, and HomeScreen shell from PR stacked on feature/32-build-projects-tab.

Type of Change:

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Maintenance/refactor (no functional changes)

🔧 Technical Changes

Key Files Modified

src/db/queries.ts

  • getMyWorkChapters(userId) — assigned chapters, excludes complete, Bible order, recording sync counts, bible_texts download count for progress ring.

src/hooks/useMyWorkChapters.ts

  • Loads/refreshes chapters; respects refreshKey from header sync (same pattern as Projects).

src/app/tabs/MyWorkTab.tsx

  • FlatList of MyWorkRow; empty/loading states; navigates to VerseDetail.

src/components/ui/MyWorkRow.tsx, ChapterProgressRing.tsx, WorkflowBadge.tsx, RecordingCloudIcon.tsx

  • Mock-aligned row layout: title + cloud (draft/peer check), badge + date or badge + download ring (not started).

src/services/mapChapterAssignment.ts, src/services/sync.ts, src/db/schema.ts

  • Persist total_verses / completed_verses from API; migration for existing DBs.

src/theme/ (tokens.ts, layout.ts, iconSpecs.ts)

  • Card/tab bar colors (#eaeef5), list card layout, icon stroke sizes.

Lines changed: ~1,183 vs feature/32-build-projects-tab | Files modified: 38 (My Work scope)

Dependencies & Configuration

  • No new dependencies
  • New dependencies:
  • No config changes
  • Environment/build config changes:
  • No database changes (schema only)
  • Database/storage changes: chapter_assignments.total_verses, completed_verses columns + init migrations in src/db/index.ts

✅ Testing & Quality Checklist

Testing Completed

  • [x ] ✅ Android device/emulator tested
  • ✅ Unit tests added/updated and passing
  • ✅ Edge cases considered and tested

Code Quality (fluent-mobile gates)

  • npm run lint
  • npm run format:check
  • npx tsc --noEmit
  • FLUENT_USER_EMAIL=test@example.com npm test -- --ci (12 suites, 33 tests)
  • ✅ Self-reviewed the code changes

📸 Screenshots/Recordings

Screenshot_1780522783

🎯 Why This Solution?

  1. Offline-first: UI reads SQLite after sync, consistent with app architecture.
  2. Mock fidelity: Shared theme.layout / listCard tokens keep Projects and My Work visually aligned with Lovable.
  3. Maintainability: RecordingCloudIcon, verseProgress, myWorkRowDisplay, and workflowStage maps avoid duplicated row logic.

📱 Before/After

  • Before: My Work tab empty/placeholder; no chapter list for assigned user.
  • After: Assigned chapters in Bible order with workflow badges, sync clouds, and download progress ring on not-started rows.

⚠️ Breaking Changes

  • No breaking changes
  • Breaking changes documented below:

📊 Performance Impact

Bundle Size:

  • No significant impact (< 1MB)
  • Minor increase (1-5MB)
  • Significant increase (> 5MB) - justified because:

Runtime Performance:

  • No performance impact
  • Performance improvements
  • Potential performance concern - mitigated by:

Battery/Memory:

  • No impact on battery or memory usage
  • Optimizations that improve battery/memory
  • Potential impact - acceptable because:

🧪 How to Test

Prerequisites: Node 24+, npm install, .env from .env.example, fluent-api running locally, Metro + npm run android (or npm run ios on macOS).

Setup: Check out feature/31-build-my-work-tab on top of merged #32 (or base PR branch feature/32-build-projects-tab).

Steps:

  1. Sync app with a user that has chapter assignments and some bible_texts seeded.
  2. Open My Work (default tab).
  3. Confirm chapters appear in Bible order; complete assignments are hidden.
  4. Verify Draft / Peer Check rows: badge + last activity date + green/yellow cloud when recordings exist.
  5. Verify Not Started rows: badge + circular download progress (partial arc when verses exist locally).
  6. Pull to refresh and tap header sync — list updates after refreshKey bump.

Expected: UI matches https://fluent-test1.lovable.app/ My Work tab (card background, tab bar #eaeef5, typography, badges, icons).


🔗 Additional Context

Merge order: Do not merge into main until #32 is merged. Open/target this PR against feature/32-build-projects-tab to keep the diff limited to My Work (#31) work.

Deployment Notes: Existing installs get new SQLite columns on next app launch (migration swallows duplicate-column errors).

Follow-up Tasks:

Add theme tokens, Lucide icons, HomeScreen with page header and tabs,
Projects tab with sync indicators and empty state, and My Work placeholder.
Consolidate theme tokens, extract shared hooks and components, fix ProjectSummary types, and remove unused SyncButton.
Adds getMyWorkChapters query, sync/workflow helpers, shared badges and row components, and wires My Work to refreshKey like Projects.
Adds download progress ring, Lovable-matched home shell styling, verse count sync/migration, and refactors shared row/sync helpers for clarity.
@mattrace-gloo mattrace-gloo requested a review from kaseywright June 3, 2026 21:29
Replace bible text rows per chapter on sync, preserve max total_verses on assignment upsert, and merge assigned/peer-check API lists without dropping workflow status.
@mattrace-gloo mattrace-gloo changed the base branch from main to feature/32-build-projects-tab June 3, 2026 21:43
@mattrace-gloo mattrace-gloo requested a review from B3RN153 June 4, 2026 00:50
kaseywright
kaseywright previously approved these changes Jun 5, 2026
Base automatically changed from feature/32-build-projects-tab to main June 8, 2026 16:13
@mattrace-gloo mattrace-gloo dismissed kaseywright’s stale review June 8, 2026 16:13

The base branch was changed.

Keep My Work tab, queries, and mock-aligned theme while incorporating #32 home shell from main.
Resolve add/add conflicts by keeping My Work implementation and mock-aligned theme on top of the merged Projects tab shell.
@mattrace-gloo mattrace-gloo requested a review from kaseywright June 8, 2026 16:18
@mattrace-gloo mattrace-gloo merged commit 3c47cbf into main Jun 8, 2026
6 checks passed
@mattrace-gloo mattrace-gloo deleted the feature/31-build-my-work-tab branch June 8, 2026 19:08
This was linked to issues Jun 10, 2026
@kaseywright kaseywright removed a link to an issue Jun 10, 2026
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.

Build My Work Tab

2 participants