Skip to content

Skeleton TUI - #226

Merged
davixcky merged 16 commits into
traffic-tuifrom
add-skeleton-tui
Oct 24, 2025
Merged

davixcky merged 16 commits into
traffic-tuifrom
add-skeleton-tui

Conversation

@davixcky

Copy link
Copy Markdown
Contributor
  • Adds dependencies
  • Basic layout
  • Mock data
  • Custom types for HttpRequest and HttpResponse (With the current format that Scott is returning i can construct this using the stdlib)
image image image image image

@gitar-bot

gitar-bot Bot commented Oct 21, 2025 •

Copy link
Copy Markdown

Gitar analyzes/fixes CI failures, runs prompts as workflows and addresses comments starting with Gitar.

⚙️ Options:

  • Automatically accept changes

📝 Submit Feedback

@davixcky
davixcky changed the base branch from main to traffic-tui October 22, 2025 14:57
@daniel-de-vera

daniel-de-vera commented Oct 22, 2025 •

Copy link
Copy Markdown
Contributor

@davixcky, I'm not sure what to review in this PR, but here are some comments:

  1. I find it odd that the UI re-renders on every keystroke, causing the fields to appear in a random order
screen-capture.42.webm
  1. The Esc Go back doesn't seem to work, I ended up stuck in both the Help and Logs views without a way to return to the main navigation.

  2. I find it odd the way to access the right panel (Tab), I initially tried with the right arrow and next with Enter.

  3. The initial view is also confusing:

Screenshot from 2025-10-22 12-12-45

Comment on lines +33 to +38
type HTTPRequestList struct {
Requests []HTTPRequest `json:"requests"`
Total int `json:"total"`
Page int `json:"page"`
PerPage int `json:"per_page"`
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the data is still mocked at this stage, but this structure makes me think we'll end up keeping the full request and response bodies in memory for a set of requests. That might not be ideal.

Wouldn't it be better to load the bodies on demand, for example, only when the user navigates to the right panel and opens the request/response details?

Comment thread internal/tui/models/http_request.go Resolved
Comment thread internal/tui/models/http_request.go Resolved
@daniel-de-vera

Copy link
Copy Markdown
Contributor

@davixcky, here are the other things we discussed during the Eng Sync today:

  1. We should display the host (or the full URL), because the displayed traffic may come from different workloads.

  2. Somehow we should display the routing key associated with each request, similarly as the previous point, there could be records from different sandboxes within the data dir.

@daniel-de-vera

Copy link
Copy Markdown
Contributor

@davixcky This looks much nicer now 🙂
A few comments:

  1. The meta information is repeated several times in the right panel:
screen-capture.44.webm
  1. It would be good to define how we want to handle large bodies. I see that we're currently truncating them, but at the very least we should display the file path for the request/response so the user can open it directly.

@daniel-de-vera daniel-de-vera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this, in case it's easier to addres my last comment in the subsequent PR.

@davixcky

Copy link
Copy Markdown
Contributor Author

Hey Daniel yes the meta is indeed repeated so I can test the viewport don't break on large data. Thanks

@davixcky
davixcky merged commit f11ae15 into traffic-tui Oct 24, 2025
@davixcky
davixcky deleted the add-skeleton-tui branch October 24, 2025 12:11
davixcky added a commit that referenced this pull request Oct 28, 2025
* add traffic inspect command (#225)

* add traffic inspect command

* add support for wait and reword messages

* fix pr comments

* Skeleton TUI (#226)

* skeleton tui

* fix escape logs

* only update if have too

* make sure by default nothing is selected

* move between panes and tabs with arrow

* fix wrong re-render caused by map

* use utility for setting up status

* update mock to contain routing key

* fix help menu and clear status

* center empty states

* add viewport for right panel

* make sure right pane occupy more width

* add basic paginator for left pane

* make sure left pane scroll move between pages

* make short help aware of context

* [TUI] Wiring tui traffic watch (#232)

* skeleton tui

* fix escape logs

* only update if have too

* make sure by default nothing is selected

* move between panes and tabs with arrow

* fix wrong re-render caused by map

* use utility for setting up status

* update mock to contain routing key

* fix help menu and clear status

* center empty states

* add viewport for right panel

* make sure right pane occupy more width

* add basic paginator for left pane

* make sure left pane scroll move between pages

* make short help aware of context

* remove model mock files

* add lipgloss dependency

* add simple watcher and use libconnect type:

* replace bufferred channel with non

* replace round with ceiling

* fix build

* load absolute meta, request and response

* rename symbol

* rename symbol

* pass record dir and meta format

* fix build

* fix yaml support

* add tui call from the inspect

* add tui flag in record

* make sure inspect look for json

* remove hardcoded path

* rename tui flag to inspect

* remove tui cmd

* remove models directory and move loader to utils (#234)

* use pointers for http.{Request,Response}

* make sure width is valid for logs

* disable logs temporarily

* add basic error handling for filemanager (#236)

* add basic error handling for filemanager

* make sure error message is displayed

* remove sprintf from status render

* pass pointer instead of copy on linemessages

* make union type for scanner
davixcky added a commit that referenced this pull request Oct 29, 2025
* add traffic inspect command (#225)

* add traffic inspect command

* add support for wait and reword messages

* fix pr comments

* Skeleton TUI (#226)

* skeleton tui

* fix escape logs

* only update if have too

* make sure by default nothing is selected

* move between panes and tabs with arrow

* fix wrong re-render caused by map

* use utility for setting up status

* update mock to contain routing key

* fix help menu and clear status

* center empty states

* add viewport for right panel

* make sure right pane occupy more width

* add basic paginator for left pane

* make sure left pane scroll move between pages

* make short help aware of context

* [TUI] Wiring tui traffic watch (#232)

* skeleton tui

* fix escape logs

* only update if have too

* make sure by default nothing is selected

* move between panes and tabs with arrow

* fix wrong re-render caused by map

* use utility for setting up status

* update mock to contain routing key

* fix help menu and clear status

* center empty states

* add viewport for right panel

* make sure right pane occupy more width

* add basic paginator for left pane

* make sure left pane scroll move between pages

* make short help aware of context

* remove model mock files

* add lipgloss dependency

* add simple watcher and use libconnect type:

* replace bufferred channel with non

* replace round with ceiling

* fix build

* load absolute meta, request and response

* rename symbol

* rename symbol

* pass record dir and meta format

* fix build

* fix yaml support

* add tui call from the inspect

* add tui flag in record

* make sure inspect look for json

* remove hardcoded path

* rename tui flag to inspect

* remove tui cmd

* remove models directory and move loader to utils (#234)

* use pointers for http.{Request,Response}

* make sure width is valid for logs

* disable logs temporarily

* add logs viewer

* fix regression and make sure logs render ok
davixcky added a commit that referenced this pull request Oct 29, 2025
* add traffic inspect command (#225)

* add traffic inspect command

* add support for wait and reword messages

* fix pr comments

* Skeleton TUI (#226)

* skeleton tui

* fix escape logs

* only update if have too

* make sure by default nothing is selected

* move between panes and tabs with arrow

* fix wrong re-render caused by map

* use utility for setting up status

* update mock to contain routing key

* fix help menu and clear status

* center empty states

* add viewport for right panel

* make sure right pane occupy more width

* add basic paginator for left pane

* make sure left pane scroll move between pages

* make short help aware of context

* [TUI] Wiring tui traffic watch (#232)

* skeleton tui

* fix escape logs

* only update if have too

* make sure by default nothing is selected

* move between panes and tabs with arrow

* fix wrong re-render caused by map

* use utility for setting up status

* update mock to contain routing key

* fix help menu and clear status

* center empty states

* add viewport for right panel

* make sure right pane occupy more width

* add basic paginator for left pane

* make sure left pane scroll move between pages

* make short help aware of context

* remove model mock files

* add lipgloss dependency

* add simple watcher and use libconnect type:

* replace bufferred channel with non

* replace round with ceiling

* fix build

* load absolute meta, request and response

* rename symbol

* rename symbol

* pass record dir and meta format

* fix build

* fix yaml support

* add tui call from the inspect

* add tui flag in record

* make sure inspect look for json

* remove hardcoded path

* rename tui flag to inspect

* remove tui cmd

* remove models directory and move loader to utils (#234)

* use pointers for http.{Request,Response}

* make sure width is valid for logs

* disable logs temporarily

* add logs viewer

* fix regression and make sure logs render ok

* stay on logs on incoming

* clear logs logic and add some coloring

* add cosmetic visual for rendering

* make sure render properly

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants