Skip to content

Fix sidebar bg: add missing locale entries and portal resync - #2622

Merged
lawrencecchen merged 2 commits into
mainfrom
fix-sidebar-bg-followup
Apr 6, 2026
Merged

lawrencecchen merged 2 commits into
mainfrom
fix-sidebar-bg-followup

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add English fallback locale entries for all 17 supported languages on the two matchTerminalBackground localization keys (previously only en+ja were present)
  • Schedule portal geometry resync when toggling "Match Terminal Background" with withinWindow blend mode, preventing misaligned terminal/browser portals

Follow-up to #2293, addressing review feedback from Greptile and CodeRabbit.

Test plan

  • Toggle "Match Terminal Background" in Settings > Sidebar Appearance with withinWindow blend mode active, verify portals stay aligned
  • Verify no missing-translation warnings in non-English locales for the new sidebar setting

Summary by cubic

Prevents portal misalignment when toggling “Match Terminal Background” by resyncing geometry for the within-window blend mode. Adds English fallback strings for the setting and its tooltip across all locales to remove missing-translation warnings.

  • Bug Fixes
    • Resync portal geometry on toggle when the sidebar is visible and within-window blend mode is active to keep portals aligned.
    • Add English fallback entries for “Match Terminal Background” and its description in 17 locales to eliminate missing-translation warnings.

Written for commit 65cd8d8. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added "Match Terminal Background" setting to synchronize sidebar appearance with terminal colors and transparency.
  • Improvements

    • Sidebar synchronization now occurs more selectively when relevant visibility and blend conditions are met.
  • Localization

    • Added translations for 16 languages (Arabic, Bosnian, Danish, German, Spanish, French, Italian, Korean, Norwegian, Polish, Brazilian Portuguese, Russian, Thai, Turkish, Ukrainian, Simplified & Traditional Chinese).

Add English fallback locale entries for all supported languages on the
two new matchTerminalBackground keys. Schedule portal geometry resync
when the toggle changes to prevent misaligned portals with withinWindow
blend mode.
@vercel

vercel Bot commented Apr 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Apr 6, 2026 8:54am

@coderabbitai

coderabbitai Bot commented Apr 6, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0ac028c4-96e4-45c3-8a9d-6883ae0d4809

📥 Commits

Reviewing files that changed from the base of the PR and between e8603fe and 65cd8d8.

📒 Files selected for processing (1)
  • Sources/ContentView.swift
✅ Files skipped from review due to trivial changes (1)
  • Sources/ContentView.swift

📝 Walkthrough

Walkthrough

Adds localized strings for a "Match Terminal Background" feature across multiple languages and an onChange handler in ContentView.swift that schedules terminal-portal geometry synchronization when the sidebar background-matching setting changes.

Changes

Cohort / File(s) Summary
Localization Strings
Resources/Localizable.xcstrings
Added ~204 lines: new stringUnit entries for two keys ("Match Terminal Background" and "Use the same background color and transparency as the terminal.") across 17 locales (ar, bs, da, de, es, fr, it, ko, nb, pl, pt-BR, ru, th, tr, uk, zh-Hans, zh-Hant), all marked needs_review.
UI Behavior
Sources/ContentView.swift
Added an onChange handler for sidebarMatchTerminalBackground that, when the sidebar is visible and blend mode is withinWindow, schedules external terminal portal geometry synchronization for the current window (or all windows if no observed window).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ContentView
    participant SidebarState
    participant TerminalWindowPortalRegistry
    participant Window(s)

    User->>ContentView: toggle sidebarMatchTerminalBackground
    ContentView->>SidebarState: read isVisible & blendMode
    SidebarState-->>ContentView: visible / blendMode value
    alt visible && blendMode == withinWindow
        ContentView->>TerminalWindowPortalRegistry: scheduleExternalGeometrySynchronize(for observedWindow or all)
        TerminalWindowPortalRegistry->>Window(s): apply geometry synchronization
    else
        ContentView-->>TerminalWindowPortalRegistry: no scheduling
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped through strings in seventeen ways,
I nudged a toggle, sent syncs to play,
When sidebar and blend find matching light,
Windows line up tidy, colors right,
A tiny rabbit cheers — hop, hurray! 🎨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: adding missing locale entries for sidebar background strings and scheduling portal geometry resync.
Description check ✅ Passed The description covers the summary and test plan from the template, but is missing the Demo Video section and incomplete Checklist with all items unchecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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-sidebar-bg-followup

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.

@cubic-dev-ai

cubic-dev-ai Bot commented Apr 6, 2026

Copy link
Copy Markdown

This review could not be run because your cubic account has exceeded the monthly review limit. If you need help restoring access, please contact contact@cubic.dev.

@greptile-apps

greptile-apps Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR is a follow-up to #2293, adding English fallback locale entries for all 17 non-ja locales on the two matchTerminalBackground xcstrings keys, and scheduling a portal geometry resync when "Match Terminal Background" is toggled while withinWindow blend mode is active.

Confidence Score: 5/5

Safe to merge — no correctness issues found.

Both changes are narrow and correct: the onChange guard exactly mirrors the useWithinWindow predicate in contentAndSidebarLayout, and the xcstrings fallbacks use the standard needs_review pattern. No P0/P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
Sources/ContentView.swift Adds onChange handler for sidebarMatchTerminalBackground that schedules portal geometry resync; guard conditions correctly mirror the useWithinWindow layout-switch predicate.
Resources/Localizable.xcstrings Adds English fallback entries (needs_review state) for 17 non-en/ja locales on both matchTerminalBackground keys, following xcstrings conventions.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User toggles Match Terminal Background] --> B{sidebarState.isVisible?}
    B -- No --> Z[return - no-op]
    B -- Yes --> C{sidebarBlendMode == withinWindow?}
    C -- No --> Z
    C -- Yes --> D{observedWindow set?}
    D -- Yes --> E[scheduleExternalGeometrySynchronize for window]
    D -- No --> F[scheduleExternalGeometrySynchronizeForAllWindows]
    E --> G[Portals re-aligned]
    F --> G
Loading

Reviews (1): Last reviewed commit: "fix: add missing locale entries and port..." | Re-trigger Greptile

@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)
Resources/Localizable.xcstrings (1)

83713-83813: Change fallback-state entries to match the catalog convention ("translated").

All newly added non-English entries for these two keys are set to "state": "needs_review", but the established pattern in Resources/Localizable.xcstrings is to use "state": "translated" for English-fallback values in lower-confidence locales. This convention keeps localization tooling expectations consistent and prevents spurious missing-translation warnings.

Change to apply for all newly added locale entries (lines 83715, 83832, and repeated for each locale)
-            "state": "needs_review",
+            "state": "translated",

Also applies to: 83832–83932

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

In `@Resources/Localizable.xcstrings` around lines 83713 - 83813, Update all
non-English locale entries added for the "Match Terminal Background" string (the
JSON blocks where "value": "Match Terminal Background") by changing each
"stringUnit"."state" from "needs_review" to "translated" so they follow the
repository's English-fallback convention and avoid spurious missing-translation
warnings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Resources/Localizable.xcstrings`:
- Around line 83713-83813: Update all non-English locale entries added for the
"Match Terminal Background" string (the JSON blocks where "value": "Match
Terminal Background") by changing each "stringUnit"."state" from "needs_review"
to "translated" so they follow the repository's English-fallback convention and
avoid spurious missing-translation warnings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7a679eb3-aade-4b20-a731-8ad438d2c197

📥 Commits

Reviewing files that changed from the base of the PR and between de3e34b and e8603fe.

📒 Files selected for processing (2)
  • Resources/Localizable.xcstrings
  • Sources/ContentView.swift

@lawrencecchen
lawrencecchen merged commit d4ff28d into main Apr 6, 2026
16 checks passed
@lawrencecchen
lawrencecchen deleted the fix-sidebar-bg-followup branch April 6, 2026 09:05

This branch was successfully deployed

1 active deployment
Preview — 65cd8d87 Deployed Apr 6, 2026 by vercel[bot]
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