Skip to content

fix(mobile): preserve Material You native review colors - #11445

Closed
Lucenx9 wants to merge 1 commit into
pingdotgg:mainfrom
Lucenx9:fix/material-you-native-review-colors
Closed

Lucenx9 wants to merge 1 commit into
pingdotgg:mainfrom
Lucenx9:fix/material-you-native-review-colors

Conversation

@Lucenx9

@Lucenx9 Lucenx9 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

What Changed

Accept #RRGGBBAA in the native review color converter and blend its alpha channel onto the existing background. Keep sending opaque #RRGGBB to both native implementations.

Why

Android Material You supplies eight-digit colors. The converter only recognized six-digit hex and RGB/RGBA strings, so the background, text, line numbers, and hunk colors fell back to the same screen token. Unhighlighted text and labels could disappear against the background.

The fix stays in the converter shared by these mobile views. Web, desktop, providers, and wire contracts are unchanged.

flowchart LR
    A[Material You palette] --> B[Convert to opaque native colors]
    B --> C[Review diffs]
    B --> D[Comment snippets]
    B --> E[Source file previews]
Loading

Testing

  • 19 focused tests pass across nativeReviewDiffAdapter.test.ts and materialYouTheme.test.ts, using one worker. Seven regression cases failed before the fix.
  • Coverage includes the Material You palette mapper under both appearances, transparent and opaque alpha endpoints, partial-alpha blending, and existing RGB/RGBA and six-digit inputs.
  • Targeted lint, formatting, and TypeScript checks pass. The scoped TypeScript check includes Node types for the test helper that reads the theme stylesheet.

UI Changes

Android device verification and before/after screenshots are missing. No Android SDK or emulator was available, and T3 device access was disabled. The author chose to submit with this limitation disclosed. The reproduction above is automated color-conversion coverage, not a device rendering test.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • No motion, timing, or interaction changes

Implemented with GPT-5 in Codex.

Summary by CodeRabbit

  • Bug Fixes

    • Native review diff themes now correctly render semi-transparent hexadecimal colors against the screen background.
    • Color handling is more consistent across hexadecimal, RGB, and RGBA formats.
    • Material You themes now display the expected colors in both light and dark appearances.
  • Tests

    • Added coverage for color transparency and Material You theme rendering across supported formats and appearances.

Copilot AI lite review requested due to automatic review settings September 12, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-12T19:16:49.233572Z cc14fac PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 12, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at cc14fac

Macroscope's review found this PR approvable — This is a focused mobile rendering bug fix that adds support for Material You’s 8-digit colors while preserving existing color handling. Runtime impact is limited to native review/source surfaces, with targeted tests covering compositing and final palette values.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d639ddcf-c37e-48c8-8f6a-32d1cc6e5e36

📥 Commits

Reviewing files that changed from the base of the PR and between c542b78 and cc14fac.

📒 Files selected for processing (3)
  • apps/mobile/src/features/review/nativeReviewDiffAdapter.test.ts
  • apps/mobile/src/features/review/nativeReviewDiffAdapter.ts
  • apps/mobile/src/lib/materialYouTheme.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Native review theme color handling now supports eight-digit hex colors with alpha. Tests cover color compositing formats and validate Material You themes for light and dark appearances.

Changes

Native review theme colors

Layer / File(s) Summary
Native color parsing and compositing
apps/mobile/src/features/review/nativeReviewDiffAdapter.ts, apps/mobile/src/features/review/nativeReviewDiffAdapter.test.ts
Native hex parsing accepts alpha bytes. Translucent hex and rgba() colors are composited against the background. Parameterized tests cover supported formats.
Material You theme validation
apps/mobile/src/lib/materialYouTheme.test.ts
Tests validate generated theme colors for light and dark appearances and require six-digit hex output.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to cc14f

The native review color conversion update is ready to merge based on the reviewed implementation and focused test coverage.

🚥 Pre-merge checks | ✅ 4 | ❌ 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the mobile Material You color preservation fix, which matches the main change.
Description check ✅ Passed The description includes the required What Changed, Why, UI Changes, and Checklist sections. It explains the fix, scope, tests, and the missing Android screenshots with a clear reason.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Sowyu pushed a commit to Sowyu/t3pretzel that referenced this pull request Sep 15, 2026
Fixes reproduced on an Android emulator and from upstream reports.

Feed: Android stops drawing a text view past the GPU's maximum texture
height, so a long list rendered as one selectable Text lost its tail and
took seconds per frame to draw. Long lists now split into 40-item chunks.
Wide assistant markdown blocks keep a pinned width; the feed reserves
bottom padding.

Keyboard: the feed re-pins after keyboard transitions settle and when the
composer collapses; the back gesture collapses the composer; sticky
composers only follow the keyboard after a fresh show or real focus
(upstream pingdotgg#8212).

Terminal: hardware Enter no longer moves focus off the terminal; keyboards
that use deleteSurroundingText (FUTO) send Backspace; forward delete works.

Also: stream haptics no longer buzz every 320ms on Android and all haptics
use the system engine; thread settings apply on tap without Save; typed
pairing codes are normalized to the server format; non-git projects fall
back to the current checkout instead of a dead worktree default; user CA
certificates are trusted; Ctrl/Cmd+Enter sends from a hardware keyboard;
thread rename, project favicons in the filter, tablet sidebar toggle,
desktop-window density, route titles, Material You review colors, bottom
gesture-bar insets, and the composer placeholder clipping (upstream PRs
pingdotgg#11503, pingdotgg#11370, pingdotgg#11339, pingdotgg#8200, pingdotgg#8717, pingdotgg#11445, pingdotgg#6003, pingdotgg#5052, pingdotgg#8362, pingdotgg#10709,
pingdotgg#11611, pingdotgg#8800, adapted).
@juliusmarminge

Copy link
Copy Markdown
Member

Superseded by #12534, which landed on main with eight-digit hex flattening in opaqueNativeHexColor plus the broader mobile theme-role alignment (including native review / Material You surfaces). Closing this as wash rather than rebase.

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

Labels

size:S 10-29 changed lines (additions + deletions). 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.

3 participants