One card on the board.
A project item is not an issue: it is a card that may point at an issue, at
a pull request, or at nothing but its own title (a draft). All three are shown
— a board with the drafts hidden is not the board anyone is looking at — and
kind says which is which.
column is the card's position on the kanban board: the value of the board's
single-select field, or nil for a card that has not been put in a column.
search is the row flattened into one lowercased string. It is built once, at
decode time, because the search field filters on every keystroke and a few
hundred cards is enough for the difference to be felt. The body is not in it:
searching the text of every issue on a board finds a great many cards that
merely mention the word, which is a different tool than this one.
Keys
The *_keys/1 functions are what Gitpro.Filter filters on, and each answers
the key of a flag rather than the value itself. label_keys/1 and
assignee_keys/1 answer [:none] for a card that has neither, so "unlabelled"
and "unassigned" are flags you can turn off like any other rather than a state
with no switch for it.
Summary
Functions
The assignee flags this card answers to, or [:none] when unassigned.
The key this card's column is filtered under.
Fills in search from everything else in the struct.
The label flags this card answers to, or [:none] when it has none.
Builds the lowercased string Gitpro.Filter matches a query against.
Which state flag this card answers to.
Every state a card can be in, in the order the filter lists them.
Types
@type kind() :: :issue | :pull_request | :draft
@type state() :: :open | :closed | :merged | :none
@type state_key() :: :open | :closed | :merged | :draft
@type t() :: %Gitpro.Item{ assignees: [String.t()], author: String.t() | nil, body: String.t() | nil, column: String.t() | nil, created_at: String.t() | nil, id: String.t(), kind: kind(), labels: [String.t()], milestone: String.t() | nil, number: pos_integer() | nil, repo: String.t() | nil, search: String.t(), state: state(), title: String.t(), updated_at: String.t() | nil, url: String.t() | nil }
Functions
The assignee flags this card answers to, or [:none] when unassigned.
The key this card's column is filtered under.
Cards with no column share the :none bucket, which is a flag of its own so
that "everything nobody has triaged yet" can be looked at on its own.
Fills in search from everything else in the struct.
The label flags this card answers to, or [:none] when it has none.
Builds the lowercased string Gitpro.Filter matches a query against.
Which state flag this card answers to.
A merged pull request is its own state rather than a closed one: on a board that tracks pull requests, "closed" means the ones that were given up on, and lumping the merged in with them hides the difference that matters. A draft is its own state too — it has no state of its own to report.
@spec state_keys() :: [state_key()]
Every state a card can be in, in the order the filter lists them.