Skip to content

fix(themes): sync custom theme selections portably#9728

Open
nisavid wants to merge 5 commits intowarpdotdev:masterfrom
nisavid:codex/portable-custom-theme-sync
Open

fix(themes): sync custom theme selections portably#9728
nisavid wants to merge 5 commits intowarpdotdev:masterfrom
nisavid:codex/portable-custom-theme-sync

Conversation

@nisavid
Copy link
Copy Markdown

@nisavid nisavid commented May 1, 2026

Summary

  • Store custom theme references under Warp's theme root as relative paths so Settings Sync does not publish machine-specific theme roots.
  • Resolve portable references and legacy macOS/Linux absolute theme-root paths against the local theme directory when reading synced settings.
  • Allow cloud sync for custom and Base16 theme selections only when every custom theme reference can be represented portably.

Fixes #9723.
Addresses the root cause behind #8988 and #6678.

Relationship to #9634

PR #9634 handles tilde expansion/contraction for home-relative paths. This PR is broader: it stores and resolves custom theme references relative to Warp's platform theme root, so the same selected theme can sync between macOS ~/.warp/themes and Linux XDG data theme roots.

Notes

Settings Sync still syncs only the custom theme reference. It does not upload, download, create, copy, or manage custom theme YAML files.

Test Plan

  • cargo test -p warp themes::theme::tests
  • cargo test -p warp settings::theme::tests
  • cargo fmt --check
  • cargo clippy -p warp --lib --tests -- -D warnings
  • env PATH=/tmp/codex-corepack-bin:/usr/local/sbin:/usr/local/bin:/usr/bin cargo clippy --workspace --all-targets --tests -- -D warnings
  • env PATH=/tmp/codex-corepack-bin:/usr/local/sbin:/usr/local/bin:/usr/bin cargo clippy --workspace --all-targets --all-features --tests -- -D warnings (blocked locally: --all-features enables release_bundle, but warp-channel-config is not installed on PATH)

Co-Authored-By: Oz oz-agent@warp.dev

nisavid and others added 3 commits May 1, 2026 06:24
CHANGELOG-BUG-FIX: Fixed custom theme selection sync for users who install the same custom themes on multiple machines or operating systems.

Co-Authored-By: Oz <oz-agent@warp.dev>

Co-authored-by: Codex <noreply@openai.com>
CHANGELOG-BUG-FIX: Fixed custom theme selection sync for users who install the same custom themes on multiple machines or operating systems.

Co-Authored-By: Oz <oz-agent@warp.dev>

Co-authored-by: Codex <noreply@openai.com>
Co-Authored-By: Oz <oz-agent@warp.dev>

Co-authored-by: Codex <noreply@openai.com>
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 1, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @nisavid on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 1, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 1, 2026

@nisavid

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

oz-for-oss[bot]
oz-for-oss Bot previously requested changes May 1, 2026
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR makes custom theme selections portable by serializing theme-root paths relatively, resolving portable and legacy paths against the local theme root, and expanding syncability checks for custom/Base16 selections.

Concerns

  • Relative custom theme paths from synced settings are accepted without traversal validation, so .. components can resolve outside the intended theme root.

Security

  • The new relative-path resolution should reject or normalize traversal components before applying cloud/settings values to filesystem paths.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/themes/theme.rs Outdated
@nisavid
Copy link
Copy Markdown
Author

nisavid commented May 1, 2026

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label May 1, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 1, 2026

The cla-bot has been summoned, and re-checked this pull request!

nisavid and others added 2 commits May 1, 2026 07:01
Co-Authored-By: Oz <oz-agent@warp.dev>

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@nisavid
Copy link
Copy Markdown
Author

nisavid commented May 1, 2026

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 1, 2026

@nisavid

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @lucieleblanc.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot dismissed their stale review May 1, 2026 11:43

Oz no longer requests changes for this pull request after the latest automated review.

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR stores custom theme selections as portable theme-root-relative references when possible, resolves those references back to the local theme directory when reading settings, and gates theme setting cloud sync on portable custom theme paths.

Concerns

  • No blocking correctness or security concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot requested a review from lucieleblanc May 1, 2026 11:43
Comment thread app/src/themes/theme.rs
Comment on lines +276 to +277
relative_path_after_marker(&components, &[".warp", "themes"])
.or_else(|| relative_path_after_marker(&components, &["warp-terminal", "themes"]))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

i'm pretty sure other warp channels use different paths, i.e. preview uses .warp-preview instead of .warp. does it also handle that case?

windows also uses different paths. maybe it would be better if it used platform-specific logic with conditional compilation instead of "hardcoding" paths here?

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

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings Sync stores custom theme selection as absolute paths, breaking cross-platform sync

2 participants