Conversation
Signed-off-by: prxt6529 <prxt@6529.io>
📝 WalkthroughWalkthroughAdds a new polling hook that computes per-connected-account unread notification counts, exposes a normalized address→count map on SeizeConnectContext, and wires those counts into header, sidebar, connected-accounts, and proxy UI to render per-account badges and an aggregated unread indicator. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as UI Components
participant Context as SeizeConnectContext
participant Hook as useConnectedAccountsUnreadNotifications
participant RQ as ReactQuery
participant API as Backend API
UI->>Context: read connectedAccountUnreadNotifications
Context->>Hook: initialize with storedConnectedAccounts
Hook->>RQ: create polling queries (interval: 15000ms)
RQ->>API: fetch unread count per account
API-->>RQ: return counts
RQ-->>Hook: aggregated address→count map
Hook-->>Context: provide counts
Context-->>UI: deliver counts
UI->>UI: render badges/dots per account
Note over RQ,API: refetch on interval, focus, reconnect
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
components/navigation/BottomNavigation.tsx (1)
118-121: Use a stable identifier instead of label text for Home offset logic.Line 119 depends on
item.name === "Home", which is brittle if the label changes (copy/i18n). Prefer a stable field likeiconor an explicitid.Suggested refactor
- item.name === "Home" ? "-tw-translate-y-1" : "" + item.icon === "home" ? "-tw-translate-y-1" : ""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@components/navigation/BottomNavigation.tsx` around lines 118 - 121, The current offset logic in BottomNavigation.tsx uses a brittle label check (item.name === "Home") to apply "-tw-translate-y-1"; replace this with a stable identifier (e.g., item.id or item.key or item.icon) by updating the conditional in the className expression to check that stable field instead of item.name, and ensure the navigation items source (where items are defined) includes and sets that stable id for the Home entry so the new condition (e.g., item.id === 'home' or item.icon === 'homeIcon') reliably targets the Home button.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@components/navigation/BottomNavigation.tsx`:
- Around line 111-112: Replace the hard-coded tw-h-[65px] in the
BottomNavigation component’s container className with a height that adds the iOS
safe area inset (use calc(65px + env(safe-area-inset-bottom, 0px)) or
equivalent) so the nav sits above the gesture area; then update the layout
spacer element used to push page content (the bottom nav spacer in the same
component) to use the identical height formula so content spacing remains in
sync.
In `@hooks/useConnectedAccountsUnreadNotifications.ts`:
- Around line 31-42: The current try/catch in
useConnectedAccountsUnreadNotifications swallows fetch/auth errors and returns
0, which can incorrectly clear unread counts; change the error handling so
failures do not coerce to 0: remove the catch that returns 0 (or rethrow the
caught error) so that errors from commonApiFetch(...) propagate, and keep the
successful path that returns clampUnreadCount(notifications.unread_count);
adjust any callers to handle the thrown error or preserve prior values instead
of relying on a 0 fallback.
---
Nitpick comments:
In `@components/navigation/BottomNavigation.tsx`:
- Around line 118-121: The current offset logic in BottomNavigation.tsx uses a
brittle label check (item.name === "Home") to apply "-tw-translate-y-1"; replace
this with a stable identifier (e.g., item.id or item.key or item.icon) by
updating the conditional in the className expression to check that stable field
instead of item.name, and ensure the navigation items source (where items are
defined) includes and sets that stable id for the Home entry so the new
condition (e.g., item.id === 'home' or item.icon === 'homeIcon') reliably
targets the Home button.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 41bc68df-c800-46d3-861e-6f34ec5801a8
📒 Files selected for processing (10)
components/auth/SeizeConnectContext.tsxcomponents/header/AppHeader.tsxcomponents/header/AppSidebarConnectedAccounts.tsxcomponents/header/AppSidebarUserInfo.tsxcomponents/header/user/connected/HeaderUserConnectedAccounts.tsxcomponents/header/user/proxy/HeaderUserProxyDropdown.tsxcomponents/layout/AppLayout.tsxcomponents/layout/sidebar/WebSidebarUser.tsxcomponents/navigation/BottomNavigation.tsxhooks/useConnectedAccountsUnreadNotifications.ts
There was a problem hiding this comment.
♻️ Duplicate comments (1)
components/navigation/BottomNavigation.tsx (1)
111-112:⚠️ Potential issue | 🟠 MajorReintroduce bottom safe-area compensation for iOS gesture areas.
Line 111 still uses a fixed nav height without
safe-area-inset-bottom, so tap targets can sit too low on notched devices. Please also keep the spacer incomponents/layout/AppLayout.tsxsynchronized with the same formula.Suggested fix
- className={`${hiddenStyle} tw-fixed tw-bottom-0 tw-left-0 tw-z-50 tw-h-20 tw-w-full tw-bg-black tw-shadow-inner tw-transition-[opacity,transform] tw-duration-75 tw-relative before:tw-absolute before:tw-inset-x-0 before:tw-top-0 before:tw-h-px before:tw-bg-iron-900 before:tw-content-['']`} + className={`${hiddenStyle} tw-fixed tw-bottom-0 tw-left-0 tw-z-50 tw-h-[calc(5rem+env(safe-area-inset-bottom,0px))] tw-pb-[env(safe-area-inset-bottom,0px)] tw-w-full tw-bg-black tw-shadow-inner tw-transition-[opacity,transform] tw-duration-75 tw-relative before:tw-absolute before:tw-inset-x-0 before:tw-top-0 before:tw-h-px before:tw-bg-iron-900 before:tw-content-['']`}And keep spacer synced in
components/layout/AppLayout.tsx:- <div className="tw-h-20 tw-w-full" /> + <div className="tw-h-[calc(5rem+env(safe-area-inset-bottom,0px))] tw-w-full" />🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@components/navigation/BottomNavigation.tsx` around lines 111 - 112, Bottom navigation currently uses a fixed height class (tw-h-20) in the BottomNavigation component causing tap targets to be too low on iOS; change the height to use a calc that adds the safe-area inset (e.g., calc(5rem + env(safe-area-inset-bottom))) by replacing the fixed tailwind height with an inline style or CSS variable so the element respects safe-area-inset-bottom, and then update the matching spacer in the AppLayout component (the spacer element in components/layout/AppLayout.tsx) to use the identical calc formula so both remain synchronized.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@components/navigation/BottomNavigation.tsx`:
- Around line 111-112: Bottom navigation currently uses a fixed height class
(tw-h-20) in the BottomNavigation component causing tap targets to be too low on
iOS; change the height to use a calc that adds the safe-area inset (e.g.,
calc(5rem + env(safe-area-inset-bottom))) by replacing the fixed tailwind height
with an inline style or CSS variable so the element respects
safe-area-inset-bottom, and then update the matching spacer in the AppLayout
component (the spacer element in components/layout/AppLayout.tsx) to use the
identical calc formula so both remain synchronized.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1861ef1b-2b4e-4657-b25d-3e6213514a42
📒 Files selected for processing (3)
components/layout/AppLayout.tsxcomponents/navigation/BottomNavigation.tsxcomponents/navigation/NavItem.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- components/layout/AppLayout.tsx
There was a problem hiding this comment.
♻️ Duplicate comments (1)
components/navigation/BottomNavigation.tsx (1)
111-112:⚠️ Potential issue | 🟠 MajorAdd
safe-area-inset-bottomfor iOS notched devices.The 85px height still doesn't account for iOS home indicator safe area. On devices with a home indicator, the nav may overlap or sit too close to the gesture area, affecting tap targets.
Additionally, per the relevant code snippets in
LayoutContext.tsx(lines 280-288), the layout system measures this element's height viagetBoundingClientRect(). Without the safe-area extension, the measured height won't include the bottom inset, potentially causing content to be clipped behind the nav on notched devices.Suggested fix
- className={`${hiddenStyle} tw-fixed tw-bottom-0 tw-left-0 tw-z-50 tw-h-[85px] tw-w-full tw-bg-black tw-shadow-inner tw-transition-[opacity,transform] tw-duration-75`} + className={`${hiddenStyle} tw-fixed tw-bottom-0 tw-left-0 tw-z-50 tw-h-[calc(85px+env(safe-area-inset-bottom,0px))] tw-pb-[env(safe-area-inset-bottom,0px)] tw-w-full tw-bg-black tw-shadow-inner tw-transition-[opacity,transform] tw-duration-75`}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@components/navigation/BottomNavigation.tsx` around lines 111 - 112, BottomNavigation's fixed height doesn't include iOS safe-area inset, so update the component (BottomNavigation.tsx) to account for env(safe-area-inset-bottom): add the safe-area inset to the element's bottom spacing (e.g., include padding-bottom using env(safe-area-inset-bottom) / constant(safe-area-inset-bottom) or a Tailwind utility that applies that padding) while keeping the visible tap target height (~85px) so LayoutContext.tsx's getBoundingClientRect() measures include the inset; ensure the className that currently uses hiddenStyle and tw-h-[85px] is adjusted to include the bottom-safe-area padding rather than reducing the core 85px height.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@components/navigation/BottomNavigation.tsx`:
- Around line 111-112: BottomNavigation's fixed height doesn't include iOS
safe-area inset, so update the component (BottomNavigation.tsx) to account for
env(safe-area-inset-bottom): add the safe-area inset to the element's bottom
spacing (e.g., include padding-bottom using env(safe-area-inset-bottom) /
constant(safe-area-inset-bottom) or a Tailwind utility that applies that
padding) while keeping the visible tap target height (~85px) so
LayoutContext.tsx's getBoundingClientRect() measures include the inset; ensure
the className that currently uses hiddenStyle and tw-h-[85px] is adjusted to
include the bottom-safe-area padding rather than reducing the core 85px height.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ee4fb896-8d56-45dd-8989-c0fb003314ad
📒 Files selected for processing (2)
components/layout/AppLayout.tsxcomponents/navigation/BottomNavigation.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- components/layout/AppLayout.tsx
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
hooks/useConnectedAccountsUnreadNotifications.ts (1)
46-50: Normalize query-key address order to avoid cache churn.The key currently depends on incoming account order. Reordered-but-identical accounts will produce a new query key, which can drop continuity for cached
previousCountsduring transient per-account failures.Proposed refactor
+ const stableAddressKeys = accounts + .map((account) => toAddressKey(account.address)) + .sort(); + const queryKey = [ QueryKey.IDENTITY_NOTIFICATIONS, "connected-account-unread-counts", - accounts.map((account) => toAddressKey(account.address)), + stableAddressKeys, ] as const;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@hooks/useConnectedAccountsUnreadNotifications.ts` around lines 46 - 50, The query key generation in useConnectedAccountsUnreadNotifications.ts uses the accounts array order so QueryKey.IDENTITY_NOTIFICATIONS + "connected-account-unread-counts" + accounts.map(toAddressKey) can change when account order changes; normalize by mapping accounts to their toAddressKey values, sorting that array deterministically (e.g., lexicographically), and use the sorted address keys in the queryKey so identical sets produce the same key and avoid cache churn.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@hooks/useConnectedAccountsUnreadNotifications.ts`:
- Around line 46-50: The query key generation in
useConnectedAccountsUnreadNotifications.ts uses the accounts array order so
QueryKey.IDENTITY_NOTIFICATIONS + "connected-account-unread-counts" +
accounts.map(toAddressKey) can change when account order changes; normalize by
mapping accounts to their toAddressKey values, sorting that array
deterministically (e.g., lexicographically), and use the sorted address keys in
the queryKey so identical sets produce the same key and avoid cache churn.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2c93f58b-8623-4ecb-8928-3c06a43e6a8d
📒 Files selected for processing (1)
hooks/useConnectedAccountsUnreadNotifications.ts



Summary by CodeRabbit
New Features
Style