Skip to content

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

Merged
itsaky-adfa merged 2 commits into
stagefrom
feat/ADFA-4826-common-compose-theme
Aug 20, 2026
Merged

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

Conversation

@itsaky-adfa

@itsaky-adfaitsaky-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-adfaitsaky-adfa self-assigned this Aug 11, 2026
@itsaky-adfaitsaky-adfa changed the title feat/ADFA 4826 common compose themeADFA-4826: Add shared IDE Compose theming in common-composeAug 11, 2026
@itsaky-adfa
itsaky-adfa marked this pull request as ready for review August 11, 2026 14:47

@claudeclaudeBot 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

coderabbitaiBot 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: e681e599-61f2-476f-b176-de0038ff1775

📥 Commits

Reviewing files that changed from the base of the PR and between 46cf261 and 5a90696.

📒 Files selected for processing (1)
  • ARCHITECTURE.md

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 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.
  • Changed PluginManagerUiEvent.InstallPlugin to accept PluginInstallSource instead of Uri.
  • Reported successful compilation, unit tests, and spotlessCheck.
  • Risk: Incorrect or missing theme attributes can affect colors in both migrated modules.
  • Risk: The InstallPlugin public event signature change can affect existing callers.

Walkthrough

The PR adds the common-compose module for shared IDE Compose theming. It adds XML-to-Material 3 color resolution, migrates two themes to IdeTheme, and updates the plugin installation event to use PluginInstallSource.

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 optional 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. FloatingTheme retains branded typography.

Plugin installation contract

Layer / File(s)Summary
Install event source update
ARCHITECTURE.md
PluginManagerUiEvent.InstallPlugin now accepts PluginInstallSource instead of Uri. The deletion flag remains unchanged.

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

Merge Risk:⚪ Minimal · up to 5a906

This PR centralizes existing Compose theme definitions while preserving the behavior of the profiler and floating-window themes, with the listed builds and tests passing. No actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

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

Possibly related PRs

Suggested reviewers:davidschachteradfa

Poem

A rabbit maps the colors bright,
From XML themes to dark and light.
IdeTheme gathers schemes with care,
Floating and profiler share.
A plugin source joins the queue—
Hop, hop, the build comes through! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring 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 nameStatusExplanation
Title check✅ PassedThe title clearly identifies the Jira issue and summarizes the main change: adding shared IDE Compose theming in the new common-compose module.
Description check✅ PassedThe description directly explains the new common-compose module, theme delegation, tests, verification, and intended absence of behavior changes.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck 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.

@coderabbitaicoderabbitaiBot 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

@itsaky-adfa
itsaky-adfa requested a review from a teamAugust 11, 2026 15:02
@itsaky-adfa
itsaky-adfaforce-pushed the feat/ADFA-4826-common-compose-theme branch 5 times, most recently from ac52c42 to 5a90696CompareAugust 19, 2026 11:19
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-adfaforce-pushed the feat/ADFA-4826-common-compose-theme branch from 5a90696 to 69c15a9CompareAugust 20, 2026 12:34
@itsaky-adfa
itsaky-adfa merged commit b24c041 into stageAug 20, 2026
4 checks passed
@itsaky-adfa
itsaky-adfa deleted the feat/ADFA-4826-common-compose-theme branch August 20, 2026 15:09
Sign up for freeto 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

@itsaky-adfa@dara-abijo-adfa