pub enum FormFocus {
Show 17 variants
Title,
Status,
Priority,
Labels,
Assignee,
Estimate,
Cycles,
Milestones,
Reviewer,
StartDate,
DueDate,
Parent,
Target,
Template,
Body,
Projects,
Epics,
}Variants§
Title
Status
Priority
Labels
Assignee
Estimate
Cycles
Milestones
Reviewer
StartDate
DueDate
Parent
The parent issue (WP06 / T026). Appended last, not slotted next to
Assignee where it would read better: every existing row’s index is the
identity of that row in render_with_bindings’s fields array, and
inserting in the middle renumbers all five rows after it. Appending keeps
the eleven existing indices stable, so no render or golden assertion moves.
Target
The entry target of the F4 New Issue mode (tui-new-issue-mode): Triage or
Todo. Appended, per the rule above. It is a toggle, not a text field:
Enter/Space flips it and Left/Right pick a side, and typing into it does
nothing. Choosing a side writes the same status the submit path would use,
so the Status row below stays the authoritative value.
Template
The selected new-issue template’s name, or empty for none. Enter/F2 opens
the template picker (a scratch crate::ui::pickers::DropdownState over
the configured [templates.<name>] names); selecting one pre-fills the
rows. Not a free-text field: the value names a configured record.
Body
The issue body (Markdown), which a template pre-fills. Editable like the
other text rows; newlines are escaped as \n on screen so the row stays a
single line, but the submitted body keeps them verbatim.
Projects
The issue’s project associations (WP06 T029), the comma-joined spelling of the ids the form will associate.
Appended after Body for the rule the rows above already state: every
existing row’s index is its identity in the renderer, and inserting in the
middle renumbers every row after it. The value is a list of resolved ids,
and the row is picker-only — a project the form invented would be one the
registry does not hold, and a reference is chosen from a picker, never typed.
Epics
The issue’s epic references (WP06 T031), the comma-joined spelling of the ids the form will reference.
Appended after Projects for the rule every row above states — no existing
index moves. The exact analogue of FormFocus::Projects for the epic
registry: a list of resolved ids, chosen through the multi-select picker
and never typed, because an epic the form invented would be one the registry
does not hold. The form constructs and validates no epic itself — the ids come
from crate::epics::list_epics and are handed to
crate::commands::epic::resolve_epics at submit.
Implementations§
Source§impl FormFocus
impl FormFocus
Sourcepub const RING: [FormFocus; 17]
pub const RING: [FormFocus; 17]
The focus ring, in next() order, starting at Title.
One list, so render_with_bindings can derive both the focus index and the
row labels from it. It used to hold a hand-written match for the index
beside a positional array of labels, which agree only by inspection — and
the two disagree silently, as a bold cursor on the wrong row.
pub fn next(self) -> Self
pub fn prev(self) -> Self
pub fn label(self) -> &'static str
Sourcepub fn index(self) -> usize
pub fn index(self) -> usize
This field’s row in FormFocus::RING.
Sourcepub fn is_status(self) -> bool
pub fn is_status(self) -> bool
Whether this field holds the issue’s board column (Status).
Chosen from the active board’s columns, never typed: a board column is a named position on a board, not a value to invent by hand, and free text could name one the board does not configure.
Sourcepub fn is_priority(self) -> bool
pub fn is_priority(self) -> bool
Whether this field holds the issue’s priority.
Chosen from the built-in set plus the priorities the project already uses,
never typed, for the same reason as Status — with the picker’s + inline
create as the escape hatch for a priority the options do not list yet.
Sourcepub fn is_template(self) -> bool
pub fn is_template(self) -> bool
Whether this field names a selected template.
Chosen from the template picker, never typed: the value has to name a
configured [templates.<name>] record, and free text could only ever fail
to resolve to one.
Sourcepub fn is_project(self) -> bool
pub fn is_project(self) -> bool
Whether this field holds the issue’s project associations (WP06 T029).
Picker-only, for the reason Status/Priority/Parent are: the value has
to name projects the registry holds, and the form may not construct or
validate one itself — so a typed id could only ever be a guess, and the
picker is fed by crate::projects::list_projects.
Sourcepub fn is_epic(self) -> bool
pub fn is_epic(self) -> bool
Whether this field holds the issue’s epic references (WP06 T031).
Picker-only, for the reason Projects is: the value has to name epics the
registry holds, and the form may not construct or validate one itself — so a
typed id could only ever be a guess, and the picker is fed by
crate::epics::list_epics.
Sourcepub fn refuses_typing(self) -> bool
pub fn refuses_typing(self) -> bool
Whether typing and backspace are refused on this field.
Parent (picked by number), Target (toggled), Template (picked by
name), Status and Priority (picked from their dropdowns) all hold
values that are chosen, so a character has no meaning here. They guard
insert_char/delete_char from one predicate rather than five inline
checks, so a further control field cannot be added and silently left
typeable.
Sourcepub fn is_picker_only(self) -> bool
pub fn is_picker_only(self) -> bool
Whether the field’s value is chosen from a picker rather than typed.
Typing is refused on the chosen rows, because a half-typed number or a
hand-typed priority is not a value: the service validates a parent by
resolved number, and Status/Priority are picked from their dropdowns, so
free text here could only ever fail or invent a column. This is the
general form of what is_date was already doing for dates alone.
Trait Implementations§
impl Copy for FormFocus
impl Eq for FormFocus
impl StructuralPartialEq for FormFocus
Auto Trait Implementations§
impl Freeze for FormFocus
impl RefUnwindSafe for FormFocus
impl Send for FormFocus
impl Sync for FormFocus
impl Unpin for FormFocus
impl UnsafeUnpin for FormFocus
impl UnwindSafe for FormFocus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more