mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 05:52:35 +08:00
fix(jetbrains): refresh migration modal layout
This commit is contained in:
+4
@@ -47,6 +47,7 @@ import com.intellij.openapi.options.ShowSettingsUtil
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.util.concurrency.annotations.RequiresEdt
|
||||
import java.util.function.Predicate
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -339,6 +340,7 @@ class SessionUi(
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresEdt
|
||||
private fun applyMigrationState(state: MigrationUiState) {
|
||||
when (state) {
|
||||
is MigrationUiState.Hidden -> {
|
||||
@@ -349,6 +351,8 @@ class SessionUi(
|
||||
if (!root.blocker.isVisible) LOG.info("Migration wizard: overlay shown session=${id ?: cacheKey ?: "new"} phase=${state.phase}")
|
||||
migrationOverlay.update(state)
|
||||
setModalContent(migrationOverlay) { migrationOverlay.preferredFocusComponent() }
|
||||
migrationOverlay.revalidate()
|
||||
migrationOverlay.repaint()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+21
-5
@@ -1,12 +1,11 @@
|
||||
package ai.kilocode.client.session.ui
|
||||
|
||||
import ai.kilocode.client.ui.UiStyle
|
||||
import ai.kilocode.client.ui.layout.HAlign
|
||||
import ai.kilocode.client.ui.layout.VAlign
|
||||
import ai.kilocode.client.ui.layout.align
|
||||
import com.intellij.util.concurrency.annotations.RequiresEdt
|
||||
import com.intellij.util.ui.JBDimension
|
||||
import com.intellij.util.ui.components.BorderLayoutPanel
|
||||
import java.awt.BorderLayout
|
||||
import java.awt.Container
|
||||
import java.awt.Dimension
|
||||
import java.awt.Rectangle
|
||||
import javax.swing.JComponent
|
||||
@@ -36,20 +35,32 @@ class SessionRootPanel : JLayeredPane() {
|
||||
overlay.addOverlay(child, bounds)
|
||||
}
|
||||
|
||||
@RequiresEdt
|
||||
fun setModalContent(child: JComponent?) {
|
||||
blocker.removeAll()
|
||||
if (child != null) blocker.add(child.align(HAlign.CENTER, VAlign.CENTER), BorderLayout.CENTER)
|
||||
if (child != null) blocker.add(child, BorderLayout.CENTER)
|
||||
blocker.isVisible = child != null
|
||||
if (child != null) blocker.requestFocusInWindow()
|
||||
invalidate()
|
||||
blocker.invalidate()
|
||||
child?.invalidate()
|
||||
if (width > 0 && height > 0) {
|
||||
doLayout()
|
||||
child?.let(::layoutTree)
|
||||
}
|
||||
blocker.revalidate()
|
||||
blocker.repaint()
|
||||
revalidate()
|
||||
repaint()
|
||||
}
|
||||
|
||||
@RequiresEdt
|
||||
fun setBlocked(value: Boolean) {
|
||||
blocker.isVisible = value
|
||||
if (value) blocker.requestFocusInWindow()
|
||||
invalidate()
|
||||
blocker.invalidate()
|
||||
if (width > 0 && height > 0) doLayout()
|
||||
revalidate()
|
||||
repaint()
|
||||
}
|
||||
@@ -131,7 +142,12 @@ class SessionRootPanel : JLayeredPane() {
|
||||
|
||||
override fun doLayout() {
|
||||
super.doLayout()
|
||||
components.forEach { it.doLayout() }
|
||||
components.forEach { layoutTree(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun layoutTree(comp: java.awt.Component) {
|
||||
comp.doLayout()
|
||||
if (comp is Container) comp.components.forEach { layoutTree(it) }
|
||||
}
|
||||
|
||||
@@ -228,17 +228,10 @@ action.Kilo.Session.Delete.description=Delete the selected session(s)
|
||||
action.Kilo.History.ContextMenu.text=History Actions
|
||||
|
||||
# Migration wizard
|
||||
migration.whats_new.title=What''s New in Kilo Code
|
||||
migration.whats_new.subtitle=We''ve rebuilt the extension on a faster, more efficient foundation.
|
||||
migration.whats_new.feature.performance=Faster Agent Performance
|
||||
migration.whats_new.feature.interface=Streamlined Interface
|
||||
migration.whats_new.feature.agent_manager=Agent Manager
|
||||
migration.whats_new.feature.foundation=Shared Foundation
|
||||
|
||||
migration.migrate.title=Migrate Your Settings
|
||||
migration.migrate.subtitle=We found settings from your previous installation. Here''s what we can bring over.
|
||||
migration.migrate.section=Select what to migrate
|
||||
migration.empty=Nothing to migrate was found in the legacy settings.
|
||||
migration.keep_legacy_settings=Keep legacy settings file
|
||||
|
||||
migration.row.providers=Provider API Keys
|
||||
migration.row.mcp=MCP Servers
|
||||
@@ -247,13 +240,11 @@ migration.row.sessions=Chat Sessions & History
|
||||
migration.row.model=Default Model
|
||||
migration.row.settings=Auto-Approval, Language & Autocomplete
|
||||
|
||||
migration.button.back=Back
|
||||
migration.button.skip=Skip
|
||||
migration.button.migrate=Migrate Settings
|
||||
migration.button.migrating=Migrating...
|
||||
migration.button.done=Done
|
||||
migration.button.continue=Continue
|
||||
migration.button.continue_to_migrate=Continue
|
||||
|
||||
migration.session.header=Migrating {0} of {1}
|
||||
migration.session.step.preparing=Preparing session
|
||||
|
||||
Reference in New Issue
Block a user