Documentation

TermColor.Widgets.Basic

TermColor.Widgets.Basic: pure progress and spinner rendering #

Widgets own state-to-text rendering. A caller owns timers, terminal width, and output.

State displayed by a progress bar. current is clamped to total when rendered.

Instances For
    Equations
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Rendering choices for a progress bar. width is the display width without brackets or suffixes.

          Instances For
            Equations
            Instances For
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Percentage shown by a progress bar. Zero total means no work remains, so it is complete.

                  Equations
                  Instances For

                    Render a progress bar as styled text. The caller supplies the desired bar width explicitly.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      State displayed by an indeterminate progress bar. The frame moves back and forth.

                      Instances For
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Moving segment offset for an indeterminate progress bar.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              Render a progress bar for work with no known total. The filled segment bounces at both ends. The caller advances state.frame.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                Default braille spinner frames. The caller advances the frame index.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  State displayed by a spinner. frame is selected modulo the configured frame count.

                                  Instances For
                                    Equations
                                    Instances For
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          Rendering choices for a spinner. Empty frame lists render as an empty frame safely.

                                          Instances For
                                            Equations
                                            Instances For
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  Select a spinner frame, wrapping around the configured frame list.

                                                  Equations
                                                  Instances For

                                                    Render one spinner frame and its optional label as styled text.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For

                                                      Rendering choices for a moving brightness highlight. A zero phase step makes it breathe.

                                                      Instances For
                                                        Equations
                                                        Instances For
                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For

                                                              State displayed by a shimmer. frame selects the current highlight phase.

                                                              Instances For
                                                                Equations
                                                                Instances For
                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    def TermColor.Widgets.shimmer (config : ShimmerConfig) (state : ShimmerState) (text : Text) :

                                                                    Render a display-width-aware shimmer while preserving non-color text styles.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For

                                                                      Common status markers for command-line messages.

                                                                      Instances For
                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For

                                                                          Render a styled status marker followed by a message.

                                                                          Equations
                                                                          Instances For
                                                                            def TermColor.Widgets.renderTable (widths : List Nat) (rows : List (List Text)) (gap : Nat := 2) (alignments : List Layout.Alignment := []) :

                                                                            Render rows as fixed-width, display-aware columns. Cells wrap to their column width.

                                                                            Equations
                                                                            Instances For

                                                                              Keyboard input understood by pure interactive widgets.

                                                                              Instances For
                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For
                                                                                  def TermColor.Widgets.instDecidableEqKey.decEq (x✝ x✝¹ : Key) :
                                                                                  Decidable (x✝ = x✝¹)
                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For
                                                                                    Equations
                                                                                    Instances For

                                                                                      Keyboard bindings for a collapsible widget. Focus traversal remains an application concern.

                                                                                      Instances For
                                                                                        Equations
                                                                                        Instances For
                                                                                          Equations
                                                                                          • One or more equations did not get rendered due to their size.
                                                                                          Instances For
                                                                                            Equations
                                                                                            • One or more equations did not get rendered due to their size.
                                                                                            Instances For

                                                                                              Display state owned by one collapsible widget. The scroll offset counts wrapped body lines.

                                                                                              Instances For
                                                                                                Equations
                                                                                                Instances For
                                                                                                  Equations
                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                  Instances For
                                                                                                    Equations
                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                    Instances For

                                                                                                      Rendering and keyboard choices for a collapsible widget.

                                                                                                      Instances For
                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          Equations
                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                          Instances For
                                                                                                            Equations
                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                            Instances For

                                                                                                              The rendered frame and geometry of a collapsible widget.

                                                                                                              Instances For
                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  Equations
                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                  Instances For
                                                                                                                    Equations
                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                    Instances For
                                                                                                                      @[instance_reducible]
                                                                                                                      Equations

                                                                                                                      Toggle expansion and, when opening, move to the newest buffered body lines.

                                                                                                                      Equations
                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                      Instances For

                                                                                                                        Expand a collapsible and show its newest buffered body lines.

                                                                                                                        Equations
                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                        Instances For

                                                                                                                          Collapse a collapsible without changing its focus or scroll position.

                                                                                                                          Equations
                                                                                                                          Instances For

                                                                                                                            Scroll an expanded body toward its first line.

                                                                                                                            Equations
                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                            Instances For

                                                                                                                              Scroll an expanded body toward its last line.

                                                                                                                              Equations
                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                              Instances For

                                                                                                                                Scroll an expanded body one viewport toward its first line.

                                                                                                                                Equations
                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                Instances For

                                                                                                                                  Scroll an expanded body one viewport toward its last line.

                                                                                                                                  Equations
                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                  Instances For

                                                                                                                                    Apply one configured key to a collapsible's pure display state.

                                                                                                                                    Equations
                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                    Instances For

                                                                                                                                      Render the wrapped, focusable header of a collapsible widget.

                                                                                                                                      Equations
                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                      Instances For

                                                                                                                                        Render the currently visible, wrapped body lines of an expanded widget.

                                                                                                                                        Equations
                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                        Instances For

                                                                                                                                          Render a collapsible with its visible line count and header hit height.

                                                                                                                                          Equations
                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                          Instances For

                                                                                                                                            State for a single-line text input. cursor is a code-point offset.

                                                                                                                                            Instances For
                                                                                                                                              Equations
                                                                                                                                              Instances For
                                                                                                                                                Equations
                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                Instances For
                                                                                                                                                  Equations
                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                  Instances For

                                                                                                                                                    Rendering and input limits for a text input.

                                                                                                                                                    Instances For
                                                                                                                                                      Equations
                                                                                                                                                      Instances For
                                                                                                                                                        Equations
                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                        Instances For
                                                                                                                                                          Equations
                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                          Instances For

                                                                                                                                                            Apply one key to a text input. Input is limited by maxLength.

                                                                                                                                                            Equations
                                                                                                                                                            Instances For

                                                                                                                                                              Render the fixed-width input body without a frame, for embedding in a caller-owned layout.

                                                                                                                                                              Equations
                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                              Instances For

                                                                                                                                                                Render a single-line input with an optional visible cursor.

                                                                                                                                                                Equations
                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                Instances For

                                                                                                                                                                  State for an integer slider. Values are clamped to the configured range.

                                                                                                                                                                  Instances For
                                                                                                                                                                    Equations
                                                                                                                                                                    Instances For
                                                                                                                                                                      Equations
                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                      Instances For

                                                                                                                                                                        Rendering and movement choices for an integer slider.

                                                                                                                                                                        Instances For
                                                                                                                                                                          Equations
                                                                                                                                                                          Instances For
                                                                                                                                                                            Equations
                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                            Instances For
                                                                                                                                                                              Equations
                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                              Instances For

                                                                                                                                                                                Clamp a slider value, treating a reversed range as a single-value range.

                                                                                                                                                                                Equations
                                                                                                                                                                                Instances For

                                                                                                                                                                                  Render an integer slider as a terminal bar and its current value.

                                                                                                                                                                                  Equations
                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                  Instances For

                                                                                                                                                                                    State for a checkbox.

                                                                                                                                                                                    Instances For
                                                                                                                                                                                      Equations
                                                                                                                                                                                      Instances For
                                                                                                                                                                                        Equations
                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                        Instances For

                                                                                                                                                                                          Rendering choices for a checkbox.

                                                                                                                                                                                          Instances For
                                                                                                                                                                                            Equations
                                                                                                                                                                                            Instances For
                                                                                                                                                                                              Equations
                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                              Instances For
                                                                                                                                                                                                Equations
                                                                                                                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                Instances For

                                                                                                                                                                                                  Render a checkbox with its label.

                                                                                                                                                                                                  Equations
                                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                    def TermColor.Widgets.renderButton (label : Text) (focused : Bool := false) :

                                                                                                                                                                                                    Render a terminal button, highlighting it when focused.

                                                                                                                                                                                                    Equations
                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                    Instances For