Skip to content

perf(connections): eliminate blocking File.existsSync() filesystem calls during widget build in DriverIconImage #1344

Closed

Description

@ZhuchkaTriplesix

Problem

In lib/features/connections/driver_icon.dart, DriverIconImage.build performs a synchronous disk filesystem check:

final file = File(path);
if (!file.existsSync()) return fallback;

Synchronous I/O (existsSync) triggers a blocking POSIX stat/access system call on the main Flutter UI thread during widget layout and build. When rendered across connection trees, driver manager lists, or marketplace views with multiple external driver icons, this causes UI thread jank and stutter during scrolling.

Code Location

  • lib/features/connections/driver_icon.dart (lines 77–78)

UI Kit Relationship

  • Feature Component (Not UI Kit): Lives in lib/features/connections/driver_icon.dart. Used by sidebar connection trees and driver dialogs.
  • No open issues currently track this filesystem check.

Proposed Solution

  1. Verify icon file existence asynchronously when registering/discovering the driver manifest in ExtensionDriverCatalog or LocalExtensionRegistry.
  2. Cache the valid icon file status on the model or manifest, avoiding synchronous filesystem queries inside Widget.build().
  3. Alternatively, rely on material.Image.file / SvgPicture.file's built-in asynchronous errorBuilder fallback.

Acceptance Criteria

  • No synchronous existsSync() or disk syscalls are executed on the Flutter UI thread inside DriverIconImage.build.
  • Missing or deleted icon files gracefully fall back to the placeholder icon without crashing or blocking frames.

Activity

  1. added
    frontendTheme parser epic label: frontend
    performanceTheme parser epic label: performance
    connectionsDatabase connections, URI parsing, pools
    P3Low priority / Polish & Enhancements
    on Oct 10, 2026
  2. ZhuchkaTriplesix commented on Oct 11, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Done in #1416 (merged into dev).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority / Polish & EnhancementsconnectionsDatabase connections, URI parsing, poolsfrontendTheme parser epic label: frontendperformanceTheme parser epic label: performance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions