Skip to content

Simo6529/remove dms from wave icon#1812

Merged
simo6529 merged 22 commits intomainfrom
simo6529/remove-dms-from-wave-icon
Jan 26, 2026
Merged

Simo6529/remove dms from wave icon#1812
simo6529 merged 22 commits intomainfrom
simo6529/remove-dms-from-wave-icon

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Jan 23, 2026

Summary by CodeRabbit

Release Notes

New Features

  • Added enhanced home page section featuring network society messaging and mission statement
  • Introduced wider wave card display format with improved layout and information hierarchy

Improvements

  • Optimized preview loading and API response caching for faster performance
  • Refined home page typography, spacing, and visual styling
  • Enhanced wave filtering with improved parameter handling
  • Updated explore wave cards with new icons and improved visual presentation

✏️ Tip: You can customize this high-level summary in your review settings.

evocoder-agent and others added 4 commits January 22, 2026 22:56
Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

This PR consolidates multiple enhancements: migrating in-memory caches to LruTtlCache across API routes and services with configurable TTLs, adding directMessage filtering to wave queries, introducing a new WaveItemWide component for expanded wave rendering, creating a HomePageTextSection UI section, refactoring homepage layout with styling adjustments, modernizing test infrastructure with standardized formatting, and removing obsolete minting countdown components.

Changes

Cohort / File(s) Summary
Cache Migration to LruTtlCache
lib/cache/lruTtl.ts, app/api/farcaster/route.ts, app/api/open-graph/route.ts, app/api/tiktok/route.ts, app/api/wikimedia-card/route.ts, app/api/open-graph/ens.ts, services/api/farcaster.ts, services/api/link-preview-api.ts, services/api/tiktok-preview.ts, services/api/wikimedia-card.ts
Replaced in-memory Map-based caches with LruTtlCache instances. Added public methods (has, delete, clear) to LruTtlCache and updated set signature to accept optional ttlMs. Removed custom CacheEntry types and expiration logic across all affected routes/services.
Wave Query and Filtering
hooks/useWaves.ts, components/waves/drops/WaveCreatorPreviewModalContent.tsx
Added directMessage parameter to UseWavesParams and direct_message to query params, enabling DM filtering. Refactored useWaves to use useMemo for params construction and replaced state-based wave selection with computed values. Updated WaveCreatorPreviewModalContent to pass directMessage: false.
Wave List Components
components/waves/list/WaveItemWide.tsx, components/waves/list/WaveItemChat.tsx
Added new WaveItemWide component (~364 lines) with interactive wave card rendering including author info, banner styling, gradient backgrounds, and metadata. Updated WaveItemChat to use WaveItemWide within a bordered container instead of WaveItem.
Wave Stream and Divider Handling
components/brain/my-stream/MyStreamWaveChat.tsx
Introduced URL-driven initial drop/divider handling: parse serialNo and divider from searchParams, sync capturedDividerRef with initialDropState, and clean up query params via router.replace. Refined divider tracking logic with explicit type structure.
Homepage Text Section
components/home/HomePageTextSection.tsx, components/home/HomePageContent.tsx
Added new HomePageTextSection component with static content grid, decorative accents, and mission statement card. Integrated into HomePageContent after NowMintingSection with gradient divider.
Homepage Layout and Styling
components/home/hero/HeroHeader.tsx, components/home/explore-waves/ExploreWavesSection.tsx, components/home/explore-waves/ExploreWaveCard.tsx, components/home/explore-waves/ExploreWaveCardSkeleton.tsx, components/home/boosted/BoostedSection.tsx, components/home/now-minting/NowMintingSection.tsx, components/home/now-minting/NowMintingStatsItem.tsx
Updated Tailwind class ordering, spacing, and color utilities across multiple sections. Changed aspect ratios (3/2 → 2/1), updated icon variants (ChatBubbleLeftIcon → ChatBubbleBottomCenterIcon), adjusted padding/gap values, and modified border/gradient styling.
Homepage Cards and Metadata
components/home/next-mint-leading/NextMintCard.tsx, components/home/next-mint-leading/LeadingCard.tsx, components/home/next-mint-leading/NextMintLeadingSection.tsx
Simplified container structures, removed responsive gaps, adjusted media padding, added tw-[&>div]:tw-mx-0 constraints, updated author link styling, and removed wrapper divs for flatter DOM. Added dropId prop to MediaTypeBadge.
Deleted Components
components/home/now-minting/NowMintingCountdownError.tsx, components/home/now-minting/NowMintingCountdownFinalized.tsx
Removed NowMintingCountdownError and NowMintingCountdownFinalized components (~45 lines total).
Waves Utility Components
components/waves/drops/WaveDropsScrollToUnreadButton.tsx, components/waves/drops/wave-drops-all/index.tsx
Minor formatting: adjusted end-of-file newlines and reformatted type annotation across multiple lines.
Type Visibility Changes
services/alchemy/index.ts, components/common/RecipientSelector.tsx
Removed public re-export of all types from services/alchemy/index.ts. Converted RecipientSelectorProps to internal (removed export modifier) and removed named exports of RecipientSearchDisplay and RecipientSelectedDisplay.
Hooks Refactoring
hooks/useWavesList.ts, hooks/useDeviceInfo.ts
Refactored useWavesList to derive allWaves from combinedWaves and expose mainWaves in return. Reformatted multi-line conditionals in useDeviceInfo without logic changes.
Artist Profile Styling
components/the-memes/ArtistProfileHandle.tsx
Added className="tw-no-underline" attribute to Link elements with multiline formatting.
Test Infrastructure
__tests__/components/brain/left-sidebar/waves/BrainLeftSidebarWave.test.tsx, __tests__/components/waves/drops/DropMobileMenuHandler.test.tsx, __tests__/components/waves/drops/WaveDrop.test.tsx, __tests__/components/waves/drops/WaveDropsAll.test.tsx, __tests__/hooks/useDeviceInfo.test.ts, __tests__/hooks/useIsTouchDevice.test.ts
Standardized string delimiters to double quotes, updated import paths to use @/ alias consistently, expanded mock implementations and test data shapes, adjusted assertions with double-quoted test IDs, and refined per-test setup/teardown logic.
Configuration
package.json
Updated test, test-json, and test-json-changed scripts to run under cross-env NODE_ENV=test. Added --diff-filter=ACMR to format:uncommitted script for improved diff handling.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related issues

  • remove dm's from wave icon #1789: This PR introduces directMessage filtering to useWaves and related query parameters, directly addressing the removal of DMs from wave icon display.

Possibly related PRs

  • Notifications Rework 2 #1673: Strongly overlapping code-level changes to unread/mute state, wave navigation logic, and BrainLeftSidebarWave component behavior.
  • Minor padding fixes #1783: Overlapping UI and layout changes across homepage components (ExploreWavesSection, NowMintingSection, HeroHeader) with matching class and spacing adjustments.
  • Simo6529/wave gallery view #1779: Modifies the same MyStreamWaveChat component, altering URL-driven divider and initial-drop handling with related state management changes.

Poem

🐰 Cache cascades now flow with TTL time,
Homepage text sections shimmer sublime!
WaveItemWide spreads its interactive wings,
While test files polish their formatting strings—
A dance of refactor and fresh UI things! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Simo6529/remove dms from wave icon' does not accurately reflect the primary changes in the changeset, which include extensive refactoring of test files, new components, caching infrastructure changes, and UI updates across multiple home sections. Revise the title to better reflect the main changes, such as 'Add wave item card UI, refactor tests, and implement LRU TTL caching' or focus on the most impactful change if one exists.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

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.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
components/home/now-minting/NowMintingSection.tsx (1)

31-36: Bug: new Array(4).map() does not iterate over empty slots.

new Array(4) creates an array with 4 empty slots, but .map() skips empty slots entirely, resulting in no skeleton items being rendered. Additionally, the spread operator {...} here attempts to spread an array into JSX children incorrectly.

🐛 Proposed fix
                 <div className="tw-grid tw-grid-cols-2 tw-gap-3">
-                  {...new Array(4).map((_, i) => (
+                  {Array.from({ length: 4 }).map((_, i) => (
                     <div key={i} className="tw-space-y-2">
                       <div className="tw-h-4 tw-w-16 tw-animate-pulse tw-rounded tw-bg-iron-800/50" />
                       <div className="tw-h-6 tw-w-24 tw-animate-pulse tw-rounded tw-bg-iron-800/50" />
                     </div>
                   ))}
hooks/useWaves.ts (1)

57-75: Use debouncedParams.limit to keep queryFn aligned with the queryKey.

The queryKey includes debouncedParams which contains the limit property, but the queryFn uses the outer limit variable instead. If limit changes before the debounce window closes, the queryFn will fetch with the new limit while the queryKey remains unchanged, causing React Query to return cached results from a different request. Always use values from debouncedParams in the queryFn to maintain cache coherency.

🛠️ Suggested fix
-      queryParams["limit"] = `${limit}`;
+      queryParams["limit"] = `${debouncedParams.limit}`;
🧹 Nitpick comments (2)
__tests__/components/brain/left-sidebar/waves/BrainLeftSidebarWave.test.tsx (2)

50-62: Consider using partial typing instead of as any for better type safety.

Using as any bypasses type checking, which could hide issues if the actual wave type changes. Consider using Partial<T> or a test utility type to maintain some type safety while still allowing partial objects.

💡 Suggested improvement
+import { ApiWave } from "@/generated/models/ApiWave"; // or appropriate type

-  const baseWave = {
+  const baseWave: Partial<ApiWave> & { newDropsCount: any; isPinned: boolean } = {
     id: "1",
     type: ApiWaveType.Chat,
     name: "Chat Wave",
     picture: "",
     contributors: [],
     newDropsCount: { count: 2, latestDropTimestamp: 123 },
     isPinned: false,
     unreadDropsCount: 0,
     latestReadTimestamp: 0,
     firstUnreadDropSerialNo: null,
     isMuted: false,
-  } as any;
+  };

144-160: Icon detection using document.querySelectorAll is pragmatic but fragile.

Using [data-icon="bell-slash"] relies on FontAwesome's internal attribute structure. This is a common workaround when testing icons, but consider adding a data-testid to the muted indicator wrapper in the component for more resilient tests.

If the component can be modified, a more stable approach would be:

// In the component, wrap the muted indicator:
<span data-testid="muted-indicator">
  <FontAwesomeIcon icon={faBellSlash} />
</span>

Then test with:

expect(screen.queryByTestId("muted-indicator")).toBeInTheDocument();

Signed-off-by: ragnep <ragneinfo@gmail.com>
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.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/home/boosted/BoostedSection.tsx (1)

39-51: Layout inconsistency between loading and loaded states may cause visual shift.

The loading state (line 41) includes -tw-mx-8 with inner tw-px-8, while the loaded state (line 58) omits the negative margin. Additionally, padding differs: tw-py-16 in loading vs tw-py-10 md:tw-py-16 in loaded. This mismatch can cause Cumulative Layout Shift (CLS) when transitioning from loading to loaded.

Consider aligning the section wrapper classes for both states to prevent layout jumping.

Suggested fix to align loading state with loaded state
  if (isLoading) {
    return (
-      <section className="-tw-mx-8 tw-relative tw-bg-iron-950 tw-px-4 tw-py-16 md:tw-px-6 lg:tw-px-8">
+      <section className="tw-relative tw-bg-iron-950 tw-px-4 tw-py-10 md:tw-px-6 md:tw-py-16 lg:tw-px-8">
        <div className="tw-pointer-events-none tw-absolute tw-inset-x-0 tw-top-0 tw-h-px tw-bg-[linear-gradient(90deg,transparent_0%,rgba(255,255,255,0.08)_15%,rgba(255,255,255,0.08)_85%,transparent_100%)]" />
        <div className="tw-pointer-events-none tw-absolute tw-inset-x-0 tw-bottom-0 tw-h-px tw-bg-[linear-gradient(90deg,transparent_0%,rgba(255,255,255,0.08)_15%,rgba(255,255,255,0.08)_85%,transparent_100%)]" />
-        <div className="tw-relative tw-px-8">
+        <div className="tw-relative">
          <div className="tw-flex tw-h-64 tw-items-center tw-justify-center">

Also applies to: 57-61

🧹 Nitpick comments (1)
components/home/HomePageTextSection.tsx (1)

4-4: Consider adding overflow containment to the section.

The decorative gradient uses 180% width/height which extends beyond the section bounds. While the tw-pointer-events-none prevents interaction issues, this could potentially cause horizontal scrollbars on some viewport sizes if ancestor elements don't clip overflow.

💡 Optional: Add overflow-hidden to contain the gradient
-    <section className="tw-relative tw-px-3 tw-pb-10 tw-pt-8 sm:tw-px-4 md:tw-px-6 md:tw-pb-16 md:tw-pt-10 lg:tw-px-8">
+    <section className="tw-relative tw-overflow-hidden tw-px-3 tw-pb-10 tw-pt-8 sm:tw-px-4 md:tw-px-6 md:tw-pb-16 md:tw-pt-10 lg:tw-px-8">

Signed-off-by: ragnep <ragneinfo@gmail.com>
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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@hooks/useWavesList.ts`:
- Line 49: allWavesRef is only refreshed when areWavesEqual deems arrays
different, but that comparator omits UI-relevant fields (e.g.,
metrics.latest_drop_timestamp) causing stale displayed data; update the equality
gate used when setting allWavesRef (or switch to returning combinedWaves
directly) to include a stable version/timestamp field (e.g.,
metrics.latest_drop_timestamp or an updated_at) or any UI-facing properties from
EnhancedWave so changes to those fields cause the ref/state to update and
consumers to re-render; adjust the comparison function (areWavesEqual) or
replace its usage around allWavesRef/combinedWaves to ensure those fields are
considered.

Comment thread hooks/useWavesList.ts Outdated
ragnep and others added 8 commits January 23, 2026 16:59
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
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.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
hooks/useWavesList.ts (1)

215-231: Dependency array issues will cause unnecessary recomputation.

Two problems with the dependency array:

  1. prevMainWavesRef.current (line 227): Ref values don't trigger re-renders when mutated, making this dependency unreliable. The react-hooks/exhaustive-deps rule typically flags this pattern.

  2. missingPinnedIds (line 228): This is a constant [] declared at line 87, creating a new array reference on every render. This defeats the memoization and causes recomputation on every render cycle.

🐛 Proposed fix
+// Move outside component or memoize
+const EMPTY_MISSING_IDS: string[] = [];

 const useWavesList = () => {
   // ...
-  const missingPinnedIds: string[] = [];
+  // Use the constant instead
   // ...
   return useMemo(
     () => ({
       // ...
-      mainWaves: prevMainWavesRef.current,
-      missingPinnedIds,
+      mainWaves, // Use the actual mainWaves from useWavesOverview
+      missingPinnedIds: EMPTY_MISSING_IDS,
       // ...
     }),
     [
       // ...
-      prevMainWavesRef.current,
-      missingPinnedIds,
+      mainWaves,
       // ...
     ]
   );
 };
♻️ Duplicate comments (1)
hooks/useWavesList.ts (1)

74-79: Same side-effect pattern as noted above.

The ref mutation at line 77 inside useMemo follows the same pattern flagged for allPinnedWaves. Consider consolidating these ref updates outside of memoization callbacks if strict concurrent-mode safety is needed.

🧹 Nitpick comments (2)
hooks/useWavesList.ts (2)

103-119: Side effect in useMemo - consider extracting.

Mutating prevPinnedWavesRef.current inside useMemo is a side effect. While benign here, React may invoke memoization callbacks multiple times in concurrent mode. Consider extracting the ref update or using a separate effect if this comparison becomes critical.


235-237: Unsafe any cast bypasses type checking.

The as any cast on w.chat disables type safety for the nested property access. If ApiWave doesn't define this structure, consider extending the type or adding a type guard. The optional chaining mitigates runtime errors but won't catch API schema changes at compile time.

♻️ Type-safe alternative
+interface ChatWithDmScope {
+  scope?: {
+    group?: {
+      is_direct_message?: boolean;
+    };
+  };
+}

 const waveIsDm = (w: ApiWave) =>
   w.wave.type === ApiWaveType.Chat &&
-  (w.chat as any)?.scope?.group?.is_direct_message === true;
+  (w.chat as ChatWithDmScope | undefined)?.scope?.group?.is_direct_message === true;

ragnep and others added 4 commits January 26, 2026 09:48
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
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.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
components/home/boosted/BoostedDropCardHome.tsx (3)

211-216: Fix unclosed <span> in “Time ago” pill.

There are two opening <span> tags but only one closing tag, which is a JSX parse error.

🐛 Proposed fix
-          <div className="tw-flex tw-items-center tw-rounded-full tw-border tw-border-solid tw-border-white/10 tw-bg-black/40 tw-px-2.5 tw-py-1 tw-shadow-[inset_0_1px_0_rgba(255,255,255,0.06)] tw-backdrop-blur-md tw-transition-colors group-hover:tw-bg-black/60">
-            <span className="tw-text-[10px] tw-font-semibold tw-leading-4 tw-tracking-wide tw-text-zinc-300">
-            <span className="tw-text-[10px] tw-font-semibold tw-leading-4 tw-tracking-wide tw-text-zinc-300">
+          <div className="tw-flex tw-items-center tw-rounded-full tw-border tw-border-solid tw-border-white/10 tw-bg-black/40 tw-px-2.5 tw-py-1 tw-shadow-[inset_0_1px_0_rgba(255,255,255,0.06)] tw-backdrop-blur-md tw-transition-colors group-hover:tw-bg-black/60">
+            <span className="tw-text-[10px] tw-font-semibold tw-leading-4 tw-tracking-wide tw-text-zinc-300">
               {getTimeAgoShort(drop.created_at)}
             </span>
           </div>

225-230: Fix unclosed <span> in remaining boosts indicator.

Two <span> openings but only one closing tag → JSX parse error.

🐛 Proposed fix
-            {remainingBoosts > 0 && (
-              <span className="tw-ml-1 tw-text-[10px] tw-font-bold tw-tabular-nums tw-leading-4 tw-text-iron-50">
-              <span className="tw-ml-1 tw-text-[10px] tw-font-bold tw-tabular-nums tw-leading-4 tw-text-iron-50">
-                +{remainingBoosts}
-              </span>
-            )}
+            {remainingBoosts > 0 && (
+              <span className="tw-ml-1 tw-text-[10px] tw-font-bold tw-tabular-nums tw-leading-4 tw-text-iron-50">
+                +{remainingBoosts}
+              </span>
+            )}

234-250: Close the extra media wrapper <div>.

There are two consecutive wrapper <div> openings, but only one is closed before the ternary ends. That’s a JSX parse error and will break the component.

🐛 Proposed fix
-        {media ? (
-          <div className="tw-relative tw-aspect-[5/2] tw-w-full tw-overflow-hidden tw-rounded-xl sm:tw-aspect-[5/4] md:tw-aspect-[8/5] lg:tw-aspect-[5/4] xl:tw-aspect-[8/5]">
-          <div className="tw-relative tw-aspect-[5/2] tw-w-full tw-overflow-hidden tw-rounded-xl sm:tw-aspect-[5/4] md:tw-aspect-[8/5] lg:tw-aspect-[5/4] xl:tw-aspect-[8/5]">
+        {media ? (
+          <div className="tw-relative tw-aspect-[5/2] tw-w-full tw-overflow-hidden tw-rounded-xl sm:tw-aspect-[5/4] md:tw-aspect-[8/5] lg:tw-aspect-[5/4] xl:tw-aspect-[8/5]">
+            <div className="tw-relative tw-aspect-[5/2] tw-w-full tw-overflow-hidden tw-rounded-xl sm:tw-aspect-[5/4] md:tw-aspect-[8/5] lg:tw-aspect-[5/4] xl:tw-aspect-[8/5]">
               <div className="tw-relative tw-h-full tw-w-full">
                 <div className="tw-relative tw-z-0 tw-flex tw-h-full tw-w-full tw-items-center tw-justify-center tw-rounded-xl tw-transition-transform tw-duration-700 group-hover:tw-scale-[1.02]">
                   <div className="tw-relative tw-h-full tw-w-full tw-overflow-hidden">
                     <DropListItemContentMedia
                       media_mime_type={media.mime_type}
                       media_url={media.url}
                       imageScale={ImageScale.AUTOx450}
                       imageObjectPosition="center"
                     />
                   </div>
                 </div>
               </div>
-          </div>
+            </div>
+          </div>
         ) : (
🧹 Nitpick comments (1)
__tests__/components/waves/drops/WaveDropsAll.test.tsx (1)

135-167: Consider reusing the shared drop factory to reduce mock drift.

There’s already a createMockDrop helper in __tests__/utils/editDropTestUtils.tsx. Reusing it (or importing and extending it here) keeps mock shapes aligned with evolving ApiDrop fields and avoids divergence across suites.

ragnep and others added 4 commits January 26, 2026 10:05
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
15.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@components/waves/list/WaveItemWide.tsx`:
- Line 152: Update the isDirectMessage expression to safely handle absent chat
by adding optional chaining on chat and scope: change the usage in WaveItemWide
where isDirectMessage is derived from wave to use
wave?.chat?.scope?.group?.is_direct_message ?? false (reference symbol:
isDirectMessage and wave in WaveItemWide.tsx) so runtime errors don't occur when
chat or scope is undefined.
🧹 Nitpick comments (3)
components/waves/list/WaveItemWide.tsx (3)

109-113: aria-label on a plain <div> has no accessibility effect.

Screen readers ignore aria-label on elements without an interactive role. Since the non-interactive case represents a wave that cannot be navigated to, consider removing the aria-label from the div to avoid misleading the markup.

Suggested fix
   return (
-    <div className={className} aria-label={ariaLabel}>
+    <div className={className}>
       {children}
     </div>
   );

274-278: Redundant Space key check.

event.key === " " is sufficient for detecting the Space key press; event.code === "Space" is redundant here.

Suggested simplification
       if (
         event.key === "Enter" ||
-        event.key === " " ||
-        event.code === "Space"
+        event.key === " "
       ) {

341-347: Note: Zero counts display as "-" due to numberWithCommas behavior.

The helper numberWithCommas returns "-" for zero values. Combined with the singular/plural logic dropsCount === 1 ? "Drop" : "Drops", a wave with 0 drops will display as - Drops. If displaying 0 Drops is preferred, consider adjusting the zero-handling logic.

Comment thread components/waves/list/WaveItemWide.tsx
@simo6529 simo6529 merged commit 7f9ab20 into main Jan 26, 2026
6 of 7 checks passed
@simo6529 simo6529 deleted the simo6529/remove-dms-from-wave-icon branch January 26, 2026 08:34
@coderabbitai coderabbitai Bot mentioned this pull request Mar 9, 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.

2 participants