Skip to content

Log in to Datum Cloud without leaving the console#194

Merged
scotwells merged 3 commits into
mainfrom
feat/tui-console-login-overlay
May 18, 2026
Merged

Log in to Datum Cloud without leaving the console#194
scotwells merged 3 commits into
mainfrom
feat/tui-console-login-overlay

Conversation

@scotwells

@scotwells scotwells commented May 18, 2026

Copy link
Copy Markdown
Contributor

What's new

Before this change, opening the console without an active session showed a generic error with no clear path forward. Now:

  • A welcome screen greets you with a clear prompt to log in — no more dead ends
  • Log in without leaving the console — press [l] to start a device authorization flow right inside the TUI
  • Follow the link or let the console open it — press [b] to open the verification URL in your browser automatically
  • Seamless handoff on success — once authenticated, the context picker opens so you can get straight to work

The sidebar and status bar adapt throughout the login flow so hints are always relevant to what you're doing.

Demo

welcome-to-datumctl.mov

Test plan

  • Open datumctl console without logging in — verify the welcome screen appears
  • Press [l] — verify the device auth overlay appears with a verification URL
  • Press [b] — verify the URL opens in a browser
  • Complete login in the browser — verify the context picker opens automatically
  • Open datumctl console with an active session — verify normal console experience is unchanged

🤖 Generated with Claude Code

scotwells and others added 3 commits May 18, 2026 12:58
When the console detects ErrNoActiveUser, it now shows a full-screen
welcome page (ASCII art, four service tiers, Datum wordmark) instead of
a generic error card. Pressing [l] starts an in-TUI device authorization
flow via a new overlay — the user can visit the verification URL or open
it with [b]; on success the context picker opens automatically. The
sidebar is hidden and status bar hints are replaced with login-specific
shortcuts throughout the unauthenticated state.

Adds StartDeviceAuth/FinishDeviceAuth to authutil for callers that need
to drive the device flow step-by-step, and a quiet flag to completeLogin
so TUI-initiated logins don't print to stdout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Plumb auth hostname from config through console.go → NewAppModel → LoginOverlayModel so staging and other non-production endpoints are respected
- Fix device auth goroutines to accept and use program context instead of context.Background()
- Remove dead loginCompletedMsg type and its handler
- Dispatch LoadResourceTypesCmd after successful login so the console is ready if the user dismisses the context picker
- Delete notLoggedIn field, SetNotLoggedIn, renderNotLoggedInPanel, and renderServicesArt from ResourceTableModel — the welcome screen in AppModel.View() supersedes them
- Collapse redundant welcome/base variable in unauthenticated View() path
- Use SanitizeErrMsg for overlay error display to prevent layout breaks from long network errors
- Fix import group ordering so github.com/pkg/browser sorts after charm.land imports
- Replace inline ✓/✗ literals with loginSuccessGlyph/loginFailGlyph named constants
- Remove double blank lines in resourcetable.go

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…viceAuth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scotwells
scotwells merged commit 15bb16e into main May 18, 2026
4 checks passed
@scotwells
scotwells deleted the feat/tui-console-login-overlay branch May 18, 2026 20:10
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