Skip to content

fix invalid titlebar color string format#1987

Open
tarik02 wants to merge 4 commits intopingdotgg:mainfrom
tarik02:fix/titlebar-color-string
Open

fix invalid titlebar color string format#1987
tarik02 wants to merge 4 commits intopingdotgg:mainfrom
tarik02:fix/titlebar-color-string

Conversation

@tarik02
Copy link
Copy Markdown
Contributor

@tarik02 tarik02 commented Apr 13, 2026

What Changed

Just changed titleBarOverlay to valid format.

Why

I was running debug electron build and noticed that it is crashing with any 8-digit color hex string. After further investigation I discovered that function used to parse color from titleBarOverlay does not support 8-digit hex strings: https://source.chromium.org/chromium/chromium/src/+/main:content/public/common/color_parser.h;l=16

But it supports rgba format, so we are good. It worked before because it couldn't parse failing back to default value from that struct (0, 0, 0, 0).

UI Changes

None.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Low risk: a single constant change to the desktop window titleBarOverlay color format to prevent crashes (notably on Linux) with no behavioral changes beyond titlebar rendering.

Overview
Fixes the desktop app’s window titleBarOverlay configuration by replacing the 8-digit hex TITLEBAR_COLOR value with an rgba(...) string, avoiding Chromium/Electron parsing issues (and crashes) while keeping the overlay effectively transparent (with a non-zero red channel to prevent Linux fallback).

Reviewed by Cursor Bugbot for commit 7462f30. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix invalid titlebar color string format in desktop app

Changes TITLEBAR_COLOR in main.ts from an 8-digit hex string (#01000000) to rgba(1,0,0,0), which is the correct format for the titlebar color API. The value uses 1 instead of 0 for the red channel because rgba(0,0,0,0) falls back to the default color on Linux.

Macroscope summarized 7462f30.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4a46d882-8f65-46a8-b038-cc615f9e6b5f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 13, 2026
macroscopeapp[bot]
macroscopeapp bot previously approved these changes Apr 13, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 13, 2026

Approvability

Verdict: Approved

Single-line fix converting a titlebar color constant from hex to rgba format for Linux compatibility. The change is purely cosmetic/display-related with no runtime logic changes.

You can customize Macroscope's approvability policy. Learn more.

@tarik02 tarik02 closed this Apr 13, 2026
@tarik02
Copy link
Copy Markdown
Contributor Author

tarik02 commented Apr 13, 2026

wait, it doesn't crash but it doesn't make the bar transparent
prob need to fix electron itself...

@tarik02
Copy link
Copy Markdown
Contributor Author

tarik02 commented Apr 13, 2026

wait, it doesn't crash, but doesn't seem to work too

@tarik02 tarik02 reopened this Apr 13, 2026
@tarik02
Copy link
Copy Markdown
Contributor Author

tarik02 commented Apr 13, 2026

Actually it works well (but still crashes on debug build). I would say, it's good to merge this + I will prepare MR with fix to electron repo.

@tarik02
Copy link
Copy Markdown
Contributor Author

tarik02 commented Apr 13, 2026

@juliusmarminge may I tag you in such cases? Or this is not necessary?

@juliusmarminge
Copy link
Copy Markdown
Member

juliusmarminge commented Apr 13, 2026

Actually it works well (but still crashes on debug build). I would say, it's good to merge this + I will prepare MR with fix to electron repo.

if it still crashes what does it fix that we should merge it?

I tested only windows and mac though, not Linux

@macroscopeapp macroscopeapp bot dismissed their stale review April 13, 2026 15:43

Dismissing prior approval to re-evaluate 5b39fbf

@tarik02
Copy link
Copy Markdown
Contributor Author

tarik02 commented Apr 13, 2026

@juliusmarminge

  1. The crash can be reproduced only on debug build of electron (before and after the change).
  2. Before change the crash was caused by invalid format, after - in rendering code of electron (I just applied an issue to electron: Setting titleBarOverlay to rgba(0,0,0,0) makes controls fall back to default background color electron/electron#51014).

but actually - we can leave it as is for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants