Skip to content

feat: Major UX improvements - inline decorations, complexity overview, suggestions, Windows fix#80

Open
q404365631 wants to merge 1 commit into
tsperf:mainfrom
q404365631:feature/improved-ux-diagnostics
Open

feat: Major UX improvements - inline decorations, complexity overview, suggestions, Windows fix#80
q404365631 wants to merge 1 commit into
tsperf:mainfrom
q404365631:feature/improved-ux-diagnostics

Conversation

@q404365631
Copy link
Copy Markdown

Summary

This PR significantly improves the user experience of the Type Complexity Tracer extension, addressing multiple open issues and adding key new features.

New Features

1. Inline Type Complexity Decorations (like Error Lens)

  • Shows type complexity metrics directly inline next to identifiers in the editor
  • Color-coded severity levels:
    • 🔴 Red: >2x proportional time (critical)
    • 🟡 Yellow: >1.5x proportional time (warning)
    • 🔵 Blue: >1.2x proportional time (info)
    • 🟢 Green: >1x proportional time (hint)
  • Toggle on/off via Tracer: Toggle Inline Decorations command
  • Shows duration in ms and proportional percentage

2. Type Complexity Sidebar Panel

  • New sidebar view in the activity bar showing all slow types in the project
  • Sort by duration, proportional time, or identifier name
  • Click any entry to navigate directly to the slow type location
  • Shows file name, line number, and complexity metrics

3. Metrics Status Bar

  • Real-time status bar showing:
    • Number of slow types detected
    • Average duration across all slow types
    • Worst (slowest) type duration
  • Color-coded background (red for critical, yellow for warning)
  • Click to toggle inline decorations

4. Type Complexity Optimization Suggestions

  • Quick fix code actions for tsperf diagnostics
  • Contextual suggestions based on complexity patterns:
    • Simplify complex types with many instantiations
    • Extract subtypes to reduce total type count
    • Reduce nesting depth for expensive types
    • Use explicit interfaces instead of inferred types
    • Cache results of expensive utility types (ReturnType, Parameters, etc.)

Bug Fixes

Fix: Windows path compatibility (Closes #48)

  • Use double quotes on Windows, single quotes on Unix for shell commands
  • Use cd /d on Windows for cross-drive navigation (e.g., D:\ to C:)
  • Properly handles non-C drive paths on Windows

Addresses Issues

Testing

  • Build succeeds with pnpm build
  • All new features are opt-in and don't break existing functionality
  • Tested on Windows with cross-drive paths

Version

Bumped from 0.1.3 to 0.2.0

…, suggestions, Windows fix

- Add inline type complexity decorations (like Error Lens)
  - Color-coded severity: red (>2x), yellow (>1.5x), blue (>1.2x), green (>1x)
  - Shows duration and proportional time inline next to identifiers
  - Toggle on/off via command palette

- Add Type Complexity sidebar panel
  - Tree view showing all slow types in project
  - Sort by duration, proportional time, or name
  - Click to navigate to slow type location

- Add metrics status bar
  - Shows slow type count, average and worst duration
  - Color-coded background (red/yellow for high complexity)

- Add type complexity optimization suggestions
  - Quick fix code actions for tsperf diagnostics
  - Suggestions: simplify type, extract subtype, reduce depth, use interface, avoid utility types

- Fix Windows path compatibility (Bug tsperf#48)
  - Use double quotes on Windows, single quotes on Unix
  - Use 'cd /d' on Windows for cross-drive navigation

- Improve status bar with icons and better formatting

Version bump to 0.2.0
@q404365631 q404365631 requested a review from danielroe as a code owner May 29, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trace doesn't work if project isn't on C:/ drive

1 participant