Skip to content

Conversation

@NobbZ
Copy link
Owner

@NobbZ NobbZ commented Apr 6, 2025

Summary by CodeRabbit

  • New Features
    • Integrated enhanced graphical interface support that dynamically loads additional configuration when using the GUI.
    • Introduced refined UI improvements, including a default font update and new key mappings for adjusting display scaling.
    • Expanded the development environment to seamlessly include the new graphical interface package, neovide.
    • Added a new package for neovide to the package management system.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 6, 2025

📝 Walkthrough

Walkthrough

This pull request integrates Neovide support into the project. A new package for Neovide is declared in the flake along with its dedicated Nix expression that uses the wrapper-manager to create a Neovide wrapper. The development shell is updated to inherit Neovide alongside Neovim. Additionally, Lua configuration files are enhanced: a conditional in the init file detects the Neovide environment to load a dedicated module, and a new Lua script configures GUI settings, scaling factors, and key mappings for Neovide.

Changes

File(s) Change Summary
flake.nix, nvide.nix - Added new package neovide via pkgs.callPackage ./nvide.nix {inherit self' inputs;};
- Updated devShells.default to inherit neovim neovide
- Added wrapper-manager input
plugins/nobbz/lua/nobbz/init.lua, plugins/nobbz/lua/nobbz/neovide.lua - Added a conditional check in init.lua to load the Neovide module when vim.g.neovide is set
- Introduced a new Lua script that sets the GUI font, initializes scaling factors, and defines key mappings for scaling

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant FS as flake.nix
    participant NV as Neovide Wrapper (nvide.nix)
    participant PL as Plugin Loader (init.lua)
    participant NP as Neovide Module (neovide.lua)
    participant User as User

    Dev->>FS: Start devShell (includes neovim, neovide)
    FS->>NV: Invoke callPackage for Neovide wrapper
    NV->>PL: Provide Neovide configuration details
    PL->>PL: Check if vim.g.neovide is set
    PL->>NP: Conditionally require "neovide" module
    NP->>NP: Set GUI font & initialize scaling factors and keymaps
    User->>NP: Press <C-+> or <C--> keys
    NP->>NP: Execute scale_up or scale_down functions
Loading

Poem

I'm a bouncing bunny in the coding lair,
Hoping through packages with speed and flair,
Neovide joins with a wrapper so neat,
Lua dances with fonts and keys in tweet,
With each small change my heart does race –
CodeRabbit leaps with joy in this vibrant space!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cdc5d5a and 8093391.

📒 Files selected for processing (1)
  • flake.nix (3 hunks)
🔇 Additional comments (4)
flake.nix (4)

30-30: New package added: neovide

This line adds Neovide (a graphical Neovim client) as a package, making it available from the flake. The implementation correctly follows the same pattern as the existing Neovim package.


31-35: Good use of symlinkJoin for package composition

Using symlinkJoin to combine Neovim and Neovide into a single package is a good Nix practice. The configuration maintains the Neovim name and main program while making both tools available as part of the default package.


45-45: Development shell now includes both Neovim and Neovide

The development shell has been updated to include both Neovim and Neovide, which ensures consistent access to both tools during development.


73-74:

Details

✅ Verification successful

Properly configured wrapper-manager dependency

The wrapper-manager input is correctly added with proper follows directives for nixpkgs, ensuring version consistency across dependencies.


🏁 Script executed:

#!/bin/bash
# Verify if nvide.nix exists and uses wrapper-manager
if [ -f ./nvide.nix ]; then
  echo "nvide.nix exists"
  grep -A 10 "wrapper-manager" ./nvide.nix || echo "wrapper-manager not found in nvide.nix"
else
  echo "nvide.nix does not exist"
fi

Length of output: 342


Wrapper-manager dependency configuration verified

The flake.nix addition with

wrapper-manager.url = "github:viperml/wrapper-manager";
wrapper-manager.inputs.nixpkgs.follows = "nixpkgs";

is confirmed to be correctly applied. Additionally, the usage of inputs.wrapper-manager.lib in nvide.nix verifies that the dependency is properly integrated, ensuring version consistency for nixpkgs.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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
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: 0

🧹 Nitpick comments (2)
nvide.nix (1)

1-20: Well-structured Nix wrapper for Neovide

This is a clean implementation using wrapper-manager to properly configure Neovide with the correct Neovim binary. The use of lib.getExe to get the executable path is a good practice.

Consider adding a brief comment explaining what the .config.build.packages.neovide chain does for developers who might not be familiar with the wrapper-manager pattern.

+# Use wrapper-manager to create a Neovide wrapper that uses our configured Neovim
 (inputs.wrapper-manager.lib {
   inherit pkgs;
   modules = [
     {
       wrappers.neovide.basePackage = neovide;
       wrappers.neovide.flags = ["--neovim-bin" (lib.getExe self'.packages.neovim) "--fork"];
     }
   ];
 })
 .config
 .build
 .packages
 .neovide
plugins/nobbz/lua/nobbz/neovide.lua (1)

1-2: Consider making font settings more configurable

The font setting is hardcoded. For better maintainability, consider extracting the font name and size into variables at the top of the file.

-vim.o.guifont = "Departure Mono:11"
+local font_name = "Departure Mono"
+local font_size = 11
+vim.o.guifont = font_name .. ":" .. font_size
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cfdcc9 and cdc5d5a.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • flake.nix (3 hunks)
  • nvide.nix (1 hunks)
  • plugins/nobbz/lua/nobbz/init.lua (1 hunks)
  • plugins/nobbz/lua/nobbz/neovide.lua (1 hunks)
🔇 Additional comments (7)
plugins/nobbz/lua/nobbz/init.lua (1)

56-56: Clean implementation of conditional Neovide module loading

This is a good approach to selectively load the Neovide configuration only when running in the Neovide environment. The code follows the established pattern for module loading in this file and is placed at a logical position in the initialization sequence.

plugins/nobbz/lua/nobbz/neovide.lua (3)

3-3: Initial scale factor might be too small

The initial scale factor of 0.6 is significantly smaller than the default (1.0). This might make the interface appear too small, especially on high-resolution displays.

Consider testing with a value closer to 1.0 (perhaps 0.9 or 1.0) or making this configurable through a user setting.


5-17: Good scaling implementation

The scaling mechanism is well-implemented with proportional changes using multiplication/division, which ensures consistent scaling behavior regardless of the current scale.


19-22: Clear key mappings for scaling

The key mappings for scaling are clear and intuitive. Using Which-Key with descriptions ensures these functions are discoverable.

flake.nix (3)

30-30: Clean package declaration for Neovide

This package declaration properly calls the nvide.nix file with the necessary context.


41-41: Good integration of Neovide into the development shell

Adding Neovide to the development shell makes it easily accessible alongside Neovim.


69-71: Properly structured dependency for wrapper-manager

The wrapper-manager input is correctly added with the "follows" directive to ensure consistent nixpkgs usage across the project.

@NobbZ NobbZ merged commit 846a283 into main Apr 6, 2025
1 check passed
@NobbZ NobbZ deleted the neovide branch April 6, 2025 10:46
@coderabbitai coderabbitai bot mentioned this pull request Oct 3, 2025
@coderabbitai coderabbitai bot mentioned this pull request Nov 16, 2025
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