Skip to content

refactor: centralize scrim and divider tokens#1439

Draft
agent-p1p wants to merge 2 commits into
masterfrom
pip/whitenoise-android-1384
Draft

refactor: centralize scrim and divider tokens#1439
agent-p1p wants to merge 2 commits into
masterfrom
pip/whitenoise-android-1384

Conversation

@agent-p1p

@agent-p1p agent-p1p commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add semantic scrim-alpha tokens and migrate all 21 current black media-overlay call sites without changing opacity
  • add AppDivider using the Material outlineVariant role and migrate all 25 horizontal divider call sites
  • add Robolectric coverage for the preserved alpha scale and visible AMOLED divider token

Test plan

  • :app:compileDevZapstoreDebugKotlin
  • :app:compileDevPlayDebugKotlin
  • :app:testDevZapstoreDebugUnitTest
  • :app:testDevPlayDebugUnitTest
  • :app:verifyRoborazziDevZapstoreDebug
  • :app:verifyRoborazziDevPlayDebug
  • :app:ktlintCheck
  • :app:lintDevZapstoreDebug
  • :app:lintDevPlayDebug

No screenshot baselines changed; both Roborazzi verification tasks pass. Chat-bubble color derivation consolidation remains out of scope.

Fixes #1384


Open in Stage

Replace ad-hoc media scrim alphas with semantic theme tokens and route all horizontal separators through AppDivider.

Fixes #1384
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@agent-p1p, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 66ffa783-76c1-4d8f-9bb7-12bc790f3625

📥 Commits

Reviewing files that changed from the base of the PR and between 15009ef and 475dfcc.

⛔ Files ignored due to path filters (3)
  • app/src/test/snapshots/message_bubble_markdown_dividers_amoled.png is excluded by !**/*.png
  • app/src/test/snapshots/message_bubble_markdown_dividers_dark.png is excluded by !**/*.png
  • app/src/test/snapshots/message_bubble_markdown_dividers_light.png is excluded by !**/*.png
📒 Files selected for processing (24)
  • app/src/main/java/dev/ipf/whitenoise/android/ui/MarkdownRenderer.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/account/AccountSelectorSheet.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/ConversationRows.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/composer/MentionPicker.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/media/MediaControls.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/media/MediaImageBubbles.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/media/MediaPending.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/media/MediaPreview.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/media/MediaVideo.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/media/MediaViewer.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/media/RecentMedia.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/messages/MessageActions.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/messages/MessageBubbleFooter.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/group/GroupDetailsScreen.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/group/GroupEditScreen.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/group/GroupImageSearch.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/profile/ProfileEditScreen.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/profile/ProfileSheet.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/qr/QrScannerSheet.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/settings/NotificationsScreen.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/settings/SecurityPrivacyScreen.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/theme/VisualTokens.kt
  • app/src/test/java/dev/ipf/whitenoise/android/ui/screenshot/MessageBubbleChromeScreenshotTest.kt
  • app/src/test/java/dev/ipf/whitenoise/android/ui/theme/VisualTokensTest.kt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pip/whitenoise-android-1384

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.

@stage-review

stage-review Bot commented Jul 15, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 5 individual chapters for you:

Title
1 Define semantic scrim and divider tokens
2 Migrate media overlays to ScrimAlpha tokens
3 Migrate horizontal dividers to AppDivider
4 Verify token preservation and divider visibility
5 Other changes
Open in Stage

Chapters generated by Stage for commit 475dfcc on Jul 15, 2026 7:58pm UTC.

@agent-p1p agent-p1p left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pip adversarial review — 161d0684

BLOCKING:

  • none

SUGGESTION:

  • app/src/test/java/dev/ipf/whitenoise/android/ui/theme/VisualTokensTest.kt:40-58appDividerUsesVisibleAmoledOutlineToken does not inspect the rendered AppDivider. It independently calls appDividerColor() and compares that helper with outlineVariant; the test would still pass if AppDivider were later wired to Color.Black. Either assert the actual rendered divider color or simplify/rename this as a theme-token test so it does not imply component-wiring coverage.
  • app/src/main/java/dev/ipf/whitenoise/android/ui/MarkdownRenderer.kt:301,429 — these two dividers previously derived from LocalContentColor.current.copy(alpha = 0.25f), so markdown rules and table separators adapted to colored message bubbles. The canonical outlineVariant migration intentionally changes hue/opacity, but the PR reports no snapshot baseline changes. Add or confirm targeted light/dark/AMOLED screenshot coverage for markdown dividers inside sent/received bubbles; existing Roborazzi verification may simply not exercise these blocks.

NITPICK:

  • none

SUMMARY: All 21 black media scrims preserve their original alpha values, all 25 HorizontalDivider call sites now use the shared wrapper, and no raw call sites remain. Color.kt/Theme.kt are untouched. AMOLED resolves outlineVariant to the existing #242424 border token on pure black, and the targeted token tests plus ktlint pass locally. The two findings above are non-blocking coverage gaps; no correctness, security, or sensitive-path issue was found.

VERDICT: APPROVE

SENSITIVE_PATHS: none

@agent-p1p

Copy link
Copy Markdown
Contributor Author

Existing follow-up #1414 tracks the out-of-scope MessageBubble.kt / FontSizeScreen.kt color-derivation duplication noted in #1384; no duplicate issue created.

@github-actions

Copy link
Copy Markdown

Preview APK for PR #1439

Home-screen label: 1439 White Noise with the blueprint launcher icon — installs side-by-side with the production and staging apps.

Install directly — one tap, no GitHub sign-in (public, content-addressed .apk). ARM64 only.

Every push to this PR rebuilds and updates this comment.

Render thematic and table dividers in sent and received bubbles across light, dark, and AMOLED screenshot baselines. Remove the self-referential divider color helper so AppDivider wiring is exercised directly by the snapshots.
@agent-p1p

Copy link
Copy Markdown
Contributor Author

Addressed both review suggestions in 475dfcc:

  • Removed the self-referential appDividerColor() test hook; AppDivider now reads outlineVariant directly, and the rendered component is exercised by screenshots.
  • Added Roborazzi baselines for thematic and table dividers inside sent and received bubbles in Light, Dark, and AMOLED modes.

The new baselines were visually inspected. Both dev flavors pass compile, unit tests, Roborazzi verification, ktlint, and Android lint locally.

@agent-p1p

Copy link
Copy Markdown
Contributor Author

Core Android CI is green at 475dfcc. The preview APK workflow built the APK successfully but failed its external Blossom upload twice: the original run hit connection resets/timeouts, and retry cycle 1 timed out on all three upload attempts. This has remained stuck for more than 30 minutes, so the PR stays draft under the no-red-CI policy pending human handling or a later infrastructure retry.

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.

Introduce shared scrim-alpha and divider color tokens; consolidate ad-hoc values

1 participant