Skip to content

wip: feat: add TUI w/ bubbletea support - #790

Draft
floreks wants to merge 6 commits into
mainfrom
feat/bubbletea-rewrite
Draft

wip: feat: add TUI w/ bubbletea support#790
floreks wants to merge 6 commits into
mainfrom
feat/bubbletea-rewrite

Conversation

@floreks

@floreks floreks commented Jul 29, 2026

Copy link
Copy Markdown
Member
  • Add assets.go to embed terminal cell logo for CLI
  • Implement core authentication types and interfaces in bridge/types.go
  • Develop CLI state reading logic in bridge/welcome/local.go
  • Add unit tests for welcome package functionality
  • Create access management infrastructure in bridge/access/local.go
  • Include diagnostics view tests in tui/screens/diagnostics
  • Establish access management and tests in bridge/access/access.go
  • Add TUI models for diagnostics and access screens

Summary

Labels

Test Plan

Checklist

  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • I have added relevant labels to this PR to help with categorization for release notes.

- Add `assets.go` to embed terminal cell logo for CLI
- Implement core authentication types and interfaces in `bridge/types.go`
- Develop CLI state reading logic in `bridge/welcome/local.go`
- Add unit tests for `welcome` package functionality
- Create access management infrastructure in `bridge/access/local.go`
- Include diagnostics view tests in `tui/screens/diagnostics`
- Establish access management and tests in `bridge/access/access.go`
- Add TUI models for diagnostics and access screens
@floreks
floreks marked this pull request as draft July 29, 2026 06:21
@floreks floreks changed the title feat: add TUI w/ bubbletea support wip: feat: add TUI w/ bubbletea support Jul 29, 2026
@socket-security

socket-security Bot commented Jul 29, 2026

Copy link
Copy Markdown

Comment on lines +131 to +132
if err := s.repository.Save(ctx, state); err != nil {
_ = s.credentials.Delete(ctx, profile.ID)

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.

P1 Rollback deletes existing credentials

When an existing app or console profile is updated and the registry save fails, the preceding Set has already overwritten its credential and this rollback deletes it entirely, leaving the retained profile unable to authenticate until the user logs in again.

Comment on lines +151 to +153
if msg.err == nil {
m.snapshot = msg.snapshot
}

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.

P1 Reload leaves cursors out of bounds

When a reload returns fewer profiles or console profiles, this handler replaces the snapshot without clamping the existing cursors; the next confirm indexes the shorter slice with the stale cursor and panics.

Suggested change
if msg.err == nil {
m.snapshot = msg.snapshot
}
if msg.err == nil {
m.snapshot = msg.snapshot
m.appCursor = clampCursor(m.appCursor, len(m.snapshot.State.Profiles))
m.consoleCursor = clampCursor(m.consoleCursor, len(m.snapshot.State.ConsoleProfiles))
}

Comment on lines +254 to +255
case keyActionPreviousPanel:
m.panel = (m.panel + 1) % 2

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.

P2 Previous panel moves forward

The previous-panel action increments the panel exactly like the next-panel action, so Shift+Tab cannot navigate panels in reverse.

Suggested change
case keyActionPreviousPanel:
m.panel = (m.panel + 1) % 2
case keyActionPreviousPanel:
m.panel = (m.panel - 1 + 2) % 2

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a Bubble Tea terminal interface and supporting authentication/access infrastructure.

  • Registers the new plural tui command and adds welcome, access, and diagnostics screens.
  • Introduces context-aware authentication orchestration, credential storage, profile migration, and service-account impersonation.
  • Adds reusable TUI components, themes, embedded assets, golden fixtures, and unit tests.

Confidence Score: 2/5

The credential rollback and stale-cursor panic need to be fixed before merging; reverse panel navigation also behaves incorrectly.

Failed profile updates can remove an existing credential, and loading a shorter profile list leaves stale cursors that panic when the user confirms a selection.

Files Needing Attention: pkg/bridge/access/access.go, tui/screens/access/model.go

Important Files Changed

Filename Overview
pkg/bridge/access/access.go Adds access-profile orchestration, but failed saves can delete credentials belonging to existing profiles.
pkg/bridge/access/local.go Adds owner-only atomic registry persistence and one-time migration of legacy app and console profiles.
pkg/bridge/credentials.go Adds keyring-backed credential storage with a permission-restricted filesystem fallback.
pkg/bridge/auth.go Moves device login, identity resolution, impersonation, and access-token exchange behind a context-aware service.
pkg/common/common.go Migrates existing login flows onto the bridge authentication service while retaining legacy persistence behavior.
tui/screens/access/model.go Implements access-screen state handling, but reloads can leave invalid cursors that panic on confirmation and reverse panel navigation moves in the wrong direction.
tui/app/model.go Adds top-level TUI routing, sizing, and quit/cancellation handling.
cmd/command/tui/tui.go Wires production welcome and access dependencies into the new explicit TUI command.

Reviews (1): Last reviewed commit: "feat: initialize Plural CLI authenticati..." | Re-trigger Greptile

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