Skip to content

Add picker session management #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 5, 2025
Merged

Add picker session management #36

merged 15 commits into from
Jul 5, 2025

Conversation

lambdalisue
Copy link
Collaborator

Summary

  • Add session management functionality to save and resume picker states
  • Implement FallSession and FallResume commands for managing sessions
  • Store picker context including query, selection, items, and UI state

Features

New Commands

  • :FallSession - Opens a picker to browse and resume saved sessions
  • :FallResume [filter] - Resume a specific session by name or index
    • Resume latest session: :FallResume
    • Resume by name: :FallResume file
    • Resume by index: :FallResume file#2

Session Management

  • Sessions are automatically saved when closing a picker (except for internal pickers like @action and @session)
  • Sessions store the complete picker state:
    • Query text
    • Selected items
    • Collected and filtered items
    • Cursor position and scroll offset
    • Active matcher, sorter, renderer, and previewer indices

Session Picker

  • Browse all saved sessions with :FallSession
  • Preview shows session details including source, query, and filtered items
  • Dedicated renderer shows session number, name, and arguments

Implementation Details

Core Components

  • session.ts: Manages session storage with compression and a 50-session limit
  • PickerContext: Captures and restores internal picker state
  • UniqueOrderedList: Maintains insertion order while ensuring uniqueness
  • Refactored setup/teardown logic into fall#internal#picker module

Extensions

  • Source: session.ts - Provides session items for the session picker
  • Renderer: session.ts - Formats session display
  • Previewer: session.ts - Shows detailed session information
  • Action: session.ts - Implements resume action with timer to avoid nesting

Test plan

  • Basic session saving when closing pickers
  • Resume sessions with :FallResume
  • Browse sessions with :FallSession
  • Resume specific sessions by name and index
  • Session preview shows correct information
  • Old sessions are pruned when limit is exceeded
  • Internal pickers (@action, @session) don't create sessions

🤖 Generated with Claude Code

Copy link

codecov bot commented Jul 5, 2025

Codecov Report

Attention: Patch coverage is 87.35632% with 22 lines in your changes missing coverage. Please review.

Project coverage is 82.09%. Comparing base (c2fa4f8) to head (f9e0964).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
denops/fall/processor/match.ts 52.38% 10 Missing ⚠️
denops/fall/processor/preview.ts 69.23% 4 Missing ⚠️
denops/fall/processor/render.ts 73.33% 4 Missing ⚠️
denops/fall/processor/sort.ts 71.42% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   81.14%   82.09%   +0.94%     
==========================================
  Files          24       26       +2     
  Lines        1671     1793     +122     
  Branches      161      178      +17     
==========================================
+ Hits         1356     1472     +116     
- Misses        312      318       +6     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lambdalisue lambdalisue merged commit 6e24d80 into main Jul 5, 2025
6 checks passed
@lambdalisue lambdalisue deleted the session branch July 5, 2025 15:25
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.

1 participant