Conversation
📝 WalkthroughWalkthroughAdds author-press propagation and author-based filtering to comment and waves components, extends waves query options for account queries, adjusts Mattermost unread/viewed logic and chat join flow, and updates Waves header UI to show tag and author filter chips. Changes
Sequence DiagramsequenceDiagram
participant User
participant CommentsView
participant WavesScreen
participant SDK as "SDK Query"
participant WavesFeed
User->>CommentsView: press author avatar/profile
CommentsView->>WavesScreen: onAuthorPress(username)
WavesScreen->>WavesScreen: set activeAuthor, build authorQueryOptions
WavesScreen->>SDK: getWavesByAccountQueryOptions(activeAuthor)
SDK-->>WavesScreen: authorQueryOptions
WavesScreen->>WavesFeed: render with authorQueryOptions
WavesFeed-->>User: display author-filtered waves
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/screens/waves/screen/wavesScreen.tsx (1)
283-285:⚠️ Potential issue | 🟡 MinorAdd
activeAuthorto the dependency array.The effect resets
activeDeleteWaveRefwhen switching feeds, butactiveAuthoris missing from dependencies. This could leave a stale delete reference when switching to/from an author filter, potentially causing the wrong feed's delete function to be invoked.🐛 Proposed fix
useEffect(() => { activeDeleteWaveRef.current = null; - }, [activeTag, feedType]); + }, [activeTag, activeAuthor, feedType]);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/screens/waves/screen/wavesScreen.tsx` around lines 283 - 285, The effect using useEffect that resets activeDeleteWaveRef.current currently lists [activeTag, feedType] as dependencies but omits activeAuthor; update the dependency array for the useEffect that references activeDeleteWaveRef so it includes activeAuthor along with activeTag and feedType to ensure the ref is cleared when the author filter changes (locate the useEffect block referencing activeDeleteWaveRef.current and add activeAuthor to its dependencies).
🧹 Nitpick comments (1)
src/screens/chats/container/chatsContainer.tsx (1)
619-636: Consider settinglast_viewed_atlocally for fuller state consistency.When
viewedSuccessfullyis true, zeroing the unread counts is correct, but the locallast_viewed_atisn't updated. Sincejoinedwas fetched beforemarkMattermostChannelViewed, it still has the pre-view timestamp (or null). This could cause minor UI inconsistencies until the next server refresh.♻️ Proposed enhancement
let viewedSuccessfully = false; +let viewedAt: number | undefined; try { await markMattermostChannelViewed(joinedId); viewedSuccessfully = true; + viewedAt = Date.now(); } catch { // non-critical — channel will show unreads until manually opened } const mergedChannel = { ...resolved?.resolvedChannel, ...channel, ...joined, ...(viewedSuccessfully && { unread_messages: 0, unread_mentions: 0, mention_count: 0, + last_viewed_at: viewedAt, + last_view_at: viewedAt, }), };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/screens/chats/container/chatsContainer.tsx` around lines 619 - 636, The mergedChannel object isn't updating last_viewed_at after markMattermostChannelViewed succeeds, causing UI inconsistency; update the mergedChannel creation (where resolved?.resolvedChannel, channel, joined are merged and viewedSuccessfully is checked) to also set last_viewed_at when viewedSuccessfully is true (e.g., set last_viewed_at to the current timestamp/ISO string) so local state reflects the view action immediately alongside zeroed unread counts.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/screens/waves/screen/wavesScreen.tsx`:
- Around line 283-285: The effect using useEffect that resets
activeDeleteWaveRef.current currently lists [activeTag, feedType] as
dependencies but omits activeAuthor; update the dependency array for the
useEffect that references activeDeleteWaveRef so it includes activeAuthor along
with activeTag and feedType to ensure the ref is cleared when the author filter
changes (locate the useEffect block referencing activeDeleteWaveRef.current and
add activeAuthor to its dependencies).
---
Nitpick comments:
In `@src/screens/chats/container/chatsContainer.tsx`:
- Around line 619-636: The mergedChannel object isn't updating last_viewed_at
after markMattermostChannelViewed succeeds, causing UI inconsistency; update the
mergedChannel creation (where resolved?.resolvedChannel, channel, joined are
merged and viewedSuccessfully is checked) to also set last_viewed_at when
viewedSuccessfully is true (e.g., set last_viewed_at to the current
timestamp/ISO string) so local state reflects the view action immediately
alongside zeroed unread counts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9340aaea-cc2e-4d19-89c0-8f346c0ca074
📒 Files selected for processing (3)
src/providers/chat/mattermost.tssrc/screens/chats/container/chatsContainer.tsxsrc/screens/waves/screen/wavesScreen.tsx
Summary by CodeRabbit
New Features
Bug Fixes
Chores