Skip to content

Remove unused navigation utility #1152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ComputelessComputer
Copy link
Collaborator

The changes remove the safeNavigate utility function from the @hypr/utils/navigation module, as it is no longer being used in the codebase. This simplifies the codebase and removes unnecessary code.

The changes also update the event and note card components to use the windowsCommands.windowShow and windowsCommands.windowEmitNavigate functions directly, instead of relying on the safeNavigate utility.

Copy link

coderabbitai bot commented Jul 14, 2025

Warning

Rate limit exceeded

@ComputelessComputer has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 175976e and 5469da7.

📒 Files selected for processing (6)
  • apps/desktop/src/components/left-sidebar/events-list.tsx (1 hunks)
  • apps/desktop/src/components/left-sidebar/notes-list.tsx (1 hunks)
  • apps/desktop/src/components/workspace-calendar/event-card.tsx (3 hunks)
  • apps/desktop/src/components/workspace-calendar/note-card.tsx (2 hunks)
  • packages/utils/src/index.ts (0 hunks)
  • packages/utils/src/navigation.ts (0 hunks)
📝 Walkthrough

Walkthrough

The changes remove the safeNavigate navigation utility and its usages across several components. Navigation is now handled directly by calling windowsCommands.windowShow to ensure the main window is visible, followed by windowsCommands.windowEmitNavigate to perform navigation. The safeNavigate implementation and its export from the utilities package have been deleted.

Changes

File(s) Change Summary
apps/desktop/src/components/left-sidebar/events-list.tsx,
.../notes-list.tsx
Removed safeNavigate usage; replaced navigation logic with explicit window show and emit navigate.
apps/desktop/src/components/workspace-calendar/event-card.tsx,
.../note-card.tsx
Refactored navigation to use windowsCommands.windowShow and windowEmitNavigate; removed safeNavigate.
packages/utils/src/index.ts Removed export of ./navigation.
packages/utils/src/navigation.ts Deleted file; removed safeNavigate utility implementation.

Sequence Diagram(s)

sequenceDiagram
    participant UI_Component as UI Component (e.g., EventItem, NoteCard)
    participant WindowsPlugin as windowsCommands
    participant MainWindow as Main Window

    UI_Component->>WindowsPlugin: windowShow({ type: "main" })
    WindowsPlugin-->>UI_Component: Promise resolved (window shown)
    UI_Component->>WindowsPlugin: windowEmitNavigate({ type: "main" }, url)
    WindowsPlugin->>MainWindow: Emit navigation event with URL
Loading
✨ 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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/desktop/src/components/left-sidebar/events-list.tsx (1)

130-130: Consider using the utilities format function for consistency.

This file uses format from date-fns directly, while notes-list.tsx uses format from @hypr/utils/datetime. The utilities version includes timezone handling which might be important for date formatting consistency across the app.

Consider updating the import and usage to match other components:

-import { format } from "date-fns";
+import { format } from "@hypr/utils/datetime";
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8bfe117 and 175976e.

📒 Files selected for processing (6)
  • apps/desktop/src/components/left-sidebar/events-list.tsx (1 hunks)
  • apps/desktop/src/components/left-sidebar/notes-list.tsx (1 hunks)
  • apps/desktop/src/components/workspace-calendar/event-card.tsx (3 hunks)
  • apps/desktop/src/components/workspace-calendar/note-card.tsx (2 hunks)
  • packages/utils/src/index.ts (0 hunks)
  • packages/utils/src/navigation.ts (0 hunks)
💤 Files with no reviewable changes (2)
  • packages/utils/src/index.ts
  • packages/utils/src/navigation.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

🧬 Code Graph Analysis (2)
apps/desktop/src/components/left-sidebar/events-list.tsx (1)
packages/utils/src/datetime.ts (1)
  • format (5-12)
apps/desktop/src/components/left-sidebar/notes-list.tsx (1)
packages/utils/src/datetime.ts (1)
  • format (5-12)
⏰ 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: ci (windows, windows-latest)
🔇 Additional comments (7)
apps/desktop/src/components/left-sidebar/notes-list.tsx (1)

237-243: Navigation refactor looks good!

The replacement of safeNavigate with the explicit two-step navigation process using windowsCommands.windowShow followed by windowsCommands.windowEmitNavigate ensures proper window management before navigation.

apps/desktop/src/components/left-sidebar/events-list.tsx (1)

133-136: Navigation refactor looks good!

The two-step navigation approach using windowsCommands is consistent with the broader refactoring effort.

apps/desktop/src/components/workspace-calendar/note-card.tsx (2)

11-11: Import change looks good.

The addition of windowsCommands import aligns with the navigation refactor.


65-68: Navigation refactor implemented correctly.

The two-step navigation process ensures the main window is shown before emitting the navigation event, which provides better window management control.

apps/desktop/src/components/workspace-calendar/event-card.tsx (3)

11-11: Import change looks good.

The addition of windowsCommands import supports the navigation refactor.


75-77: Navigation refactor for existing sessions implemented correctly.

The two-step navigation process for existing sessions ensures proper window management.


88-91: Navigation refactor for new sessions implemented correctly.

The two-step navigation process for creating new sessions also follows the same pattern, ensuring consistent behavior across both navigation paths.

The changes remove the `safeNavigate` utility function from the `@hypr/utils/navigation` module, as it is no longer being used in the codebase. This simplifies the codebase and removes unnecessary code.

The changes also update the event and note card components to use the `windowsCommands.windowShow` and `windowsCommands.windowEmitNavigate` functions directly, instead of relying on the `safeNavigate` utility.
@ComputelessComputer ComputelessComputer force-pushed the remove-unused-navigation-utility branch from 175976e to 5469da7 Compare July 14, 2025 07:30
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