Chronologically ordered Firefox history via dedicated trigger fh#8
Open
ffpyt wants to merge 9 commits intoalbertlauncher:mainfrom
Open
Chronologically ordered Firefox history via dedicated trigger fh#8ffpyt wants to merge 9 commits intoalbertlauncher:mainfrom
ffpyt wants to merge 9 commits intoalbertlauncher:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated history-browsing pathway for the Firefox plugin so users can browse history in true recency order (without Albert’s fuzzy-ranking reordering), while keeping the existing f fuzzy search behavior for bookmarks/history indexing.
Changes:
- Added
FirefoxHistoryHandler (GeneratorQueryHandler)triggered byfhto return history inlast_visit_date DESCorder with optionalLIKEfiltering. - Refactored plugin structure so
Pluginowns shared config/state and exposes two independent handlers viaextensions(). - Added
get_recent_history()SQL helper to retrieve non-nulllast_visit_dateentries ordered by recency.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
__init__.py |
Adds get_recent_history, introduces new FirefoxHistoryHandler, and refactors plugin into separate handlers with dedicated triggers. |
README.md |
Documents the new fh trigger for chronological history browsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tomsquest
reviewed
Mar 7, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Collaborator
|
Still not tested @ffpyt . Sorry for the delay. Cannot commit time for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ordered Firefox history via dedicated
FirefoxHistoryHandlerMotivation
The existing
FirefoxQueryHandlerusesIndexQueryHandlerwhich ranks results by fuzzy match quality. This is great for searching bookmarks & history by name, but makes it impossible to browse history in chronological order — Albert always reorders results by relevance, even for an empty query.Changes
New
FirefoxHistoryHandler(GeneratorQueryHandler)A self-contained handler triggered by
fhthat yields history in recency order on every query. Typing after the trigger filters results by title or URL via a SQLLIKEclause while preserving the ordering. Because it usesGeneratorQueryHandler, Albert displays results exactly as returned without reranking.Refactored
PluginThe plugin now properly separates concerns:
Plugin(PluginInstance)owns shared state and configuration, while query handlers are standalone objects passed shared state at construction time.extensions()returns both handlers, letting Albert dispatch each trigger independently.New
get_recent_history()functionA dedicated SQL query separate from the existing
get_history()(which is preserved unchanged for bookmark/history indexing). It filters out entries wherelast_visit_date IS NULL— avoiding unvisited prefetched or autocomplete URLs polluting the results — and returns rows ordered bylast_visit_date DESCwith an optional search filter and limit.Triggers
fFirefoxQueryHandlerfhFirefoxHistoryHandler