Skip to content

feat: populate more_info with HistoryExtraInfo on history save#236

Draft
eitsupi wants to merge 3 commits into
mainfrom
feature/history-extra-info
Draft

feat: populate more_info with HistoryExtraInfo on history save#236
eitsupi wants to merge 3 commits into
mainfrom
feature/history-extra-info

Conversation

@eitsupi

@eitsupi eitsupi commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Upgrade reedline to git rev 32f80f4 (pre-release adding SqliteBackedHistory::save_with_extra / search_with_extra) and rusqlite from 0.37 to 0.40.1 to match
  • Add with_extra<A,B>() helper to convert HistoryItem between ExtraInfo types without cloning
  • FuzzyHistory::save() now calls save_with_extra::<HistoryExtraInfo>(), setting meta_command: true for commands starting with :
  • History browser (load_history) reads the more_info JSON column and parses is_meta in Rust (safe fallback to false for NULL or malformed JSON)
  • Add filter keywords to the history browser: meta:no (exclude meta commands) and meta:only (show only meta commands)

Notes

  • The reedline git dependency is temporary. Once the upstream PR is released to crates.io, revert to a version dependency.
  • Ctrl+R fuzzy search intentionally remains unaffected (uses IgnoreAllExtraInfo as before).
  • search_typed() is out of scope for this PR.

Test plan

  • cargo test passes (786+ unit + integration tests)
  • cargo fmt --check passes
  • cargo clippy -- -D warnings passes
  • Manual: run arf, execute some :cd, :help commands, open :history browser, verify they appear by default and disappear with meta:no filter
  • Manual: verify meta:only shows only meta commands

eitsupi and others added 2 commits June 30, 2026 12:35
Use reedline git rev 32f80f4 (pre-release of History generic ExtraInfo)
to call save_with_extra<HistoryExtraInfo> in FuzzyHistory::save.

- Upgrade reedline to git rev 32f80f429e709d2d16fccf23515494e2f0bc525f
  which adds SqliteBackedHistory::save_with_extra / search_with_extra
- Upgrade rusqlite from 0.37.0 to 0.40.1 to match reedline requirement
- Add with_extra<A,B>() helper to convert HistoryItem between ExtraInfo types
- Set meta_command: true for commands starting with ':' on save
- Filter meta commands from history browser via SQL json_extract WHERE clause
- Add tests for the meta_command exclusion filter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Show all history entries by default (including meta commands).
Add filter keywords to opt in to meta filtering:
- meta:no   — exclude meta commands from results
- meta:only — show only meta commands

The is_meta flag is read from the more_info JSON column at load time
and stored per entry in BrowsableHistoryItem, so filtering is in-memory
without SQL roundtrips.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eitsupi eitsupi changed the title feat: populate more_info with HistoryExtraInfo on history save feat: populate more_info with HistoryExtraInfo on history save Jun 30, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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