wip: feat: add TUI w/ bubbletea support - #790
Conversation
- 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
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| if err := s.repository.Save(ctx, state); err != nil { | ||
| _ = s.credentials.Delete(ctx, profile.ID) |
There was a problem hiding this comment.
| if msg.err == nil { | ||
| m.snapshot = msg.snapshot | ||
| } |
There was a problem hiding this comment.
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.
| 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)) | |
| } |
| case keyActionPreviousPanel: | ||
| m.panel = (m.panel + 1) % 2 |
There was a problem hiding this comment.
The previous-panel action increments the panel exactly like the next-panel action, so Shift+Tab cannot navigate panels in reverse.
| 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 SummaryAdds a Bubble Tea terminal interface and supporting authentication/access infrastructure.
Confidence Score: 2/5The 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
|
| 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
assets.goto embed terminal cell logo for CLIbridge/types.gobridge/welcome/local.gowelcomepackage functionalitybridge/access/local.gotui/screens/diagnosticsbridge/access/access.goSummary
Labels
Test Plan
Checklist