Skip to content

[tui] Results-table row selection has no action — Enter re-opens the search form instead of the item #14

Description

@tiankaima

Summary

In the interactive results table, j/k/↑/↓/pgup/pgdn/home/end move a highlighted row (internal/tui/tui.go:217-238 plus selectedRowStyle highlight), but the highlight is never actionable: pressing Enter on a row does not open that item — it drops back to the search form, exactly like / and e.

internal/tui/tui.go:194:

case "/", "e", "enter":
    m.mode = tableModeSearch

Verified live against a mock server (tmux, 80x24): search → results → jjEnter → search form reappears; the selected course is not shown.

Why this matters

The TUI is the default browsing path (life-ustc catalog course in a terminal). The natural browse loop is search → highlight → open details, and both the keybindings (full cursor movement, pgup/pgdn, home/end) and the persistent highlight strongly imply Enter opens the highlighted row. Today the only way to see details is to memorize/copy an ID, quit, and run catalog course view <jw-id> — and see the related issue about the displayed ID not even being the one view accepts.

Suggestion

Give the selection a purpose: on Enter, return the selected row to the caller (e.g. extend tui.SearchTable with an OnSelect/detail callback that renders the equivalent of catalog <x> view), keeping //e for edit-search. Alternatively, if drill-down is out of scope, remove the movable highlight and demote movement keys — a selection that does nothing is misleading either way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions