Skip to main content

FormFocus

Enum FormFocus 

Source
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

Source

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.

Source

pub fn next(self) -> Self

Source

pub fn prev(self) -> Self

Source

pub fn label(self) -> &'static str

Source

pub fn index(self) -> usize

This field’s row in FormFocus::RING.

Source

pub fn is_date(self) -> bool

Whether this field holds a date (picker-only, no free typing).

Source

pub fn is_parent(self) -> bool

Whether this field holds a parent (picker-only, single-select).

Source

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.

Source

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.

Source

pub fn is_target(self) -> bool

Whether this field is the New Issue target toggle.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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§

Source§

impl Clone for FormFocus

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FormFocus

Source§

impl Debug for FormFocus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for FormFocus

Source§

impl PartialEq for FormFocus

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FormFocus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.