Skip to content

Feature: Autocomplete search suggestions and history - #745

Merged
axllent merged 4 commits into
axllent:feature/search-suggestionsfrom
jinskjoy:feature/search-autocomplete
Oct 16, 2026
Merged

axllent merged 4 commits into
axllent:feature/search-suggestionsfrom
jinskjoy:feature/search-autocomplete

Conversation

@jinskjoy

@jinskjoy jinskjoy commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request introduces search autocomplete suggestions, recent search history, and an integrated search filters quick-reference modal for Mailpit's web UI:

  • Filter Suggestions: Autocompletes supported search filters (to:, from:, subject:, cc:, bcc:, reply-to:, addressed:, message-id:, is:, has:, tag:, before:, after:, larger:, smaller:, and negations ! / -). Suggestions are categorized by fields, status & content, dates & sizes, and dynamic tags loaded from the mailbox.
  • Recent Search History: Saves searches locally (localStorage key mp-search-history, up to 50 items). The default view displays the 5 most recent searches, while typing searches through all matching history items. Individual items or all history can be removed.
  • Search Filters Modal: Adds a quick-reference modal (#SearchFiltersModal) accessible from the autocomplete footer, detailing all available search syntax, descriptions, and clickable examples that immediately apply the filter.
  • Web UI Setting: Adds a toggle option in App Settings ("Show search autocomplete suggestions", enabled by default) allowing users to disable the suggestions dropdown if desired (localStorage key mp-hide-search-suggestions).
  • Keyboard Navigation & Usability: Full keyboard navigation (↓ / ↑ to cycle, Enter / Tab to apply, Esc to dismiss). Keystrokes do not pre-select suggestions so pressing Enter without arrow navigation submits the raw typed query directly.

Screenshots

SCR-20261012-oyte SCR-20261012-ozbq SCR-20261012-ozgy SCR-20261012-ozlg SCR-20261012-oztc image

Related issues

None

Type of change

  • Bug fix
  • New feature
  • Refactor / code cleanup
  • Documentation
  • Other (please describe):

Test plan

  • Tested search autocomplete with various prefixes (to:, from:, is:, has:, tag:, larger:, !is:).
  • Verified recent searches persistence (up to 50 items stored, 5 shown in default view, matches filtered on typing).
  • Tested keyboard navigation (↓, ↑, Enter, Tab, Esc).
  • Verified pressing Enter without arrow navigation submits the typed query rather than selecting a suggestion.
  • Verified settings toggle in Web UI settings enables/disables the autocomplete dropdown.
  • Verified Search Filters modal opens from the dropdown footer, external documentation link has no duplicate icons, and clicking examples applies them.
  • Tested in light, dark, and deep-dark themes.
  • Linter (npm run lint) passes with 0 warnings/errors; npm run build and go test ./... pass.

AI assistance disclosure

Please indicate whether AI tools (e.g. Claude, Copilot, ChatGPT, Cursor) were used in preparing this pull request:

  • No AI was used
  • Assisted — AI was used for suggestions, explanations, or small snippets, but the code was primarily written and understood by me
  • Extensive — AI generated a significant portion of the code in this PR

If AI was used, briefly describe how (which tools, and for what parts):

Used Google Antigravity to implement the Vue components, filter matching logic, keyboard navigation, and Bootstrap styling.

Checklist

  • I have tested my changes locally
  • I have read and understood all code being submitted (including any AI-generated portions)
  • Documentation has been updated where relevant

@jinskjoy
jinskjoy marked this pull request as draft October 12, 2026 14:40
@jinskjoy
jinskjoy marked this pull request as ready for review October 12, 2026 15:07
@axllent

axllent commented Oct 14, 2026

Copy link
Copy Markdown
Owner

This is awesome, thanks! This is a large commit so it'll take me a few days to properly review and test, however I can see this will be a valuable contribution.

@jinskjoy

Copy link
Copy Markdown
Contributor Author

Thank you. Please let me know if any changes needs to be done.

@axllent
axllent changed the base branch from develop to feature/search-suggestions October 16, 2026 02:27
@axllent
axllent merged commit b92af3c into axllent:feature/search-suggestions Oct 16, 2026
axllent added a commit that referenced this pull request Oct 16, 2026
@jinskjoy
jinskjoy deleted the feature/search-autocomplete branch October 16, 2026 12:53
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.

2 participants