Help us shape the future of Go! Take the 2026 Go Developer Survey

tui

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package tui is the Bubbletea application.

Architectural rule (docs/ARCHITECTURE.md): Update NEVER blocks. Every network call, subprocess, and disk read returns a tea.Cmd and comes back as a tea.Msg. That is what keeps the flip smooth while a submission is in flight and search responsive while a sync runs.

Second rule: views read the STORE, not the network. Browsing and searching hit SQLite only; the network populates SQLite through explicit sync jobs. A keystroke must never become an HTTP request.

File map — state and behaviour:

model.go        the Model struct, New, Init
messages.go     every tea.Msg this package defines
update.go       Update dispatch; update_sync.go every background job,
                update_solve.go the run and submit loop, update_content.go
                the fetched-content messages and their staleness checks
keys.go         the main keymap; keys_modal.go covers search and sign-in,
                keys_filter.go the board's filter cycles
cursor.go       cursor movement, scrolling, difficulty filters
commands.go     store and network commands; commands_sync.go starts the jobs
panes.go        pane and mode enums, layout breakpoints
screens.go      moving between the list and one problem (D-018)
solve.go        edit, run, submit; solve_run.go and solve_actions.go
solve_files.go  the two earned exceptions to never-overwrite (D-010a, D-014)
solve_edit.go   where the editor opens — pane, own window, or this terminal
                (D-012a); update_edit.go launches it
watch.go        the solution-file poll
picker.go       the selection lists — language, editor, company timeframe
company.go      company packs (D-006); company_keys.go drives the browser
studyplan.go    study plans (D-031); studyplan_keys.go drives the browser
contest.go      contests — the third curated list, and the only one with a
                clock (D-036); contest_keys.go drives the browser
editorial.go    the editorial pane's state and fetch
create.go       f — make the file, name it, do not open it (D-019)
toast.go        the floating notice over the top right
todo.go         m and M — the user's own list (D-022)
git.go          the repository's state and commands; git_keys.go drives it,
                including the push confirmation (D-025)
judge.go        the verdict and the local run's wording
palette.go      the : command line over the settings registry (D-027)
settings.go     the settings screen and the tag/hint reveal toggles (D-027a)

File map — rendering:

layout.go       height and width arithmetic, View, viewBody
rail.go         the header strip
board.go        the problem grid; board_row.go renders one row
detail.go       the statement pane; editorial_view.go its editorial half
workbench.go    the solution's path and whether saves re-run (D-016)
result.go       the local-run diff panel
queue.go        the submission queue; judge_text.go wording for verdicts
search.go       the search panel
setup.go        the first-run screen
git_view.go     the repository screen — branch, changes, commits (D-025)
docs.go         the reference — everything leetui can do, keys and not
help.go         the key reference, folding to columns when it must
signin.go       the sign-in panel
company_view.go the company browser; picker_view.go the selection lists
contest_view.go the contest schedule; studyplan_view.go the plan picker
chrome.go       status line, hints, cell sizing
format.go       small shared formatting helpers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the application root.

func New

func New(cfg config.Config, st *store.Store, cl *leetcode.Client, sy *syncer.Syncer) Model

New builds the root model. Everything it needs is injected so main owns lifetimes and the model stays testable without a network or a real database.

func (Model) Init

func (m Model) Init() tea.Cmd

Init loads the board from the store and refreshes the account in the background.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

Directories

Path Synopsis
Package components holds the reusable widgets of the Departure Board.
Package components holds the reusable widgets of the Departure Board.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL