code
Clone this repository
https://tangled.org/bretton.dev/coves-mobile
git@knot.bretton.dev:bretton.dev/coves-mobile
For self-hosted knots, clone URLs may differ based on your setup.
Add per-post CommentsProvider caching with LRU eviction for instant
back-navigation, scroll position restoration, and draft text preservation.
Updates feed tests to reflect the new feed type tab behavior:
- Default feed is now Discover (not timeline)
- Authenticated users see both Discover and For You tabs
- Unauthenticated users see only Discover tab
- Updated test descriptions for clarity
馃 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updates tests to work with the new CommentsProvider constructor that
requires postUri and postCid parameters.
Changes:
- CommentsProvider tests: pass postUri/postCid in constructor, remove
parameters from loadComments calls
- Add MockCommentsProvider helper for widget tests
- Update FocusedThreadScreen tests to provide commentsProvider parameter
馃 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updates PostDetailScreen, ReplyScreen, and FocusedThreadScreen to use
the new CommentsProviderCache for instant back-navigation and state preservation.
PostDetailScreen:
- Acquires provider from cache with reference counting
- Restores scroll position when returning to cached comments
- Background refresh if data is stale (>5 min)
- Handles sign-out by navigating back to feed
ReplyScreen:
- Requires CommentsProvider parameter for draft access
- Saves draft text on cancel, restores on reopen
- Per-parent-URI drafts (separate drafts for different reply contexts)
- Auto-closes on sign-out
FocusedThreadScreen:
- Passes CommentsProvider to children for consistent draft/vote state
馃 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduces a caching layer for CommentsProvider instances to enable instant
back-navigation when returning to previously viewed posts.
Key changes:
- Add CommentsProviderCache with LRU eviction (15 posts max)
- Refactor CommentsProvider to be immutable per post (postUri/postCid in constructor)
- Add reference counting to prevent evicting in-use providers
- Add scroll position and draft text preservation to CommentsProvider
- Add staleness tracking for background refresh of cached data
- Wire up cache in main.dart with sign-out cleanup
The cache automatically disposes providers when evicted and clears all
providers on sign-out for privacy.
馃 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New features:
- FocusedThreadScreen for viewing deep comment threads
- "Read X more replies" link at maxDepth navigates to focused view
- Ancestors shown flat above anchor, replies threaded below
- Auto-scroll to anchor comment on open
Performance & code quality:
- Fix O(n虏) descendant counting - only compute when needed at maxDepth
- Extract threading colors to shared kThreadingColors constant
- Remove unused Consumer<VoteProvider> wrapper
- Extract StatusBarOverlay reusable widget
Tests:
- Add unit tests for countDescendants
- Add widget tests for CommentThread max-depth behavior
- Add widget tests for FocusedThreadScreen rendering
馃 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add support for --dart-define=ENV=dev as a convenience shorthand
alongside the existing ENVIRONMENT override. Maps 'dev'/'local' to
local environment and 'prod'/'production' to production.
Also remove macos Flutter config files from tracking (already in gitignore).
馃 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>