dblab icon indicating copy to clipboard operation
dblab copied to clipboard

Migrate completely to bubbletea

Open danvergara opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

dblab relies on a fork of gocui which has been pretty inactive for 3 years, now. So, I think it's time to migrate completely to bubbletea.

Describe the solution you'd like

I'm proposing a complete rewrite of the UI adopting bubbletea and ditching gocui. Can't guarantee that dblab is gonna look the same, maybe a bit similar to what we have today.

Describe alternatives you've considered

There's no alternative, it's only bubbletea.

Additional context If I manage to pull it off, I may improve the text input capabilities of dblab to improve the experience of typing really long queries.

To migrate successfuly to bubbletea, I need to scope out a new plan to migrate to buubletea.

First off, it;s necessary to list the components of the current UI and see if bubbletea offers similar widgets.

UI Components:

  1. List of tables
  2. Navigation table
  3. Text input (where uses type queries)
  4. Resultset View
  5. Pagination widget

Description of each component

List of tables

This the widget where the available tables are listed. The user can switch to this view and press enter on any to list the first items of that list.

Navigation table

This a widget that shows a menu that displays four options:

  • Rows that displays the first records on a selected table
  • Structure that displays the structure of the selected table
  • Constraints that shows the constraints on a given table
  • Indexes that displays the indexes on a selected table

The user can switch between tabs using key bidings.

Text input

This might be the simplest component right now. It only accepts text and execute queries by pressing ctrl + Space. It could be more complex if I add autocomplete capabilities.

Resultset view

This is where the resultsets are displayed, it highly relies on tables widgets to work. Any kind of migrations should respect current key bindings to navigate through it.

Pagination widget

This is used to navigate through the pages given an offset.

danvergara avatar May 08 '24 03:05 danvergara