Skip to content

TUI: collapse repeated sort-order blocks in JobsData::sort_jobs and share table scrolling helpers #2605

Open

Description

@andygrove

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

Two small duplication spots in the ballista-cli TUI domain types:

Describe the solution you'd like

  • In sort_jobs, match on the column once to pick a comparator closure, then call sort_by once and apply .reverse() for Descending.
  • Add a small shared helper (e.g. scroll_down(&mut TableState, &mut ScrollbarState, len) / scroll_up(...), or a ScrollableTable struct) in tui/domain/mod.rs and have the three types delegate to it. Move the scroll tests to the helper.

Describe alternatives you've considered

None.

Additional context

This is small and self-contained, a good first issue. Line references are pinned to commit ea1126c.

Activity

  1. added
    enhancementNew feature or request
    help wantedExtra attention is needed
    TUITerminal User Interface
    tech debtCode complexity, duplication or structure that makes the codebase harder to change
    on Oct 14, 2026
  2. milenkovicm commented on Oct 14, 2026

    @milenkovicm
    Contributor
  3. med9110 commented on Oct 15, 2026

    @med9110

    Hi @andygrove, I'd be interested in contributing to #2605.

    I can simplify JobsData::sort_jobs, extract shared scrolling helpers for the three table types, and add regression tests covering sorting, wraparound, and empty tables.

    Would you prefer both refactorings in one PR, or two smaller PRs?

  4. martin-g commented on Oct 16, 2026

    @martin-g
    Member

    @med9110 One PR is OK! Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUITerminal User InterfaceenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededtech debtCode complexity, duplication or structure that makes the codebase harder to change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions