Skip to content

feat/tab-aware-banner-conditions#2277

Merged
ComputelessComputer merged 4 commits intomainfrom
feat/tab-aware-banner-conditions
Dec 13, 2025
Merged

feat/tab-aware-banner-conditions#2277
ComputelessComputer merged 4 commits intomainfrom
feat/tab-aware-banner-conditions

Conversation

@ComputelessComputer
Copy link
Collaborator

Overview

  • Implemented tab-specific banner conditions for AI features
  • Added tab-aware banner visibility checks for AI services
  • Enhanced sidebar logic to manage AI tab state conditions

@netlify
Copy link

netlify bot commented Dec 13, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit d17bff4
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/693d7b6a7591b30009c470a1
😎 Deploy Preview https://deploy-preview-2277--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 13, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit d17bff4
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/693d7b6aa7be510008c5c7ef
😎 Deploy Preview https://deploy-preview-2277--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 13, 2025

📝 Walkthrough

Walkthrough

Detects AI-tab state in the sidebar, passes two boolean flags into the banner registry, and updates STT/LLM banner visibility, labels, and descriptions to account for whether the corresponding AI tab is active.

Changes

Cohort / File(s) Summary
Banner state detection & wiring
apps/desktop/src/components/main/sidebar/banner/index.tsx
Derives isAiTranscriptionTabActive and isAiIntelligenceTabActive from currentTab, adjusts openAiTab to call updateAiTabState or openNew, and passes the flags into createBannerRegistry (added to dependencies).
Banner registry & public API
apps/desktop/src/components/main/sidebar/banner/registry.tsx
BannerRegistryParams gains isAiTranscriptionTabActive and isAiIntelligenceTabActive; createBannerRegistry signature updated. "missing-stt" and "missing-llm" banners use JSX descriptions, updated primary action labels, and include new flags in visibility conditions.
Banner rendering
apps/desktop/src/components/main/sidebar/banner/component.tsx
Consolidated icon/title rendering into a single container (render icon if present, title only if present); description rendered in a generic div instead of a paragraph.
Types updated
apps/desktop/src/components/main/sidebar/banner/types.ts
BannerType.title made optional (title?: string); BannerType.description changed from string to ReactNode.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Verify all call sites of createBannerRegistry / BannerRegistryParams are updated and type-safe.
  • Check banner visibility logic for missing-stt and missing-llm (AND conditions including new flags).
  • Confirm hooks dependency arrays in index.tsx include the new values to prevent stale closures.
  • Review JSX description content for i18n and that existing consumers handle ReactNode descriptions.

Possibly related PRs

Suggested reviewers

  • yujonglee

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
Title check ✅ Passed The title 'feat/tab-aware-banner-conditions' accurately reflects the main change: implementing tab-aware conditions for banners, specifically for AI tab state visibility detection.
Description check ✅ Passed The description is directly related to the changeset, covering the implementation of tab-specific banner conditions for AI features and sidebar logic enhancements.
✨ 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 feat/tab-aware-banner-conditions

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8e05e4 and d17bff4.

📒 Files selected for processing (1)
  • apps/desktop/src/components/main/sidebar/banner/component.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/desktop/src/components/main/sidebar/banner/component.tsx
⏰ 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). (7)
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
  • GitHub Check: desktop_ci (linux, depot-ubuntu-24.04-8)
  • GitHub Check: desktop_ci (linux, depot-ubuntu-22.04-8)
  • GitHub Check: desktop_ci (macos, depot-macos-14)
  • GitHub Check: fmt
🔇 Additional comments (2)
apps/desktop/src/components/main/sidebar/banner/component.tsx (2)

36-45: LGTM! Header rendering now handles icon-only and mixed scenarios correctly.

The updated logic properly addresses the previous concern by:

  • Rendering the header container when either icon or title exists
  • Always displaying the icon when present (no longer tied to title)
  • Conditionally rendering the title only when provided

This allows banners to show icons without titles, which aligns with the tab-aware banner requirements.


47-47: LGTM! Description container now safely accommodates ReactNode content.

Changing from <p> to <div> prevents invalid HTML if future banner descriptions include block-level elements, which is essential now that banner.description is typed as ReactNode.


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
Contributor

@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

🧹 Nitpick comments (1)
apps/desktop/src/components/main/sidebar/banner/registry.tsx (1)

31-65: Banner suppression conditions look correct; consider whether title-less banners need an a11y label.

The updated conditions (!isAiTranscriptionTabActive / !isAiIntelligenceTabActive) match the intent. Since these banners now omit title, consider whether you want a consistent accessible “heading” (e.g., a visually-hidden title) for screen readers.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 063246f and a8e05e4.

📒 Files selected for processing (4)
  • apps/desktop/src/components/main/sidebar/banner/component.tsx (1 hunks)
  • apps/desktop/src/components/main/sidebar/banner/index.tsx (3 hunks)
  • apps/desktop/src/components/main/sidebar/banner/registry.tsx (3 hunks)
  • apps/desktop/src/components/main/sidebar/banner/types.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Agent communication should use defined message protocols and interfaces

Files:

  • apps/desktop/src/components/main/sidebar/banner/types.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, use cn (import from @hypr/utils). It is similar to clsx. Always pass an array and split by logical grouping.
Use motion/react instead of framer-motion.

Files:

  • apps/desktop/src/components/main/sidebar/banner/types.ts
  • apps/desktop/src/components/main/sidebar/banner/index.tsx
  • apps/desktop/src/components/main/sidebar/banner/registry.tsx
  • apps/desktop/src/components/main/sidebar/banner/component.tsx
⏰ 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). (7)
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
  • GitHub Check: fmt
  • GitHub Check: desktop_ci (linux, depot-ubuntu-22.04-8)
  • GitHub Check: desktop_ci (linux, depot-ubuntu-24.04-8)
  • GitHub Check: desktop_ci (macos, depot-macos-14)
🔇 Additional comments (4)
apps/desktop/src/components/main/sidebar/banner/index.tsx (2)

64-86: Memo dependencies/params update is correct.

You’re correctly threading isAiTranscriptionTabActive / isAiIntelligenceTabActive into createBannerRegistry and including them in the memo deps, so registry recalculates when the tab changes.


32-54: AI tab state wiring looks good; please confirm updateAiTabState call signature.

The derived booleans and “update existing AI tab vs open new AI tab” behavior match the PR goal. Main thing to double-check is that updateAiTabState(currentTab, { tab }) matches the zustand store’s intended API (object vs id).

#!/bin/bash
# Locate the zustand tab store types and the updateAiTabState signature + callsites.
rg -n --type=ts --type=tsx -C3 '\bupdateAiTabState\b' apps/desktop/src/components
rg -n --type=ts --type=tsx -C3 'updateAiTabState\s*\(' apps/desktop/src/components

# (Optional) locate the store definition
rg -n --type=ts --type=tsx -C3 'create\(\s*\(set,\s*get' apps/desktop/src/components/main/sidebar -S
apps/desktop/src/components/main/sidebar/banner/registry.tsx (1)

8-28: Param additions are straightforward and keep registry creation explicit.

No issues with adding the two booleans to BannerRegistryParams / createBannerRegistry—it keeps the banner logic deterministic and easy to reason about.

apps/desktop/src/components/main/sidebar/banner/types.ts (1)

8-16: No string-only assumptions found; type changes are correct.

The description field correctly accepts ReactNode across all usages—registry.tsx passes both JSX fragments and plain strings (both valid ReactNode), and component.tsx renders it safely in JSX (line 50). Making title optional is appropriate since banners conditionally render the heading block only when title exists (lines 36–48 in component.tsx).

@ComputelessComputer ComputelessComputer merged commit 2545475 into main Dec 13, 2025
16 checks passed
@ComputelessComputer ComputelessComputer deleted the feat/tab-aware-banner-conditions branch December 13, 2025 15:00
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