Skip to content

ADFA-3597: Move Layout Editor into a plugin #1471

Merged
Daniel-ADFA merged 4 commits into
stagefrom
ADFA-3597-layout-editor
Jul 3, 2026
Merged

ADFA-3597: Move Layout Editor into a plugin #1471
Daniel-ADFA merged 4 commits into
stagefrom
ADFA-3597-layout-editor

Conversation

@Daniel-ADFA

@Daniel-ADFA Daniel-ADFA commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

The Layout Editor now ships as a .cgp plugin, so the host must not also bundle the layouteditor
module — otherwise its classes shadow the plugin's via the parent-first plugin classloader (caused
a NoSuchMethodError on the plugin's converted FileCreator). Removing it is also where the APK/build
savings come from.

- Delete PreviewLayoutAction (it only launched the XML layout editor now that stage moved Compose
  preview elsewhere) + its registration in EditorActivityActions.
- Decouple the recent-projects UI from layouteditor's ProjectFile: add a lightweight host-side
  com.itsaky.androidide.models.ProjectFile + res/layout/rename_project_textinput.xml, and repoint
  RecentProjectsViewModel/Adapter, DeleteProjectListAdapter, RecentProjectsFragment,
  ProjectInfoBottomSheet (and drop the now-unused TextinputlayoutBinding).
- MainFragment: drop the layouteditor ProjectManager.openedProject gate on git-URL drop (always
  true on the home screen once the editor is a separate plugin).
- Remove :layouteditor + :vectormaster from settings.gradle.kts and the app dependency.

(The orphaned layouteditor/ and vectormaster/ module dirs remain on disk but are no longer in the
build; they can be deleted separately.)

@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 to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

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

@Daniel-ADFA Daniel-ADFA changed the title ADFA-3597: Move Layout Editor into a plugin (remove from host) ADFA-3597: Move Layout Editor into a plugin Jul 2, 2026
The module was removed from the build (settings.gradle.kts and the app dependency)
when the Layout Editor moved to a .cgp plugin. Its source still sat on disk; this
deletes it. The top-level vectormaster/ module is likewise orphaned and can be
removed separately.
@Daniel-ADFA Daniel-ADFA requested a review from a team July 2, 2026 22:09
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough
  • Moved the Layout Editor out of the host app and removed the in-host :layouteditor / :vectormaster modules from the app build, so the host no longer bundles classes that can shadow the standalone .cgp plugin.

  • Removed the host-side “preview layout” editor action and its registration, eliminating the old host/plugin class conflict that could trigger NoSuchMethodError.

  • Added a host-owned ProjectFile model and updated recent-projects / project-info flows to use it instead of the plugin-owned type.

  • Added a host-owned rename_project_textinput.xml layout and switched rename UI binding to it.

  • Migrated host-referenced resources into the shared resources module, including layouteditor_migrated.xml, project_list_animation, and several drawable assets.

  • Updated MainFragment so Git URL drops no longer depend on ProjectManager.openedProject; acceptance now keys only off the main screen state.

  • Risk: the extracted module directories still remain on disk but are excluded from the build, which can be confusing if not cleaned up later.

  • Risk: removing the openedProject guard widens when Git URL drops are accepted, so this should be verified for unintended behavior while editing or with an open project.

Walkthrough

This PR removes the layouteditor and vectormaster Gradle modules, deletes the PreviewLayoutAction editor action, introduces a new local ProjectFile model class replacing the layouteditor-provided one, updates consuming adapters/fragments/viewmodel accordingly, adds a rename dialog layout, migrates several drawable/animation/string resources, and simplifies a Git URL drop guard in MainFragment.

Changes

Layouteditor removal and ProjectFile migration

Layer / File(s) Summary
New ProjectFile model and rename dialog UI
app/src/main/java/com/itsaky/androidide/models/ProjectFile.kt, app/src/main/res/layout/rename_project_textinput.xml
Adds a local ProjectFile class (path, name, createdAt/lastModified, rename, renderDateText, lastSegment) and a new TextInputLayout-based rename dialog layout.
Consumers switch to new ProjectFile
.../adapters/DeleteProjectListAdapter.kt, .../adapters/RecentProjectsAdapter.kt, .../fragments/RecentProjectsFragment.kt, .../ui/ProjectInfoBottomSheet.kt, .../viewmodel/RecentProjectsViewModel.kt
Updates imports to com.itsaky.androidide.models.ProjectFile, swaps the rename dialog binding to RenameProjectTextinputBinding, and drops the context argument when constructing ProjectFile in loadProjects().
PreviewLayoutAction removal and drop guard change
.../actions/etc/PreviewLayoutAction.kt, .../utils/EditorActivityActions.kt, .../fragments/MainFragment.kt
Deletes PreviewLayoutAction and its registration, and removes the ProjectManager.instance.openedProject == null requirement from the Git URL drop acceptance check.
Build configuration and migrated resources
app/build.gradle.kts, settings.gradle.kts, resources/src/main/res/values/layouteditor_migrated.xml, resources/src/main/res/anim/project_list_animation.xml, resources/src/main/res/drawable/*
Removes :layouteditor and :vectormaster module inclusion and the app's layouteditor dependency; adds migrated strings/dimen/style and new drawable/animation resources (arrow_left, circle_shape, dots_vertical, edit, ic_launcher).

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

Possibly related PRs

  • appdevforall/CodeOnTheGo#700: Both PRs modify RecentProjectsViewModel's loadProjects and RecentProjectsFragment around the recent projects feature.

Suggested reviewers: jomen-adfa, itsaky-adfa, dara-abijo-adfa

Poem

A module hops away tonight,
Layout editor out of sight.
New ProjectFile takes its place,
Renaming files with tidy grace.
Icons drawn and modules pruned —
This rabbit's build is nicely tuned! 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No meaningful PR description was provided, so it doesn't explain the change. Add a brief description of the plugin migration and key files changed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: moving the Layout Editor into a plugin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-3597-layout-editor

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 `@app/src/main/java/com/itsaky/androidide/models/ProjectFile.kt`:
- Around line 20-24: The ProjectFile.rename() method currently ignores the
boolean result of File.renameTo() and updates path/name even when the filesystem
move fails. Update rename() to check the renameTo outcome and only mutate the
ProjectFile state on success; if it fails, surface the failure by throwing an
exception so RecentProjectsAdapter.promptRenameProject can stay in its existing
catch block and avoid calling onFileRenamed/updateProject with a bad location.
Consider adding a unit test for the failure path in ProjectFile.rename().
🪄 Autofix (Beta)

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

Run ID: 3b101eb8-0716-4791-8f28-ef406ce26774

📥 Commits

Reviewing files that changed from the base of the PR and between 1d27a8a and 61cc5c0.

📒 Files selected for processing (19)
  • app/build.gradle.kts
  • app/src/main/java/com/itsaky/androidide/actions/etc/PreviewLayoutAction.kt
  • app/src/main/java/com/itsaky/androidide/adapters/DeleteProjectListAdapter.kt
  • app/src/main/java/com/itsaky/androidide/adapters/RecentProjectsAdapter.kt
  • app/src/main/java/com/itsaky/androidide/fragments/MainFragment.kt
  • app/src/main/java/com/itsaky/androidide/fragments/RecentProjectsFragment.kt
  • app/src/main/java/com/itsaky/androidide/models/ProjectFile.kt
  • app/src/main/java/com/itsaky/androidide/ui/ProjectInfoBottomSheet.kt
  • app/src/main/java/com/itsaky/androidide/utils/EditorActivityActions.kt
  • app/src/main/java/com/itsaky/androidide/viewmodel/RecentProjectsViewModel.kt
  • app/src/main/res/layout/rename_project_textinput.xml
  • resources/src/main/res/anim/project_list_animation.xml
  • resources/src/main/res/drawable/arrow_left.xml
  • resources/src/main/res/drawable/circle_shape.xml
  • resources/src/main/res/drawable/dots_vertical.xml
  • resources/src/main/res/drawable/edit.xml
  • resources/src/main/res/drawable/ic_launcher.xml
  • resources/src/main/res/values/layouteditor_migrated.xml
  • settings.gradle.kts
💤 Files with no reviewable changes (4)
  • app/build.gradle.kts
  • app/src/main/java/com/itsaky/androidide/utils/EditorActivityActions.kt
  • app/src/main/java/com/itsaky/androidide/actions/etc/PreviewLayoutAction.kt
  • settings.gradle.kts

Comment thread app/src/main/java/com/itsaky/androidide/models/ProjectFile.kt
@Daniel-ADFA Daniel-ADFA merged commit feff84f into stage Jul 3, 2026
2 checks passed
@Daniel-ADFA Daniel-ADFA deleted the ADFA-3597-layout-editor branch July 3, 2026 15:28
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.

3 participants