Skip to content

Improve dialog EDT behavior in BrowseCoursesDialog #7

@meanmail

Description

@meanmail

Overview

Dialog validation is being triggered directly on EDT from callbacks without proper modality state, potentially causing freezes.

Location

File: intellij-plugin/hs-core/src/org/hyperskill/academy/learning/newproject/ui/BrowseCoursesDialog.kt
Lines: 45-67

Problems

  1. Line 47: panel.doValidation() is called directly on EDT from pluginLoaded callback - this could trigger heavy operations
  2. Line 59: panel.doValidation() is called on EDT from notification listener without proper modality state
  3. TODO comment on lines 60-63 indicates there's a known IDE freeze issue when installing/uninstalling plugins

What needs to be fixed

  • Investigate what panel.doValidation() does and move heavy operations to background
  • Use proper modality state for invokeLater calls (line 51 has it, line 59 doesn't)
  • Add progress indicators for long-running validation
  • Consider debouncing validation calls to prevent multiple rapid invocations
  • Fix the TODO about IDE freezes during plugin install/uninstall

Tests understanding of

  • Dialog lifecycle and EDT requirements
  • ApplicationManager.getApplication().invokeLater() with modality states
  • Progress indicators for background operations
  • Plugin lifecycle events
  • Debouncing/throttling UI updates

Validation

  • Install/uninstall plugins while dialog is open
  • Ensure no freezes occur
  • Verify validation still works correctly
  • Test with slow network/API responses

Estimated time

3-4 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions