Skip to content

fix: build on stable toolchain and expose buffer font zoom - #3

Merged
soyboyscout merged 2 commits into
mainfrom
cherrypick/ui-polish
Jun 28, 2026
Merged

soyboyscout merged 2 commits into
mainfrom
cherrypick/ui-polish

Conversation

@ps49developer

@ps49developer ps49developer commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by cubic

Build now works on stable Rust by removing nightly-only macros/hints, and buffer font zoom is now controllable from the UI via theme_settings.

  • New Features

    • Re-exported adjust_buffer_font_size in theme_settings so the UI can zoom buffer fonts.
  • Refactors

    • Replaced cfg_select! with #[cfg] in telemetry OS detection and WASI SDK asset selection; added a stable cold_path() in gpui and updated profiler and action timing code to use it instead of std::hint::cold_path.

Written for commit cdfe93e. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Improved OS version detection across platforms, with more reliable reporting and clearer fallback behavior when system details are unavailable.
    • Fixed platform-specific asset selection to ensure the correct extension package is chosen more consistently.
  • Refactor / Performance

    • Reduced unnecessary profiling overhead on non-profiling paths by using an internal cold-path hint for early exits.
  • API Changes

    • Re-exported adjust_buffer_font_size in theme settings, making it available as part of the module’s public surface.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matterai-app

matterai-app Bot commented Jun 26, 2026

Copy link
Copy Markdown

Caution

PR Summary Skipped - Monthly Quota Exceeded

PR summary skipped as you have reached the free tier limit of 50 PR summaries per month. Please upgrade to a paid plan for MatterAI.

Current Plan: Free Tier
Free Tier Limit: 25 PR Summaries per month
Current Usage: 25 PR Summaries
Resets in: 4 days

Upgrade your plan on the console here: https://app.matterai.so/ai-code-reviews?tab=Billing

@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c937297-7b1c-4c89-ad89-4eed917c7932

📥 Commits

Reviewing files that changed from the base of the PR and between 8721d96 and cdfe93e.

📒 Files selected for processing (2)
  • crates/client/src/telemetry.rs
  • crates/gpui/src/profiler.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/gpui/src/profiler.rs
  • crates/client/src/telemetry.rs

📝 Walkthrough

Walkthrough

This PR replaces cfg_select! in two platform-specific paths, adds a crate-local cold_path() helper in profiler code and updates its call sites, and makes adjust_buffer_font_size publicly re-exported from theme_settings.

Changes

Platform cfg selection

Layer / File(s) Summary
Telemetry OS version branches
crates/client/src/telemetry.rs
os_version() uses explicit #[cfg] branches for test-support, macOS, Linux/FreeBSD, and Windows handling.
WASI SDK asset selection
crates/extension/src/extension_builder.rs
WASI_SDK_ASSET_NAME uses explicit #[cfg] branches for supported platform and architecture combinations with a guarded fallback.

Profiler cold-path helper

Layer / File(s) Summary
Profiler helper
crates/gpui/src/profiler.rs
cold_path() is added in profiler.rs as a crate-local replacement for std::hint::cold_path().
Profiler call sites
crates/gpui/src/profiler.rs, crates/gpui/src/profiler/actions.rs
Profiler timing branches in profiler.rs and profiler/actions.rs call cold_path() instead of std::hint::cold_path().

Theme settings re-export

Layer / File(s) Summary
Public helper re-export
crates/theme_settings/src/theme_settings.rs
adjust_buffer_font_size is included in the module’s pub use crate::settings::{...} list.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit hopped through cfgs so neat,
With profiler trails and tiny feet.
A helper glowed, a setting spread,
And moonlit branches softly bled.
Thump-thump! 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description summarizes the PR, but it omits the required Objective, Solution, Testing, Checklist, and Release Notes sections. Rewrite the description to follow the template with Objective, Solution, Testing, Self-Review Checklist, optional Showcase, and Release Notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main changes: stable-toolchain compatibility and buffer font zoom exposure.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cherrypick/ui-polish

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the unstable cfg_select! macro with standard #[cfg] blocks in telemetry.rs and extension_builder.rs, introduces a stable cold_path helper in profiler.rs to replace std::hint::cold_path, and cleans up imports in theme_settings.rs. The review feedback highlights two issues: first, os_version in telemetry.rs needs a fallback block to prevent compilation failures on unsupported platforms; second, the cold_path helper in profiler.rs should use #[inline(never)] instead of #[inline] to ensure the #[cold] optimization hint is not discarded by the compiler.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +179 to 193
#[cfg(all(not(feature = "test-support"), target_os = "windows"))]
{
let mut info = unsafe { std::mem::zeroed() };
let status = unsafe { windows::Wdk::System::SystemServices::RtlGetVersion(&mut info) };
if status.is_ok() {
semver::Version::new(
info.dwMajorVersion as _,
info.dwMinorVersion as _,
info.dwBuildNumber as _,
)
.to_string()
} else {
"unknown".to_string()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If the client crate is compiled on an unsupported platform (such as Android, iOS, or WebAssembly) without the test-support feature, none of the #[cfg] blocks will match. This will result in a compilation error because the function body of os_version will be empty and fail to return a String.

Adding a fallback block ensures the function compiles successfully on all platforms.

    #[cfg(all(not(feature = "test-support"), target_os = "windows"))]
    {
        let mut info = unsafe { std::mem::zeroed() };
        let status = unsafe { windows::Wdk::System::SystemServices::RtlGetVersion(&mut info) };
        if status.is_ok() {
            semver::Version::new(
                info.dwMajorVersion as _,
                info.dwMinorVersion as _,
                info.dwBuildNumber as _,
            )
            .to_string()
        } else {
            "unknown".to_string()
        }
    }
    #[cfg(not(any(
        feature = "test-support",
        target_os = "macos",
        target_os = "linux",
        target_os = "freebsd",
        target_os = "windows",
    )))]
    {
        "unknown".to_string()
    }

Comment on lines +27 to +29
#[cold]
#[inline]
pub(crate) fn cold_path() {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using #[inline] on a #[cold] function can cause the compiler to inline the empty function body {} directly into the caller. When this happens, the function call is eliminated, and the #[cold] attribute has no effect on the caller's branch prediction.

To ensure the compiler outlines the cold path and treats the branch as unlikely, the function should be marked with #[inline(never)] instead.

Suggested change
#[cold]
#[inline]
pub(crate) fn cold_path() {}
#[cold]
#[inline(never)]
pub(crate) fn cold_path() {}

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
crates/gpui/src/profiler.rs (1)

23-29: 🚀 Performance & Scalability | 🔵 Trivial

#[inline] risks eliminating the call site required for #[cold] branch hints.

Combining #[inline] with #[cold] is contradictory for this utility. The #[cold] attribute relies on the function call remaining to signal to LLVM that the path is unlikely. #[inline] encourages the optimizer to merge the function body into the caller, which, especially for an empty function, will likely strip the call entirely and nullify the branch-weight hint. Remove #[inline] to ensure the call site persists.

♻️ Proposed change
 #[cold]
-#[inline]
 pub(crate) fn cold_path() {}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/gpui/src/profiler.rs` around lines 23 - 29, The `cold_path` utility in
`profiler.rs` combines `#[cold]` with `#[inline]`, which can let the optimizer
inline away the call site and defeat the branch hint. Remove the `#[inline]`
attribute from `cold_path` so the call remains visible to LLVM while keeping the
function as the stable stand-in for `std::hint::cold_path`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/gpui/src/profiler.rs`:
- Around line 23-29: The `cold_path` utility in `profiler.rs` combines `#[cold]`
with `#[inline]`, which can let the optimizer inline away the call site and
defeat the branch hint. Remove the `#[inline]` attribute from `cold_path` so the
call remains visible to LLVM while keeping the function as the stable stand-in
for `std::hint::cold_path`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc490c83-d876-482a-abc5-200dade0cd54

📥 Commits

Reviewing files that changed from the base of the PR and between 026219c and 8721d96.

📒 Files selected for processing (5)
  • crates/client/src/telemetry.rs
  • crates/extension/src/extension_builder.rs
  • crates/gpui/src/profiler.rs
  • crates/gpui/src/profiler/actions.rs
  • crates/theme_settings/src/theme_settings.rs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Re-trigger cubic

@matterai-app

matterai-app Bot commented Jun 27, 2026

Copy link
Copy Markdown

Caution

PR Summary Skipped - Monthly Quota Exceeded

PR summary skipped as you have reached the free tier limit of 50 PR summaries per month. Please upgrade to a paid plan for MatterAI.

Current Plan: Free Tier
Free Tier Limit: 25 PR Summaries per month
Current Usage: 25 PR Summaries
Resets in: 3 days

Upgrade your plan on the console here: https://app.matterai.so/ai-code-reviews?tab=Billing

@soyboyscout
soyboyscout merged commit 76f7ba3 into main Jun 28, 2026
39 of 41 checks passed
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