Documentation
¶
Overview ¶
Package screens draws each of doit's screens from the service's answer.
The helpers here print as rich does: a line cut at the terminal with an ellipsis, a sentence wrapped at its words, and a rule under a title. Each measures in terminal cells, as rich does, where gotermstyle.Clip counts runes. Text from the service is stripped of terminal controls before it is measured, as printedtable strips its cells, so stored text cannot drive the terminal. Layout is computed on the plain text, and color goes on after, so a cut can never land inside an escape sequence.
Index ¶
- func Dashboard(w io.Writer, answer service.Dashboard, widths Widths, p gotermstyle.Palette) error
- func Dormant(w io.Writer, dormant service.Dormant, widths Widths, p gotermstyle.Palette) error
- func Drift(w io.Writer, drift service.Drift, untilNow bool, widths Widths, ...) error
- func Evidence(w io.Writer, evidence service.Evidence, widths Widths, p gotermstyle.Palette) error
- func Explain(w io.Writer, answer service.Next, widths Widths, p gotermstyle.Palette) error
- func Forecast(w io.Writer, reading service.Reading, widths Widths, p gotermstyle.Palette) error
- func Forecasts(w io.Writer, readings []service.Reading, widths Widths, p gotermstyle.Palette) error
- func Happened(w io.Writer, answer service.Happened, openEnded bool, widths Widths, ...) error
- func Next(w io.Writer, answer service.Next, now time.Time, widths Widths, ...) error
- func PursuitList(w io.Writer, list service.PursuitList, offers service.Offers, widths Widths, ...) error
- func ReviewDue(w io.Writer, review service.Review, widths Widths, p gotermstyle.Palette) error
- func ReviewList(w io.Writer, review service.Review, widths Widths, p gotermstyle.Palette) error
- func ReviewNudge(w io.Writer, nudge service.Nudge, widths Widths, p gotermstyle.Palette) error
- func SourcesList(w io.Writer, sources service.Sources, widths Widths, p gotermstyle.Palette) error
- func Today(w io.Writer, answer service.Today, widths Widths, p gotermstyle.Palette) error
- func Trend(w io.Writer, trend service.Trend, widths Widths, p gotermstyle.Palette) error
- type Widths
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dashboard ¶ added in v0.8.0
Dashboard prints each lane in the service's answer, each in its own order and none ranked against another. A lane that could not be read is listed under the rest with why, never dropped, because a missing lane reads as nothing outstanding. The last line names the pursuits behind.
func Dormant ¶ added in v0.9.0
Dormant prints each pursuit that has gone quiet for more than three of its own intervals, coldest first.
func Drift ¶ added in v0.9.0
func Drift(w io.Writer, drift service.Drift, untilNow bool, widths Widths, p gotermstyle.Palette) error
Drift prints what each goal asked for over the window against what got done, in each pursuit's own unit. untilNow is a window that ends now.
func Evidence ¶ added in v0.9.0
Evidence prints what each app says was last done for each watched pursuit, and which apps could not be asked.
func Explain ¶
Explain prints the draw with every number behind it: each pursuit owed first, then the reasons the register gives, then how to read the table.
func Forecast ¶ added in v0.8.0
Forecast prints one reading: each pursuit's occasions over a week and a month, its hours over the month, and how much of its goal that reaches, beside what each duration was estimated from.
func Forecasts ¶ added in v0.8.0
Forecasts prints every stored reading, oldest first, by when it was taken, on which machine, at what budget, and what its estimates rest on.
func Happened ¶ added in v0.8.0
func Happened(w io.Writer, answer service.Happened, openEnded bool, widths Widths, p gotermstyle.Palette) error
Happened prints what every record says happened over the window: which records were asked and which answered, then each group that holds something. openEnded is a window that runs to now, which the title says rather than naming its last minute. A window spanning several days puts each entry's day beside its hour.
func Next ¶
func Next(w io.Writer, answer service.Next, now time.Time, widths Widths, p gotermstyle.Palette) error
Next prints what to do now: today's events, then every pursuit, the offered ones first in the draw's order, and the rest dimmed under them.
func PursuitList ¶ added in v0.9.0
func PursuitList(w io.Writer, list service.PursuitList, offers service.Offers, widths Widths, p gotermstyle.Palette) error
PursuitList prints every pursuit, heaviest first: its weight, goal, when it was last done and when it next comes due, then any recent offers whose pursuit the register does not hold.
func ReviewDue ¶ added in v0.9.0
ReviewDue prints what is due under its block's heading, most overdue first, or that nothing is and which entry comes due next.
func ReviewList ¶ added in v0.9.0
ReviewList prints every register entry and its status under its block's heading, due or not, then any recorded done dates that no entry holds.
func ReviewNudge ¶ added in v0.9.0
ReviewNudge prints the roster a new shell shows: each due maintenance entry on one line, with the command that settles it where the line holds it.
func SourcesList ¶ added in v0.9.0
SourcesList prints each configured source under its block, with whether its read answered and how many lanes it gave.
func Today ¶
Today prints the day: the figures, what it still owes, then what it has had.
Color finds the structure and marks a state, and never fills a whole row. The list headings are cyan and each group's name is blue. A done entry's hour is green, a due row's note yellow or red by how late it is, and a group that could not be read red.
Types ¶
type Widths ¶
type Widths struct {
// Console is where a printed line is cut or wrapped.
Console int
// Layout is what a multi-column view may spend: the terminal, capped so
// a trailing column stays near the rest on an ultrawide one.
Layout int
}
Widths holds the console's width and the layout's width.
func TerminalWidths ¶
func TerminalWidths() Widths
TerminalWidths are this process's widths, both read from gotermstyle.Columns.