Skip to content

Conversation

@yashranjan1
Copy link
Collaborator

Complete TUI rework:

  • Built new component-based architecture replacing fragmented old views.
  • Consolidated components into reusable OptionsProvider pattern with proper separation between views, components, styles, and keybinds packages.

Backend and architecture improvements:

  • Implemented centralized messaging system for consistent view communication.
  • Added message-driven CRUD operations, enhanced endpoint management for flexible creation and updates.

UI/UX redesign:

  • Redesigned entire interface from scratch with intuitive navigation patterns.
  • Prototyped user-visible error handling.
  • Moved pagination logic from backend to frontend for better UX.

yashranjan1 and others added 24 commits August 4, 2025 14:12
basic scaffolding for a new tui
old tui has been moved to a folder called  and has been gitignored for cleanliness
- created a options component for collections
- created a config so that the list within the options is highly customizable
- create a template for how the options component should operate
- new sqlc func for get all collections
- some bug fixes in the list config
- changed existing list collections func to not use pagination
- added a generic to list config for crud
- defined the crud struct
- added a crud struct to the collections view which is supplied to the list component
- bug fixes in main model
- made it so that colors are not exposed, only styles are
- updated the update func for options provider to forward messages to the list component
- set up the list crud op and the item mapper for collections view
- changed generics in the list config so it makes more sense
- updated the footer func for collections
- styling for the list component
- added and input component for the options provider
- created a messages package for circulating messages
- removed crud from the config and gave it access to only the list func
- added generics to the OptionsProvider
- styled the input and added functionality to add collections
- created and input config
- added some styling attributes
- extracted some colors from the styles and made vars out of them
- added the boilerplate for an endpoints view
- added a way to order views so that they dont switch around in the heading
- added a new db query for listing all endpoints by collection (non paginated)
- created a new manager function for fetching these
- renamed the old function responsible for listing eps
- changed the tests for the old function to make sure the still work
- slightly modified the choose items message to make it work better when sent by different views
- more work on the ep view to make it display eps
- the addition of a set state function to the interface to set the state of certain views
- new update func for ep for updating just names
- changed the create function for eps to allow creation without url
- completed ep view
- Remove EndpointCount field from core CollectionEntity
- Use simple GetCollections query without JOIN
- Add GetEndpointCountsByCollections query
- Update itemMapper to fetch counts only for display
- Add NavigateToView message type
- Views emit navigation messages, app handles routing
ItemAdded now uses commands, improving internal consistency and laying
the groundwork for better error handling/UI updates.
- Reflects architectural improvements and backend cleanup
- Message-driven navigation and CRUD operations
- Performance improvements with efficient batch queries
- Enhanced error handling prototype
It won't work if you're on "Collections" view because there's no going
back from there. I've kept this separate from `Ctrl-c` quit as to have
different key-stroke flows for going back/forth vs quitting the app.
@yashranjan1 yashranjan1 requested a review from maniac-en as a code owner August 22, 2025 10:19
@maniac-en maniac-en changed the title feat:tui rework feat: TUI rework; v0.1.0.alpha.2 Aug 22, 2025
@yashranjan1 yashranjan1 self-assigned this Aug 22, 2025
Copy link
Owner

@maniac-en maniac-en left a comment

Choose a reason for hiding this comment

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

Let's fix the failing tests coming from changed behavior in d098bb7 where we allow endpoints creation with empty URL.

Copy link
Owner

@maniac-en maniac-en left a comment

Choose a reason for hiding this comment

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

  • Please follow this pattern of test error output format: Expected <this>, got <this>
  • Please add a reverse-check within the same test that empty URL is indeed preserved. Currently, you're only checking is error returned is nil or not!

My suggestion:

endpoint, err := manager.CreateEndpoint(ctx, data)
if err != nil {
  t.Errorf("Expected empty URL to be allowed, got error: %v", err)
}
if endpoint.URL != "" {
  t.Errorf("Expected empty URL to be preserved, got %s", endpoint.URL)
}

Copy link
Owner

@maniac-en maniac-en left a comment

Choose a reason for hiding this comment

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

LGTM

@maniac-en maniac-en merged commit 00829b0 into main Aug 24, 2025
4 checks passed
@maniac-en maniac-en deleted the yash/tui-rework-p90 branch August 24, 2025 15:59
@maniac-en maniac-en restored the yash/tui-rework-p90 branch August 24, 2025 16:00
@maniac-en maniac-en changed the title feat: TUI rework; v0.1.0.alpha.2 feat: TUI rework; v0.1.0-alpha.2 Aug 24, 2025
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.

3 participants