Documentation
¶
Overview ¶
Package filters is a two-filterable-pane screen — the shape that exposes how focus behaves when a component has more than one place to type.
A filterable component holds two focusable regions behind a single focus.Focusable: the filter and the body. Put two such components on one screen and the interesting cases appear:
- Exactly one region anywhere on screen should read as active. Clicking a filter must take the highlight off its own body, not just add a second highlight.
- Clicking a body must take input back from its filter. Otherwise the filter keeps swallowing keys with nothing on screen saying so.
- Moving focus to the other pane must clear the region you left, including its filter. A filter left focused on a blurred component is invisible and still eats keystrokes.
- tab must not cycle while a filter is taking input — it would strand a half-typed query, and pkg/table binds tab to complete a key:value term.
The two panes are deliberately different components (a list and a table) because their filters differ: the table's parses `key:value` terms and completes them on tab, which is exactly the binding a focus group would otherwise steal.
Index ¶
- func New(t theme.Theme) screen.Screen
- type Screen
- func (s *Screen) Help() []key.Binding
- func (s *Screen) HelpSections() []help.Section
- func (s *Screen) Init() tea.Cmd
- func (s *Screen) IsCapturingKeys() bool
- func (s *Screen) Layout() layout.Node
- func (s *Screen) OnEnter(any) tea.Cmd
- func (s *Screen) SetTheme(t theme.Theme)
- func (s *Screen) Title() string
- func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
func (*Screen) HelpSections ¶
HelpSections is what the `?` overlay reads. Two filterable panes put nearly forty bindings on this screen, and the footer's flat list cannot say which of them belong to the files pane and which to the rows — the Group can, because it holds both.
func (*Screen) IsCapturingKeys ¶
IsCapturingKeys is answered by whichever pane holds focus, which in turn reports true only while its own filter is taking input.