Skip to content

Transition TUI from tview to Bubble Tea#293

Open
danvergara wants to merge 23 commits intomainfrom
bubbletea-tui
Open

Transition TUI from tview to Bubble Tea#293
danvergara wants to merge 23 commits intomainfrom
bubbletea-tui

Conversation

@danvergara
Copy link
Owner

@danvergara danvergara commented Feb 24, 2026

Transition TUI from tview to Bubble Tea

This PR introduces a significant overhaul of the terminal user interface by transitioning from tview to bubbletea. This change provides a more modern and flexible foundation for building the UI, leveraging the Elm Architecture (TEA) for better state management and component composition.

Key Changes

  • New TUI Framework: Replaced tview with bubbletea, lipgloss for styling, and bubbles for common UI components.
  • Enhanced UI Components:
    • A new SQL editor using textarea for a more natural editing experience.
    • A database tree view powered by tree-bubble for easier navigation.
    • Improved result set rendering with better table formatting and support for large data sets.
    • Asynchronous data fetching (metadata, tables, queries) to ensure the UI remains responsive during long-running operations.
  • Refactored Architecture: Updated the application's core logic in pkg/app and pkg/command to integrate with the new TUI model and handle state transitions more effectively.
  • Updated Assets: Refreshed screenshots in the screenshots/ directory to reflect the new aesthetic and layout.

The goal of this migration is to improve the maintainability of the TUI and provide a more polished, responsive, and customizable user experience for dblab.

tree-view

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Locally against local database running on containers.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings
@danvergara danvergara marked this pull request as ready for review March 17, 2026 14:25
@danvergara danvergara changed the title Bubbletea tui Transition TUI from tview to Bubble Tea Mar 17, 2026
@danvergara danvergara added the kind/enhancement New feature or request label Mar 17, 2026
Copy link

@Sirpyerre Sirpyerre left a comment

Choose a reason for hiding this comment

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

Suggestion for logo display:
The logo appears oversized and not centered within the terminal viewport. Consider reducing its dimensions and centering it to make better use of the available terminal space. This would improve the overall visual balance and readability of the output.

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

Labels

kind/enhancement New feature or request

2 participants