[editor] IJPL-233855 disable editor skeleton for welcome windows

GitOrigin-RevId: 1b6c5654b868389930a24984defa0662c2114c98
This commit is contained in:
Stanislav Alekseev
2026-02-15 16:24:58 +00:00
committed by intellij-monorepo-bot
parent 4de8f9326d
commit b83eceb703
3 changed files with 19 additions and 5 deletions
@@ -41,6 +41,7 @@
<statistics.counterUsagesCollector implementationClass="com.intellij.platform.ide.nonModalWelcomeScreen.newProjectNotification.WelcomeScreenSingleFileOpeningCollector"/>
<internalFileTemplate name="Generic Empty File"/>
<editorSkeletonPolicy implementation="com.intellij.platform.ide.nonModalWelcomeScreen.WelcomeScreenEditorSkeletonPolicy"/>
</extensions>
<actions resource-bundle="messages.NonModalWelcomeScreenBundle">
@@ -0,0 +1,12 @@
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.platform.ide.nonModalWelcomeScreen
import com.intellij.openapi.fileEditor.FileEditorComposite
import com.intellij.openapi.fileEditor.impl.EditorComposite
import com.intellij.openapi.fileEditor.impl.EditorSkeletonPolicy
import com.intellij.platform.ide.nonModalWelcomeScreen.rightTab.WelcomeScreenRightTabVirtualFile
internal class WelcomeScreenEditorSkeletonPolicy : EditorSkeletonPolicy {
override fun shouldShowSkeleton(fileEditorComposite: FileEditorComposite): Boolean =
(fileEditorComposite as? EditorComposite)?.file !is WelcomeScreenRightTabVirtualFile
}
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus
* for a given file editor composite.
*
* If there is no policy registered for a given file editor composite, editor skeleton **will not** be shown.
* If at least one policy returns true from [shouldShowSkeleton], editor skeleton will be shown.
* If all policies return true from [shouldShowSkeleton], editor skeleton will be shown.
*
* @see EditorSkeleton
*/
@@ -21,17 +21,18 @@ interface EditorSkeletonPolicy {
* Determines whether a skeleton view should be displayed for the given file editor composite.
*
* @param fileEditorComposite the file editor composite to evaluate
* @return true if a skeleton view should be displayed for the provided file editor composite, false otherwise
* @return `true` if a skeleton view should be displayed for the provided file editor composite, `false` otherwise.
* Returning `true` does not guarantee that a skeleton view will be shown, returning `false` guarantees that a skeleton view will not be shown.
*
* @see EditorSkeleton
*/
fun shouldShowSkeleton(fileEditorComposite: FileEditorComposite): Boolean
companion object {
private val EP_NAME: ExtensionPointName<EditorSkeletonPolicy> = ExtensionPointName<EditorSkeletonPolicy>("com.intellij.editorSkeletonPolicy")
private val EP_NAME: ExtensionPointName<EditorSkeletonPolicy> = ExtensionPointName("com.intellij.editorSkeletonPolicy")
internal fun shouldShowSkeleton(fileEditorComposite: FileEditorComposite): Boolean {
return EP_NAME.extensionList.any { it.shouldShowSkeleton(fileEditorComposite) }
return EP_NAME.extensionList.isNotEmpty() && EP_NAME.extensionList.all { it.shouldShowSkeleton(fileEditorComposite) }
}
}
}
}