Commit Graph
3 Commits
Author SHA1 Message Date
f3d3f259a1 Allow configuring forwards-table columns, order, and width (#82)
* Allow configuring forwards-table columns, order, and width

Adds an optional tui.columns section to .kportal.yaml so the visible
columns, their order, and their widths can be customized instead of
always rendering the hardcoded 8-column layout. Omitting the section
keeps the existing default columns/order/widths.

Closes #81

* fix(ui): keep the plain table layout and check column widths

The plain verbose table must look the same when no tui section is
set. It had narrower columns and shorter port headers than before. The
default layout is now identical to the old one, and a golden test
guards it.

A status column that is not last now pads by visible width. Table
rules follow the column widths. The UI applies new columns only after a
reload succeeds, including the SIGHUP path of the verbose table.

The validator rejects a column width above 200. The README describes
the tui.columns setting.

Refs #81

* fix(httplog): replace the deprecated ReverseProxy Director with Rewrite

Staticcheck reports SA1019 because Go 1.26 deprecates Director. The
proxy now sets the target in a Rewrite function. Rewrite drops the
X-Forwarded-For header that Director sent, so the function calls
SetXForwarded to keep that header.

A new test checks the target port, the path and the header.

* fix(release): drop the deprecated cask url verified key

Homebrew warns about the verified parameter of the cask url stanza.
The setting is not needed. GoReleaser check now passes without a
deprecation warning.

The postflight warning remains. GoReleaser generates it from the
post install hook, and the upstream fix is not released yet.

Refs #79

---------

Co-authored-by: Lukasz Raczylo <[email protected]>
2026-10-02 02:24:11 +01:00
lukaszraczylo d5125a0d62 Optimisation & fixes 2026-06-21 12:59:55 +01:00
lukaszraczylo 90ddca6709 test: cover ui handlers/views/commands/table
internal/ui: 27.9% -> 79.8%. Adds three test files (~3300 lines):
  - wizard_handlers_extended_test.go: keyboard branches not previously
    covered (ctrl+c, pgup/pgdn, search filter typing, port-checked
    failure path, alias text edit, focus toggling, error states),
    plus removeForwardsCmd / removeForwardByIDCmd against real Mutator
    + tempdir config (dedup + at-least-one-namespace validation).
  - wizard_views_test.go: every renderXxx path with a populated
    AddWizardState — context/namespace selectors, resource selection,
    port entry, http log list/detail, success, scroll indicators.
  - table_test.go: AddForward / UpdateStatus / SetError / Clear /
    FilterStrings flows.

Test-only fixups noted by agent:
  - getFilteredEntries silently skips StatusCode==0 entries (only
    completed responses are visible). Tests now seed StatusCode=200.
  - handleForwardSaved leaves step=StepConfirmation on save error
    rather than advancing to StepSuccess; assertion corrected.
  - removeForwardsCmd needs >=2 forwards in a context for dedup tests
    so removing one leaves the context non-empty (validator rejects
    empty contexts).

go test -race -count=1 ./... clean across all 14 packages.
2026-05-06 14:08:58 +01:00