fix(jetbrains): address session view review feedback

This commit is contained in:
kirillk
2026-05-27 16:18:33 -04:00
parent 2963dd712b
commit 3cb6d77d8f
2 changed files with 7 additions and 4 deletions
@@ -23,7 +23,7 @@ abstract class AbstractSessionPartView(
protected val arrow = JBLabel()
protected val row = JPanel(BorderLayout(JBUI.scale(SessionUiStyle.View.CARD_LAYOUT_GAP), 0))
private val bound = mutableListOf<Component>()
private val bound = linkedSetOf<Component>()
private val click = object : MouseAdapter() {
override fun mouseClicked(e: MouseEvent) {
@@ -13,12 +13,15 @@ import com.intellij.ui.components.JBLabel
* confusing empty gaps), this shows a dim label with the raw type name.
* This makes it easy to spot new part types that need a proper renderer.
*/
class GenericView(content: Generic) : SecondarySessionPartView(JBLabel("[${content.type}]"), JBLabel()) {
class GenericView private constructor(
content: Generic,
private val label: JBLabel,
) : SecondarySessionPartView(label, JBLabel()) {
constructor(content: Generic) : this(content, JBLabel("[${content.type}]"))
override val contentId: String = content.id
private val label = row.getComponent(0) as JBLabel
init {
label.foreground = UiStyle.Colors.weak()
applyStyle(SessionEditorStyle.current())