Skip to content

Comments

Chore: notifications url params and visibility#32

Merged
alexmarqs merged 4 commits intomainfrom
chore/notifications-url-params-and-visibility
Nov 15, 2025
Merged

Chore: notifications url params and visibility#32
alexmarqs merged 4 commits intomainfrom
chore/notifications-url-params-and-visibility

Conversation

@alexmarqs
Copy link
Owner

@alexmarqs alexmarqs commented Nov 15, 2025

Summary by CodeRabbit

  • New Features

    • Added a notifications section in the sidebar with a button linking to the Settings notifications tab.
  • Refactor

    • Replaced the sponsor section with the new notifications section in the sidebar.
    • Settings page now uses URL-backed tab state (shareable links) and a Suspense boundary for loading.
  • Bug Fixes / UX

    • Updated notification setting label to clearer wording.

…niesList and SideBar

- Introduced NotificationsSideSection to display weekly email digest and manage notifications.
- Integrated NotificationsSideSection into CompaniesList and SideBar for enhanced user experience.
- Updated settings management to utilize new SettingsTab enum for better type safety.
- Deleted the useSettingsTab hook as it is no longer needed in the project, streamlining the codebase.
…on layout

- Deleted SponsorSideSection from CompaniesList and SideBar components to streamline the UI.
- Enhanced NotificationsSideSection layout for better user engagement, updating text and structure for clarity.
@cursor
Copy link

cursor bot commented Nov 15, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 16.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@coderabbitai
Copy link

coderabbitai bot commented Nov 15, 2025

Walkthrough

SponsorSideSection was removed and replaced with a new NotificationsSideSection used in CompaniesList and SideBar. Settings tab handling was converted to controlled state using a new SettingsTab enum and query-state utilities; types were adjusted and Settings page wrapped in Suspense.

Changes

Cohort / File(s) Change Summary
Component replacement
apps/web/src/components/CompaniesList.tsx, apps/web/src/components/SideBar.tsx
Replaced SponsorSideSection import/usage with NotificationsSideSection. SideBar props expanded to include categoryOptions.
New notifications component
apps/web/src/components/NotificationsSideSection.tsx
Added NotificationsSideSection component rendering a RetroContainer with heading, description, and a Link button to /settings?tab=NOTIFICATIONS.
Removed sponsor component
apps/web/src/components/SponsorSideSection.tsx
Deleted the SponsorSideSection component and its export.
Settings tabs (component)
apps/web/src/components/settings/index.tsx
Converted Tabs from uncontrolled (defaultValue) to controlled (value) using useQueryStates; replaced string tab ids with SettingsTab enum values; removed notifications analytics tracking.
Search params / query state
apps/web/src/lib/search-params.ts
Added SettingsTab enum, defaultSettings, settingsQueryStateKeys, loadSettings, and settingsCache to support enum-based query-state handling.
Types update
apps/web/src/lib/types.ts
Imported SettingsTab type and renamed exported type to SettingsTabs, changing its id field to use the SettingsTab enum.
Settings page render
apps/web/src/app/settings/page.tsx
Wrapped <Settings /> in React Suspense with an empty fallback.
Notification label tweak
apps/web/src/components/settings/notification/NotificationSettings.tsx
Updated label text for new_companies notification from "Receive weekly email updates..." to "Receive email updates...".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as UI Components
    participant Router as Next.js Router
    participant Settings as Settings Page
    participant QueryState as Query State

    User->>UI: Click "Subscribe now" (NotificationsSideSection)
    UI->>Router: Navigate to /settings?tab=NOTIFICATIONS
    Router->>Settings: Load Settings page
    Settings->>QueryState: read `tab` via settingsQueryStateKeys
    QueryState-->>Settings: provide controlled tab value (NOTIFICATIONS)
    Settings->>Settings: set Tabs `value` to NOTIFICATIONS
    Note right of Settings: User interacts with controlled Tabs\non change -> update query state
    Settings->>QueryState: update `tab` param on tab change
    QueryState-->>Router: sync URL with selected tab
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas to focus:
    • Ensure all usages updated for the renamed type (SettingsTabs) and imported SettingsTab enum.
    • Verify settingsQueryStateKeys parsing/serialization (parseAsStringEnum) and that URL sync behaves correctly.
    • Confirm no remaining imports of the removed SponsorSideSection.
    • Check SideBar prop changes are propagated where SideBar is instantiated.

Possibly related PRs

Poem

🐰 I hopped in code, a sponsor waved goodbye,
I planted bells that catch the eye,
Tabs now listen to the URL's hum,
Click subscribe — the settings come! 🎐

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: introducing URL parameters (via SettingsTab enum and query state management) and replacing SponsorSideSection with NotificationsSideSection to increase notifications visibility.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/notifications-url-params-and-visibility

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.

@alexmarqs alexmarqs changed the title Chore/notifications url params and visibility Chore: notifications url params and visibility Nov 15, 2025
Copy link

@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

🧹 Nitpick comments (1)
apps/web/src/components/settings/index.tsx (1)

34-38: Type assertion is safe but consider alternatives.

The type assertion value as SettingsTab on line 36 is safe because parseAsStringEnum validates the incoming value. However, consider whether the assertion is necessary—if settingsTab.tab is already typed as SettingsTab, the assertion might be redundant.

If the types align correctly, you could simplify to:

-        onValueChange={(value) => setSettingsTab({ tab: value as SettingsTab })}
+        onValueChange={(value) => setSettingsTab({ tab: value })}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7f2979 and 592eea9.

📒 Files selected for processing (7)
  • apps/web/src/components/CompaniesList.tsx (2 hunks)
  • apps/web/src/components/NotificationsSideSection.tsx (1 hunks)
  • apps/web/src/components/SideBar.tsx (2 hunks)
  • apps/web/src/components/SponsorSideSection.tsx (0 hunks)
  • apps/web/src/components/settings/index.tsx (2 hunks)
  • apps/web/src/lib/search-params.ts (3 hunks)
  • apps/web/src/lib/types.ts (2 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/src/components/SponsorSideSection.tsx
🧰 Additional context used
🧬 Code graph analysis (3)
apps/web/src/components/CompaniesList.tsx (2)
apps/web/src/components/NotificationsSideSection.tsx (1)
  • NotificationsSideSection (6-27)
apps/web/src/components/SponsorSideSection.tsx (1)
  • SponsorSideSection (3-27)
apps/web/src/components/settings/index.tsx (2)
apps/web/src/lib/types.ts (1)
  • SettingsTabs (32-37)
apps/web/src/lib/search-params.ts (1)
  • settingsQueryStateKeys (42-46)
apps/web/src/components/SideBar.tsx (1)
apps/web/src/components/NotificationsSideSection.tsx (1)
  • NotificationsSideSection (6-27)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Web E2E Tests
🔇 Additional comments (8)
apps/web/src/components/CompaniesList.tsx (1)

12-12: LGTM—straightforward component replacement.

The replacement of SponsorSideSection with NotificationsSideSection is clean and aligns with the PR's objective to introduce notification subscription UI.

Also applies to: 92-92

apps/web/src/components/NotificationsSideSection.tsx (1)

6-27: LGTM—clean implementation with good enum usage.

The component properly uses the SettingsTab.NOTIFICATIONS enum for type-safe URL construction, and the prefetch prop on the Link component is appropriate for this navigation pattern.

apps/web/src/components/SideBar.tsx (2)

1-1: LGTM—consistent component replacement.

The replacement of SponsorSideSection with NotificationsSideSection is consistent with changes in other files.

Also applies to: 12-12


6-6: Confirm whether categoryOptions addition aligns with PR scope.

The categoryOptions prop is correctly implemented: it's properly defined in SideBar.tsx's type definition, passed through to SearchSideBar, and actively used to populate the category filter dropdown. The implementation mirrors locationOptions exactly. However, the core concern remains valid—verify that adding category filtering support to the search sidebar aligns with this PR's stated objective of "notifications url params and visibility," or whether this should be separated into a distinct PR.

apps/web/src/lib/search-params.ts (2)

16-23: LGTM—well-structured enum and defaults.

The SettingsTab enum with lowercase values is appropriate for URL parameters, and the defaultSettings object provides a sensible starting point.


41-52: LGTM—consistent with existing search params pattern.

The settings query state infrastructure (keys, loader, cache) follows the same pattern as the existing searchParamsQueryStateKeys, ensuring consistency across the codebase. The use of parseAsStringEnum with Object.values(SettingsTab) provides type-safe validation.

apps/web/src/components/settings/index.tsx (1)

24-26: LGTM—good use of query state for controlled tabs.

The useQueryStates hook properly syncs tab state with URL parameters, and the scroll: true option provides good UX by scrolling to the top when tabs change.

apps/web/src/lib/types.ts (1)

1-1: Review comment is incorrect.

The changes do not represent a "renaming from SettingsTab to SettingsTabs." These are two distinct, complementary entities that coexist:

  • SettingsTab (enum in search-params.ts) provides the enum values (ACCOUNT, NOTIFICATIONS)
  • SettingsTabs (type in types.ts) defines the tab object structure with an id field typed as SettingsTab

The consuming code correctly uses both—the array is typed as SettingsTabs[], tab values reference SettingsTab.ACCOUNT and SettingsTab.NOTIFICATIONS, and type casts use the enum. This is not a breaking change requiring widespread refactoring.

Likely an incorrect or invalid review comment.

- Wrapped the Settings component in Suspense for improved loading behavior.
- Updated notification label for clarity in NotificationSettings component.
Copy link

@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

🧹 Nitpick comments (1)
apps/web/src/app/settings/page.tsx (1)

8-10: Consider adding a loading fallback for better UX.

The empty string fallback in Suspense will result in a blank screen while the Settings component is loading. Consider providing a loading skeleton or spinner to improve the user experience.

For example:

-    <Suspense fallback="">
+    <Suspense fallback={<div className="container mx-auto max-w-2xl p-6"><Skeleton className="h-40 w-full" /></div>}>
      <Settings />
    </Suspense>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 592eea9 and a26c5c0.

📒 Files selected for processing (2)
  • apps/web/src/app/settings/page.tsx (1 hunks)
  • apps/web/src/components/settings/notification/NotificationSettings.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/web/src/app/settings/page.tsx (1)
apps/web/src/components/settings/index.tsx (1)
  • Settings (23-62)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Web E2E Tests
🔇 Additional comments (1)
apps/web/src/components/settings/notification/NotificationSettings.tsx (1)

15-15: Verify the label change aligns with notification behavior.

The removal of "weekly" from the notification label suggests a change in email frequency or a shift to a more generic description. Please confirm that this updated text accurately reflects the actual notification behavior.

@alexmarqs alexmarqs merged commit 7ed98e2 into main Nov 15, 2025
3 checks passed
@alexmarqs alexmarqs deleted the chore/notifications-url-params-and-visibility branch December 5, 2025 00:09
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