Conversation
To start, here is the new targeting help text, that explains it all: ``` Conversation Targeting Use a conversation ID (e.g. jp-c17761673600), a keyword, or any text to fuzzy-search by title. Interactive Filter/Picker: ? # select from all ?p, ?pinned # select from pinned ?s, ?session # select from session Conversation Aliases: n, newest # target newest created l, latest # target latest active in workspace p, pinned # target latest pinned s, session # target previous active in session Multi-Target Keywords: +s, +session # target all activated in session +p, +pinned # target all pinned ``` This information can be gotten either via `--id=help`, `jp conversation use help`, or `--help` on any command that takes a conversation target, either as a positional argument or as a flag. Additionally, pinned conversations now track their pin time, allowing cross-pinned conversations to be sorted by pin time. This sorting is applied both in `jp conversation ls` and interactive target pickers. --- As for the internals, here is what changed: Replace the `pinned: bool` field on `Conversation` with `pinned_at: Option<DateTime<Utc>>`, recording when a conversation was pinned. This enables ordering pinned conversations by pin time rather than treating them all as equivalent. A new `is_pinned()` helper is provided for callers that only need the boolean. The `ConversationTarget` enum is redesigned around clearer semantics: - `LastActivated` → `Latest` (`l`, `latest`) - `LastCreated` → `Newest` (`n`, `newest`) - `Previous` → `SessionPrevious` (`s`, `session`) - `Current` is removed - `LatestPinned` added (`p`, `pinned`) — resolves the most recently pinned conversation - `Pinned` added (`+p`, `+pinned`) — resolves all pinned conversations - `Session` now uses `+s`/`+session` prefix to distinguish multi-target keywords from single-target aliases - `Help` added to print keyword help and exit cleanly - Interactive picker keywords are now prefixed with `?` (`?`, `?p`, `?pinned`, `?s`, `?session`) - Unknown input falls back to a fuzzy picker pre-seeded with the text, rather than returning a parse error `ConversationTarget::parse` no longer returns `Result`; invalid conversation IDs now trigger the fuzzy picker instead of failing. Session-gating is moved to a new `requires_session()` predicate. The `ids` fields on `PositionalIds` and `FlagIds` are made private behind a new `ConversationIds` trait exposing `ids()` and `is_multi()`. The `ConversationLoadRequest` builders now accept `&dyn ConversationIds` and propagate the `multi` flag, which switches the `?` picker between single-select (`inquire::Select`) and multi-select (`inquire::MultiSelect`). `PickerFilter` gains `session` and `query` fields. The `query` field pre-populates the picker's filter input, making any unrecognised text act as an instant fuzzy search. Help text is rewritten to reflect the new keyword grammar and exposed via a standalone `format_target_help()` function used in error messages for `NoConversationTarget` and the new `TargetHelp` error. Signed-off-by: Jean Mertz <git@jeanmertz.com>
…ystem Signed-off-by: Jean Mertz <git@jeanmertz.com>
…ystem Signed-off-by: Jean Mertz <git@jeanmertz.com>
…ystem Signed-off-by: Jean Mertz <git@jeanmertz.com>
…ystem Signed-off-by: Jean Mertz <git@jeanmertz.com>
…ystem Signed-off-by: Jean Mertz <git@jeanmertz.com>
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.
To start, here is the new targeting help text, giving an overview of the targeting overhaul:
This information can be gotten either when using
helpas the target name (as a positional argument such asjp conversation use help, or using the--id=helpflag), or--helpon any command that takes a conversation target.Additionally, pinned conversations now track their pin time, allowing cross-pinned conversations to be sorted by pin time. This sorting is applied both in
jp conversation lsand interactive target pickers.As for the internals, here is what changed:
Replace the
pinned: boolfield onConversationwithpinned_at: Option<DateTime<Utc>>, recording when a conversation was pinned. This enables ordering pinned conversations by pin time rather than treating them all as equivalent. A newis_pinned()helper is provided for callers that only need the boolean.The
ConversationTargetenum is redesigned around clearer semantics:LastActivated→Latest(l,latest)LastCreated→Newest(n,newest)Previous→SessionPrevious(s,session)Currentis removedLatestPinnedadded (p,pinned) — resolves the most recently pinned conversationPinnedadded (+p,+pinned) — resolves all pinned conversationsSessionnow uses+s/+sessionprefix to distinguish multi-target keywords from single-target aliasesHelpadded to print keyword help and exit cleanly?(?,?p,?pinned,?s,?session)ConversationTarget::parseno longer returnsResult; invalid conversation IDs now trigger the fuzzy picker instead of failing. Session-gating is moved to a newrequires_session()predicate.The
idsfields onPositionalIdsandFlagIdsare made private behind a newConversationIdstrait exposingids()andis_multi(). TheConversationLoadRequestbuilders now accept&dyn ConversationIdsand propagate themultiflag, which switches the?picker between single-select (inquire::Select) and multi-select (inquire::MultiSelect).PickerFiltergainssessionandqueryfields. Thequeryfield pre-populates the picker's filter input, making any unrecognised text act as an instant fuzzy search.Help text is rewritten to reflect the new keyword grammar and exposed via a standalone
format_target_help()function used in error messages forNoConversationTargetand the newTargetHelperror.