aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_querycompleter.cpp
AgeCommit message (Collapse)AuthorFilesLines
13 hoursfeat(completion): render the popup with descriptionsDanilo M.1-0/+55
The free-form date hint is a footer label rather than a model row: a row would be filtered away by the first non-matching keystroke and could be selected and inserted, producing a query that errors. QCompleter::setPopup takes a QAbstractItemView, so the label cannot be laid out beside the view in a container widget. The footer sits in space reserved with setViewportMargins inside the list view instead. setItemDelegate must run after setPopup, not before: setPopup installs a plain QStyledItemDelegate of its own and discards whatever was already set, which silently drops the description column. Accepting replaces exactly the span the tokenizer identified rather than QCompleter's own completion prefix, which is a different span once a prefix or a range bound is involved. Four tests drive that path directly instead of through synthetic key events, since whether a key needs Shift is a keyboard-layout property and could not decide the question. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
13 hoursfeat(completion): select candidates per contextDanilo M.1-0/+96
tag: and is: share the tag list, since notmuch aliases them. path: offers each account maildir in both bare and recursive forms, the latter being what Account::scopedQuery builds and not something a user would guess. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
13 hoursfeat(completion): add the prefix, date and mimetype vocabulariesDanilo M.1-0/+35
Keywords are syntax and stay untranslated; the descriptions beside them are prose and go through tr(). The tables are free functions with no QObject to inherit tr() from, so the file declares a VocabularyStrings context with Q_DECLARE_TR_FUNCTIONS rather than borrowing QObject::tr, which would file every string under the QObject context.
13 hourstest(completion): make the lower-bound span test discriminateDanilo M.1-3/+7
date:las..today put the caret at the end of the lower bound, where the whole-bound span and the typed-so-far span are both 3 characters long, so the test passed even against a tokenizer that truncates at the caret and never sees the range separator. Moving the caret mid-bound with date:lastweek..today separates the two: 8 under correct code, 3 under the truncating one. Mutation-verified in both directions.
13 hoursfeat(completion): complete both bounds of a date rangeDanilo M.1-0/+42
Each side of '..' is an independent value against the same model. Entries that are themselves ranges are withheld once a range exists, since date:1week....today is malformed. The token is read to its full extent rather than truncated at the caret: the separator deciding which bound is being edited can sit to the right of the caret. Stems stay caret-bounded so matching never uses untyped text.
13 hoursfeat(completion): complete nothing inside a quoted literalDanilo M.1-0/+18
subject:"foo bar has the cursor in free text, where offering keywords would be wrong.
13 hoursfeat(completion): recognise value context after a prefixDanilo M.1-0/+41
The replace span covers the value only, so accepting a completion never overwrites the prefix that selected it.
13 hoursfeat(completion): add the query cursor-context tokenizerDanilo M.1-0/+66
Prefix completion only so far: the token under the cursor, bounded by whitespace or an opening parenthesis rather than by the start of the line.