Skip to content

My, your waves#3159

Merged
feruzm merged 4 commits intodevelopmentfrom
mywaves
Mar 30, 2026
Merged

My, your waves#3159
feruzm merged 4 commits intodevelopmentfrom
mywaves

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Mar 30, 2026

Summary by CodeRabbit

  • New Features

    • Added author filtering to the waves feed and combined filter chips for tag/author.
    • Enabled custom author-press handlers for comments and comment lists.
  • Bug Fixes

    • Prevented never-viewed channels from inflating unread totals.
    • Mark newly joined channels as viewed to correct unread counts and refresh global chat totals.
  • Chores

    • Updated SDK dependency to a newer patch version.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Dependency Update
package.json
Bumped @ecency/sdk from ^2.0.33 to ^2.0.34.
Comment Components
src/components/comment/view/commentView.tsx, src/components/comments/view/commentsView.tsx, src/components/comments/container/commentsContainer.tsx
Added optional onAuthorPress prop and threaded it from container → view → individual comment to override avatar/profile press handlers.
Waves Query Types
src/providers/queries/postQueries/wavesQueries.ts
Included getWavesByAccountQueryOptions in the WavesQueryOptions union so useWavesQuery accepts account-based query options.
Waves Screen & Header
src/screens/waves/screen/wavesScreen.tsx, src/screens/waves/children/wavesHeader.tsx
Added activeAuthor state, authorListRef, author query options, onAuthorPress wiring to WavesFeed/Comments, and updated WavesHeader to show both tag and author chips with clear handlers.
Chat / Mattermost Logic
src/providers/chat/mattermost.ts, src/screens/chats/container/chatsContainer.tsx
Treat channels with no last_viewed_at/last_view_at as zero unread; on join, attempt to mark channel viewed and zero unread counters, then refresh global unread chat count before navigating.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

A rabbit nudges props down the line, 🐇
Tunnels from avatar to waves that shine,
Filters for authors and tags now bloom,
Chats forget history, unread goes vroom—
Hop on, press a name, find the thread in time.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "My, your waves" is vague and does not clearly convey what changes were made; it appears to be a stylistic phrase rather than a descriptive summary of the main functionality added. Consider a more descriptive title that explains the core feature, such as "Add author filtering to waves feed" or "Implement waves filtering by account."
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mywaves

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 and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 | 🟡 Minor

Add activeAuthor to the dependency array.

The effect resets activeDeleteWaveRef when switching feeds, but activeAuthor is 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 setting last_viewed_at locally for fuller state consistency.

When viewedSuccessfully is true, zeroing the unread counts is correct, but the local last_viewed_at isn't updated. Since joined was fetched before markMattermostChannelViewed, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 41e49f2 and 6f105a3.

📒 Files selected for processing (3)
  • src/providers/chat/mattermost.ts
  • src/screens/chats/container/chatsContainer.tsx
  • src/screens/waves/screen/wavesScreen.tsx

@feruzm feruzm merged commit a0bcffc into development Mar 30, 2026
4 of 6 checks passed
@feruzm feruzm deleted the mywaves branch March 30, 2026 07: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