Skip to content

fix: sans-serif inputs + Cmd+K capture phase#72

Merged
aaditagrawal merged 2 commits intomainfrom
fix/font-and-project-picker
Apr 19, 2026
Merged

fix: sans-serif inputs + Cmd+K capture phase#72
aaditagrawal merged 2 commits intomainfrom
fix/font-and-project-picker

Conversation

@aaditagrawal
Copy link
Copy Markdown
Owner

@aaditagrawal aaditagrawal commented Apr 19, 2026

Font rendering

The upstream sync collapsed a CSS rule in `apps/web/src/index.css` into applying Geist Mono to every `` element — the command palette search bar, model picker trait inputs, settings binary/server URL fields, etc. all rendered in monospace. Pre-sync, the rule was scoped to code-focused elements.

Fix: narrow the selector back to `pre, code`. Inputs now inherit the body's DM Sans. Textareas fall back to the body font too, which is the right default; code-editor textareas can opt in via a className when needed.

Cmd+K shortcut

The `commandPalette.toggle` keydown listener in `CommandPalette.tsx` was attached in bubble phase. xterm (terminal focus), a contenteditable composer, or any other component with a `keydown` handler could swallow Cmd+K before it reached the window.

Fix: attach the listener with `{ capture: true }`. Matches upstream's CTRL+J capture-phase fix for `terminal.toggle` (pingdotgg#2113 / pingdotgg#2142).

The project picker added by upstream pingdotgg#2024 (`Add filesystem browse API and command palette project picker`) already lives inside the command palette — this restores its accessibility via Cmd+K.

Test plan

  • `bun typecheck` clean (9/9 packages)
  • Manual: open the app, Cmd+K should toggle the palette from anywhere
  • Manual: search bar reads in DM Sans (not Geist Mono)
  • Manual: model picker / settings inputs read in DM Sans
  • Manual: code blocks (`
    `, ``) still use Geist Mono

Summary by CodeRabbit

  • Bug Fixes

    • Improved global keyboard shortcut handling so the command palette toggle is detected more reliably, even when descendant elements intercept key events.
  • Style

    • Restrained monospace styling to only code/preformatted text.
    • Explicitly set monospace typography for commit message and script command input fields so their content appears in a monospaced font.

## Font rendering
Pre-sync, the fork had only `pre, code, textarea, input` selectors
using Geist Mono when code/terminal context demanded it, but the recent
sync collapsed all four into a single rule that applied the monospace
stack to *every* <input> in the app. The command palette search, model
picker trait inputs, settings binary/server URL fields, etc. all rendered
in Geist Mono, which is what produced the 'broken font' look.

Narrow the rule back to `pre, code` (and `textarea` in code-focused
contexts inherits naturally). Regular inputs now use the body font
(DM Sans).

## Cmd+K shortcut
The commandPalette.toggle keydown handler in CommandPalette.tsx used
the bubble phase, which means xterm (when terminal has focus) or a
contenteditable composer could swallow Cmd+K before it reached the
window listener. Switch the listener to capture phase — matches
upstream's CTRL+J fix for terminal.toggle (pingdotgg#2113). The project picker
already lives inside the command palette (filesystem browse API +
command-palette project picker from pingdotgg#2024); this restores access to it
via the shortcut.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ada3de6e-13ed-429a-b3d6-732d42c4d4a8

📥 Commits

Reviewing files that changed from the base of the PR and between bc814b2 and fa82fbc.

📒 Files selected for processing (2)
  • apps/web/src/components/GitActionsControl.tsx
  • apps/web/src/components/ProjectScriptsControl.tsx
✅ Files skipped from review due to trivial changes (2)
  • apps/web/src/components/ProjectScriptsControl.tsx
  • apps/web/src/components/GitActionsControl.tsx

📝 Walkthrough

Walkthrough

CommandPalette registers its global keydown listener in the capture phase; index.css restricts the monospace font rule to pre and code; two textarea inputs were given a font-mono class to render in monospace.

Changes

Cohort / File(s) Summary
Keyboard Event Handling
apps/web/src/components/CommandPalette.tsx
Changed global keyboard shortcut listener to register/remove in the event capture phase (addEventListener("keydown", handler, true) / removeEventListener(..., true)) so the palette toggle is detected before descendant handlers.
CSS Font Styling
apps/web/src/index.css
Narrowed monospace font-family selector from pre, code, textarea, input to only pre, code, so input/textarea no longer inherit that rule.
Monospace Inputs
apps/web/src/components/GitActionsControl.tsx, apps/web/src/components/ProjectScriptsControl.tsx
Added className="font-mono" to Textarea components to explicitly render those inputs in a monospace font.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I listened in capture, caught keys on the fly,
Codes snug in pre and code, inputs left to try,
Two textareas donned their mono attire,
A palette that hears before sparks meet the wire. 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: sans-serif inputs + Cmd+K capture phase' clearly and concisely summarizes the two main changes in the PR: fixing font rendering for inputs and fixing the Cmd+K shortcut handling.
Description check ✅ Passed The PR description includes all key template sections: clear explanation of what changed (font rendering and Cmd+K shortcut), why (upstream sync issues and event handler interception), and a comprehensive test plan with specific manual checks.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/font-and-project-picker

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 effective changed lines (test files excluded in mixed PRs). labels Apr 19, 2026
Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/web/src/index.css`:
- Around line 179-183: The global CSS change removed textarea from the monospace
rule so code-like textareas now render in the wrong font; update the Textarea
instances to explicitly use the monospace utility by adding
className="font-mono" to the script-command Textarea in
ProjectScriptsControl.tsx (the textarea used for the script command input) and
to the commit message Textarea in GitActionsControl.tsx (the textarea used for
commit messages) so they render in monospace regardless of global rules.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f848c841-c7b2-4436-8016-4eda137fbfed

📥 Commits

Reviewing files that changed from the base of the PR and between b0bcd1e and bc814b2.

📒 Files selected for processing (2)
  • apps/web/src/components/CommandPalette.tsx
  • apps/web/src/index.css

Comment thread apps/web/src/index.css
Comment on lines 179 to 183
pre,
code,
textarea,
input {
code {
font-family:
"Geist Mono", "SF Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find textareas in the web app and check whether they apply a monospace font class/style.
fd -e tsx -e ts . apps/web/src --exec rg -nP -C2 '<textarea\b|Textarea\b' {} \;
# Highlight any that reference font-mono / Geist Mono / var(--font-mono)
rg -nP --type=ts --type=tsx 'font-mono|Geist Mono|var\(--font-mono\)' apps/web/src

Repository: aaditagrawal/t3code

Length of output: 2650


🏁 Script executed:

# First, find and read the Textarea component definition
find apps/web/src -name "textarea*" -type f | head -10

Repository: aaditagrawal/t3code

Length of output: 102


🏁 Script executed:

# Search with correct file type handling (no tsx file type needed for rg)
rg 'font-mono|Geist Mono|font-family.*monospace' apps/web/src --type=ts -A 2 -B 2

Repository: aaditagrawal/t3code

Length of output: 8033


🏁 Script executed:

# Look for Textarea component definition
rg -A 15 'function Textarea\(' apps/web/src

Repository: aaditagrawal/t3code

Length of output: 1942


🏁 Script executed:

# Search in CSS/style files for monospace font definitions related to textareas or inputs
find apps/web/src -name "*.css" -o -name "*.scss" | xargs grep -l 'textarea\|input' 2>/dev/null

Repository: aaditagrawal/t3code

Length of output: 85


🏁 Script executed:

# Read the exact CSS lines mentioned in the review
sed -n '170,190p' apps/web/src/index.css

Repository: aaditagrawal/t3code

Length of output: 748


🏁 Script executed:

# Read the full Textarea component
cat -n apps/web/src/components/ui/textarea.tsx

Repository: aaditagrawal/t3code

Length of output: 2562


🏁 Script executed:

# Check specific textarea usages: script command (project-dialog) and commit message (thread-view)
rg -B 3 -A 3 'script-command|dialogCommitMessage' apps/web/src

Repository: aaditagrawal/t3code

Length of output: 3424


🏁 Script executed:

# Check if the specific script-command and commit message textareas have any monospace styling
rg -B 5 -A 8 'id="script-command"' apps/web/src

Repository: aaditagrawal/t3code

Length of output: 1381


🏁 Script executed:

# Check the commit message textarea more thoroughly
rg -B 10 -A 10 'placeholder="Leave empty to auto-generate"' apps/web/src

Repository: aaditagrawal/t3code

Length of output: 1731


🏁 Script executed:

# Search for any className containing font-mono applied to Textarea components
rg -B 2 -A 8 '<Textarea' apps/web/src --type=ts

Repository: aaditagrawal/t3code

Length of output: 3708


Critical: Textareas lack explicit monospace styling after global rule removal.

The CSS change correctly narrows the selector to pre, code, but verification shows that code-related <textarea> elements (script commands in ProjectScriptsControl.tsx and commit messages in GitActionsControl.tsx) do not have explicit monospace font classes applied. These textareas will now render in DM Sans instead of monospace, degrading readability of code-like content.

Add className="font-mono" to:

  • <Textarea> in ProjectScriptsControl.tsx (script-command textarea)
  • <Textarea> in GitActionsControl.tsx (commit message textarea)
🧰 Tools
🪛 Stylelint (17.7.0)

[error] 182-182: Expected no quotes around "SFMono-Regular" (font-family-name-quotes)

(font-family-name-quotes)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/index.css` around lines 179 - 183, The global CSS change removed
textarea from the monospace rule so code-like textareas now render in the wrong
font; update the Textarea instances to explicitly use the monospace utility by
adding className="font-mono" to the script-command Textarea in
ProjectScriptsControl.tsx (the textarea used for the script command input) and
to the commit message Textarea in GitActionsControl.tsx (the textarea used for
commit messages) so they render in monospace regardless of global rules.

CodeRabbit flagged on #72 that two textareas hold code-like content:
- script-command in ProjectScriptsControl.tsx
- commit-message dialog in GitActionsControl.tsx

After narrowing the global `textarea` monospace rule, both would have
rendered in DM Sans. Add explicit `className="font-mono"` so they keep
the Geist Mono readability regardless of the global rule.
@aaditagrawal aaditagrawal merged commit 52e015c into main Apr 19, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant