Skip to content

ADFA-4826: Add shared IDE Compose theming in common-compose - #1653

Open
itsaky-adfa wants to merge 2 commits into
stagefrom
feat/ADFA-4826-common-compose-theme
Open

ADFA-4826: Add shared IDE Compose theming in common-compose#1653
itsaky-adfa wants to merge 2 commits into
stagefrom
feat/ADFA-4826-common-compose-theme

Conversation

@itsaky-adfa

@itsaky-adfa itsaky-adfa commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Jira: ADFA-4826

Bottom of a 3-PR stack. Extracts the Compose colour scheme and theme that profiler and floating-window had each duplicated into a new common-compose module, so the refactoring UI in the two PRs above has one theme to build on.

What's here

  • New common-compose module: IdeColorScheme (light/dark IDE palettes) and IdeTheme.
  • FloatingTheme and ProfilerTheme now delegate to it instead of carrying their own copies (-111 lines).
  • IdeColorSchemeTest covers the palettes.

2 commits, 10 files, +308/-111.

Verification

  • :common-compose:compileV8DebugKotlin, :profiler:compileV8DebugKotlin, :floating-window:compileV8DebugKotlin pass.
  • :common-compose:testV7DebugUnitTest - 7 tests, 0 failures.
  • spotlessCheck passes.

No behavioural change intended: both themes should render exactly as before.

Stack

  1. ADFA-4826: Add shared IDE Compose theming in common-compose #1653 (this PR) - shared Compose theming
  2. ADFA-4826: Kotlin extract variable code action (K2 LSP) #1654 - ADFA-4826 extract variable
  3. ADFA-5080: Kotlin extract method code action (K2 LSP) #1655 - ADFA-5080 extract method

Review and merge bottom-up.

Stack created with GitHub Stacks CLIGive Feedback 💬

@itsaky-adfa itsaky-adfa self-assigned this Aug 11, 2026
@itsaky-adfa itsaky-adfa changed the title feat/ADFA 4826 common compose theme ADFA-4826: Add shared IDE Compose theming in common-compose Aug 11, 2026
@itsaky-adfa
itsaky-adfa marked this pull request as ready for review August 11, 2026 14:47

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e5df6c99-c41f-466b-bdcc-50c61def4f70

📥 Commits

Reviewing files that changed from the base of the PR and between 96e9901 and 46cf261.

📒 Files selected for processing (1)
  • ARCHITECTURE.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • ARCHITECTURE.md

📝 Walkthrough
  • Added the common-compose module with shared IdeColorScheme and IdeTheme APIs.
  • Added light and dark IDE palette resolution with per-role fallback handling.
  • Migrated profiler and floating-window to the shared theme implementation.
  • Added IdeColorSchemeTest coverage for palette resolution and fallback behavior.
  • Updated Gradle configuration and architecture documentation.
  • Reported successful compilation, unit tests, and spotlessCheck.
  • Risk: Incorrect or missing theme attributes can affect colors in both migrated modules.

Walkthrough

The PR adds the common-compose module with shared IDE theme resolution. It provides IdeTheme, resolves Material 3 colors from XML attributes, tests fallback behavior, and updates floating-window and profiler to use the shared theme.

Changes

Shared Compose theming

Layer / File(s) Summary
common-compose module setup
settings.gradle.kts, common-compose/build.gradle.kts, ARCHITECTURE.md
The repository includes common-compose, configures its Compose dependencies, and documents its shared theming role.
Color scheme and theme implementation
common-compose/src/main/java/.../IdeColorScheme.kt, common-compose/src/main/java/.../IdeTheme.kt, common-compose/src/test/java/.../IdeColorSchemeTest.kt
The module maps IDE XML attributes to Material 3 colors, applies light or dark baselines, exposes IdeTheme, and tests resolution and fallback behavior.
Consumer theme migration
floating-window/build.gradle.kts, floating-window/src/main/java/.../FloatingTheme.kt, profiler/build.gradle.kts, profiler/src/main/java/.../ProfilerTheme.kt
The two modules depend on common-compose and delegate color handling to IdeTheme while retaining local typography where applicable.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 46cf2

This PR centralizes existing Compose theme definitions without an intended behavior change, and the reported checks pass; no actionable merge-blocking risk remains beyond normal review.

Sequence Diagram(s)

sequenceDiagram
  participant Context
  participant IdeTheme
  participant ideColorScheme
  participant MaterialTheme
  Context->>IdeTheme: Read context and system dark-mode state
  IdeTheme->>ideColorScheme: Resolve XML theme attributes
  ideColorScheme-->>IdeTheme: Return Material 3 ColorScheme
  IdeTheme->>MaterialTheme: Apply ColorScheme, typography, and content color
Loading

Poem

A rabbit hops through Compose bright,
IDE colors bloom in dark and light.
Shared themes gather, clean and neat,
Floating windows and profiles meet.
IdeTheme leads the way—
Hop, hop, ship today! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. 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 and concisely identifies the new shared IDE Compose theming in the common-compose module.
Description check ✅ Passed The description accurately explains the new module, theme delegation, tests, verification, and intended lack of behavioral change.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ADFA-4826-common-compose-theme

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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@common-compose/src/test/java/com/itsaky/androidide/common/compose/IdeColorSchemeTest.kt`:
- Around line 7-10: Update IdeColorSchemeTest to use JUnit Jupiter by replacing
org.junit.Test with org.junit.jupiter.api.Test, and replace
assertEquals/assertTrue usages with equivalent Truth assertions throughout the
test class. Keep the existing test behavior and coverage unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fe123155-b3a9-4cdd-95e5-a6970f48d4aa

📥 Commits

Reviewing files that changed from the base of the PR and between 0019903 and 0f4340e.

📒 Files selected for processing (10)
  • ARCHITECTURE.md
  • common-compose/build.gradle.kts
  • common-compose/src/main/java/com/itsaky/androidide/common/compose/IdeColorScheme.kt
  • common-compose/src/main/java/com/itsaky/androidide/common/compose/IdeTheme.kt
  • common-compose/src/test/java/com/itsaky/androidide/common/compose/IdeColorSchemeTest.kt
  • floating-window/build.gradle.kts
  • floating-window/src/main/java/com/itsaky/androidide/floating/ui/FloatingTheme.kt
  • profiler/build.gradle.kts
  • profiler/src/main/java/org/appdevforall/cotg/profiler/ui/theme/ProfilerTheme.kt
  • settings.gradle.kts

Comment on lines +7 to +10
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import com.google.android.material.R as MaterialR

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use JUnit Jupiter and Truth in this new test.

Replace org.junit.Test with org.junit.jupiter.api.Test. Replace assertEquals and assertTrue with Truth assertions. This keeps new tests consistent with the shared test conventions.

As per coding guidelines, “Use JUnit Jupiter, Truth, MockK for new tests.”

Also applies to: 57-121

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@common-compose/src/test/java/com/itsaky/androidide/common/compose/IdeColorSchemeTest.kt`
around lines 7 - 10, Update IdeColorSchemeTest to use JUnit Jupiter by replacing
org.junit.Test with org.junit.jupiter.api.Test, and replace
assertEquals/assertTrue usages with equivalent Truth assertions throughout the
test class. Keep the existing test behavior and coverage unchanged.

Source: Coding guidelines

@itsaky-adfa
itsaky-adfa requested a review from a team August 11, 2026 15:02
@itsaky-adfa
itsaky-adfa force-pushed the feat/ADFA-4826-common-compose-theme branch 2 times, most recently from d1b690e to 96e9901 Compare August 13, 2026 13:47
New leaf module holding the Compose theme any module can opt into: IdeColorScheme
derives a Material3 scheme from the IDE's own colour resources, IdeTheme applies it
and seeds LocalContentColor so text on a themed surface inherits the right colour.

Compose types are exposed as `api` because consumers write Compose against them.
Modules that are not Compose depend on nothing new.
Both modules carried their own near-identical copy of the IDE colour derivation.
They now delegate to common-compose, so there is one place where the IDE's Compose
colours are defined.
@itsaky-adfa
itsaky-adfa force-pushed the feat/ADFA-4826-common-compose-theme branch from 96e9901 to 46cf261 Compare August 14, 2026 11:15
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.

2 participants