Skip to content
cccskills
FreePublished on GitHub

migrate-settings-to-compose-swing

Use this skill to migrate an existing Swing settings page to Compose Swing. It guides the UI extraction, state and transaction handling, previews, component tests, and IDE checks so the migrated page preserves its existing behavior and can be reviewed in context.

OriginalShow the original description

Move a Swing settings page to Compose Swing, with previews and tests.

JetBrains/intellij-community20,664 stars(GitHub 20,664 + cccskills 0)

Run score Not tested

See how to install

Good for

  • Migrating a Swing settings page to Compose Swing
  • Separating a settings form from its controller
  • Adding previews for migrated settings forms
  • Testing settings behavior and lifecycle

Files included (1)

  • SKILL.md5.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/migrate-settings-to-compose-swing/SKILL.md -->

Migrating Swing settings pages

Extract the UI into declarative Compose Swing functions: state down, events up. Keep the configurable's transaction and application order.

Read kotlin-ui-dsl.md, README.md, and raw-swing.md. Read the library's component state and testing contracts.

Steps

Preserve unrelated files. Report unrelated renderer failures separately.

  1. Inventory every page, nested editor, and extension-provided form in the requested screen. Identify its model, UI owner, validation, search, and Apply, Reset, and Cancel behavior.
  2. Separate the controller from the form before changing layout. The controller reads the working model into state and handles events. The composable receives values and callbacks. It must render without a live project model. Use content slots for specialized controls that need platform services.
  3. Build one composition at the page boundary. Use the existing owner's lifetime. Child forms are composables in that composition; they take no disposable and create no host. Preserve configurables that own navigation, shared models, or application order. Use ComposeSwingSearchableConfigurable for a standalone page without those contracts.
  4. Use the base library's declarative controls for buttons, labels, text, and choices. Replace control-field reads with state reads. A programmatic Reset updates state. It does not publish a user edit. A migration creates no new components. When no library or IntelliJ component covers a control, stop and report it as a missing component. A new component is a reusable composable in the IntelliJ components package. It follows every rule of the library's custom components guide.
  5. Rebuild a Kotlin UI DSL panel { } with FormPanel. A page without the DSL keeps its layout structure. Preserve bundle keys, spacing, focus, labels, accessibility, and validation. Derive enabled and visible regions from state. Use one authority for each property. Keep hidden controls in the composition when their identity or state must survive.
  6. Add zero-argument composables with org.jetbrains.compose.swing.tooling.Preview beside each production form. Preview state and callbacks must call the same form. Include inherited values and disabled regions. Use the default preview size. A preview must not construct a project, configurable, transaction, or composition host. Use the preview to expose dependencies that belong in the controller.
  7. Test each migrated form in runComposeSwingTest, with the form passed to its setContent. Drive user actions, adopt callbacks into state, and assert the rendered result after recomposition. Test Reset, enabled regions, selection, labels, and value preservation. Test Apply, Cancel, model validation, disposal, and rebuilding through the owner's public API. Lifecycle tests alone do not verify the form. Confirm that the runner executed the intended tests.
  8. Open and interact with the previews in the IDE. Compare the live pages with the original. Check spacing, focus traversal, accessibility, keyboard actions, resizing, and the IDE look and feel. The running IDE must use the same form APIs as the compiled source. Report an API mismatch with the required IDE build; do not change the form to fit a stale runtime.

Rules

  • State. Each value has one owner. Hoist shared values and derive presentation from them. Preserve staged values across navigation. Key repeated editors by model identity. Do not cache model values with remember when Reset or another page can change them.
  • Transactions. Keep edits in the existing working model. Use bind(...) for persisted settings owned by ComposeSwingSearchableConfigurable. Preserve property transformations and change notifications. A standalone configurable calls requestModifiedCheck() for state changes without a user gesture.
  • Lifecycle. Dispose the root composition with its UI owner. Rebuilding creates a new composition. Do not dispose on temporary detachment. Do not add a disposable for each child form. An override of ComposeSwingSearchableConfigurable.disposeUIResources must call super.
  • Threading. Reach PSI, VFS, documents, and the project model from a LaunchedEffect.
  • Validation. Keep input-time and apply-time checks. Use ConfigurationException for apply-time refusal and the error-outline modifier for field errors.
  • Search. A composition host waits for a window and is empty during offscreen traversal. Use the standalone configurable's immediate composition when that traversal is required. Index conditionally absent strings with a SearchableOptionContributor when they must remain findable.
  • Verification. The headless harness verifies state, callbacks, and structure. Verify painting, preferred sizes, attach-scoped behavior, and visual parity in a realized IDE window. Report unconverted pages and unavailable checks. A wrapper around an unchanged form is not a completed page.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

actions

FreeSummary

Implement or update IntelliJ `AnAction` classes and their `plugin.xml` registrations. Keep labels and descriptions in message bundles, configure optional icons, and launch suspending work through the event coroutine scope so synchronous action handling does not freeze the IDE.

  • Adding a new IntelliJ action
  • Updating an action's registration or icon
  • Moving action labels into a message bundle
JetBrains/intellij-community20.7KUpdated Oct 26, 2026

Move IntelliJ JPS test modules to Bazel and diagnose failures that occur only under Bazel. The guide helps trace missing dependencies, plugins, test data, and runfiles, then verify the generated target and migrated tests.

  • Migrating a JPS test module to Bazel
  • Diagnosing a test failure that occurs only in Bazel
  • Checking Bazel dependencies and test data wiring
JetBrains/intellij-community20.7KUpdated Oct 26, 2026

code-style

FreeSummary

Write or review Kotlin and Java code in line with IntelliJ project conventions. The guidance covers language choice, formatting, sealed types, threading annotations, and safe handling of control flow exceptions so changes fit the surrounding codebase.

  • Writing a new Kotlin file that follows IntelliJ conventions
  • Reviewing Java code and checking its style guidance
  • Checking formatting, sealed-type handling, or exception handling
JetBrains/intellij-community20.7KUpdated Oct 26, 2026

commits

FreeSummary

Create, amend, or rename IntelliJ commits with messages that follow the project’s ticket and label formats. Keep each commit focused, explain the reason and decision in the body when needed, and pass the message safely through the shell or PowerShell.

  • Writing a message for a change linked to a YouTrack ticket
  • Preparing a commit message for tests, cleanup, or documentation
  • Amending or renaming an existing IntelliJ commit
JetBrains/intellij-community20.7KUpdated Oct 26, 2026

Compare how Python type checkers interpret a code snippet or file. The script runs selected tools, including ty, pyrefly, basedpyright, mypy, and zuban, then produces a Markdown report with verdicts, timings, and each checker's diagnostic output.

  • Comparing type inference for a Python snippet
  • Checking whether a Python expression should be a type error
  • Reviewing differences among Python type checkers
JetBrains/intellij-community20.7KUpdated Oct 26, 2026

Shape Compose Desktop UI code by keeping composables focused on rendering and placing application decisions in presenters or coordinators. Get guidance on state ownership, effects, reusable component APIs, lazy-list keys, animation, and performance for individual UI changes.

  • Separating screen rendering from application decisions
  • Choosing which UI state belongs in composition
  • Structuring effects and coroutine work
JetBrains/intellij-community20.7KUpdated Oct 26, 2026

See all skills by JetBrains

Report a problem with this skill