diff --git a/main.go b/main.go index 17b7fe5..889b607 100644 --- a/main.go +++ b/main.go @@ -76,26 +76,33 @@ var ( // renderTitleBar renders a title bar with left title and right-aligned user status func renderTitleBar(screen, username, organization string, innerWidth int) string { - leftTitle := fmt.Sprintf("GitHub Brain %s / %s", Version, screen) - var rightStatus string + leftTitle := fmt.Sprintf("GitHub Brain / %s", screen) + + // Build right side: @username ยท ๐Ÿข org ยท version + var rightParts []string if username != "" { - if organization != "" { - rightStatus = fmt.Sprintf("๐Ÿ‘ค @%s (%s)", username, organization) - } else { - rightStatus = fmt.Sprintf("๐Ÿ‘ค @%s (no org)", username) - } - } else { - rightStatus = "๐Ÿ‘ค Not logged in" + rightParts = append(rightParts, fmt.Sprintf("๐Ÿ‘ค @%s", username)) + } + if organization != "" { + rightParts = append(rightParts, fmt.Sprintf("๐Ÿข %s", organization)) + } + + // Join parts with separator + rightStatus := strings.Join(rightParts, " ยท ") + if rightStatus != "" { + rightStatus += " ยท " } leftWidth := lipgloss.Width(leftTitle) - rightWidth := lipgloss.Width(rightStatus) + versionText := Version + versionWidth := lipgloss.Width(versionText) + rightWidth := lipgloss.Width(rightStatus) + versionWidth spacing := innerWidth - leftWidth - rightWidth if spacing < 1 { spacing = 1 } - return titleStyle.Render(leftTitle) + strings.Repeat(" ", spacing) + titleStyle.Render(rightStatus) + return titleStyle.Render(leftTitle) + strings.Repeat(" ", spacing) + titleStyle.Render(rightStatus) + dimStyle.Render(versionText) } // Removed ConsoleHandler - not needed with Bubble Tea @@ -4814,7 +4821,7 @@ func (m model) View() string { } // Add title as first line of content - leftTitle := fmt.Sprintf("GitHub Brain %s / ๐Ÿ“ฅ Pull", Version) + leftTitle := fmt.Sprintf("GitHub Brain %s / ๐Ÿ”„ Pull", Version) var rightStatus string if m.username != "" { if m.organization != "" { @@ -4960,9 +4967,9 @@ func newMainMenuModel(homeDir string) mainMenuModel { return mainMenuModel{ homeDir: homeDir, choices: []menuChoice{ - {icon: "๐Ÿ”ง", name: "Setup", description: "Configure authentication and settings"}, - {icon: "๐Ÿ“ฅ", name: "Pull", description: "Sync GitHub data to local database"}, - {icon: "๐Ÿšช", name: "Quit", description: "Exit"}, + {icon: "๐Ÿ”ง", name: "Setup", description: "Configure GitHub username and organization"}, + {icon: "๐Ÿ”„", name: "Pull", description: "Sync GitHub data to local database"}, + {icon: "๐Ÿšช", name: "Quit", description: "Ctrl+C"}, }, cursor: 0, status: "Checking authentication...", @@ -5084,28 +5091,23 @@ func (m mainMenuModel) View() string { b.WriteString("\n") // Menu items + selectorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("12")) // Blue selector for i, choice := range m.choices { cursor := " " - style := dimStyle + descStyle := dimStyle if m.cursor == i { - cursor = "> " - style = selectedStyle + cursor = selectorStyle.Render("โ–ถ") + " " + descStyle = selectedStyle } - line := fmt.Sprintf("%s%s %s", cursor, choice.icon, choice.name) - if choice.description != "" { - line += " " + choice.description - } - b.WriteString(style.Render(line) + "\n") + // Pad name to 5 characters for alignment + paddedName := fmt.Sprintf("%-5s", choice.name) + // Name is always bold (titleStyle), description uses current selection style + b.WriteString(fmt.Sprintf("%s%s %s %s", cursor, choice.icon, titleStyle.Render(paddedName), descStyle.Render(choice.description))) if i < len(m.choices)-1 { - b.WriteString("\n") + b.WriteString("\n\n") } } - b.WriteString("\n") - - // Help text - b.WriteString(dimStyle.Render("Press Enter to select, Ctrl+C to quit")) - // Create border style borderStyle := lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). @@ -5457,7 +5459,7 @@ func (m orgPromptModel) View() string { var b strings.Builder - b.WriteString(titleStyle.Render(fmt.Sprintf("GitHub Brain %s / ๐Ÿ“ฅ Pull", Version)) + "\n") + b.WriteString(titleStyle.Render(fmt.Sprintf("GitHub Brain %s / ๐Ÿ”„ Pull", Version)) + "\n") b.WriteString("\n") b.WriteString(" Enter your GitHub organization:\n") b.WriteString(" " + m.textInput.View() + "\n") diff --git a/main.md b/main.md index b753120..1b2a36e 100644 --- a/main.md +++ b/main.md @@ -33,14 +33,11 @@ When `github-brain` is run without arguments, display an interactive menu: ``` โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ -โ”‚ GitHub Brain 1.0.0 / ๐Ÿ  Home ๐Ÿ‘ค Not logged in โ”‚ -โ”‚ โ”‚ -โ”‚ > ๐Ÿ”ง Setup Configure authentication and settings โ”‚ -โ”‚ ๐Ÿ“ฅ Pull Sync GitHub data to local database โ”‚ -โ”‚ ๐Ÿšช Quit Exit โ”‚ -โ”‚ โ”‚ -โ”‚ Press Enter to select, Ctrl+C to quit โ”‚ +โ”‚ GitHub Brain / ๐Ÿ  Home 1.0.0 โ”‚ โ”‚ โ”‚ +โ”‚ โ–ถ ๐Ÿ”ง Setup Configure GitHub username and organization โ”‚ +โ”‚ ๐Ÿ”„ Pull Sync GitHub data to local database โ”‚ +โ”‚ ๐Ÿšช Quit Ctrl+C โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ ``` @@ -48,14 +45,11 @@ After login but no organization configured: ``` โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ -โ”‚ GitHub Brain 1.0.0 / ๐Ÿ  Home ๐Ÿ‘ค @wham (no org) โ”‚ -โ”‚ โ”‚ -โ”‚ > ๐Ÿ”ง Setup Configure authentication and settings โ”‚ -โ”‚ ๐Ÿ“ฅ Pull Sync GitHub data to local database โ”‚ -โ”‚ ๐Ÿšช Quit Exit โ”‚ -โ”‚ โ”‚ -โ”‚ Press Enter to select, Ctrl+C to quit โ”‚ +โ”‚ GitHub Brain / ๐Ÿ  Home ๐Ÿ‘ค @wham ยท 1.0.0 โ”‚ โ”‚ โ”‚ +โ”‚ โ–ถ ๐Ÿ”ง Setup Configure GitHub username and organization โ”‚ +โ”‚ ๐Ÿ”„ Pull Sync GitHub data to local database โ”‚ +โ”‚ ๐Ÿšช Quit Ctrl+C โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ ``` @@ -63,14 +57,11 @@ After successful login with organization configured: ``` โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ -โ”‚ GitHub Brain 1.0.0 / ๐Ÿ  Home ๐Ÿ‘ค @wham (my-org) โ”‚ -โ”‚ โ”‚ -โ”‚ ๐Ÿ”ง Setup Configure authentication and settings โ”‚ -โ”‚ > ๐Ÿ“ฅ Pull Sync GitHub data to local database โ”‚ -โ”‚ ๐Ÿšช Quit Exit โ”‚ -โ”‚ โ”‚ -โ”‚ Press Enter to select, Ctrl+C to quit โ”‚ +โ”‚ GitHub Brain / ๐Ÿ  Home ๐Ÿ‘ค @wham ยท ๐Ÿข my-org ยท 1.0.0 โ”‚ โ”‚ โ”‚ +โ”‚ ๐Ÿ”ง Setup Configure GitHub username and organization โ”‚ +โ”‚ โ–ถ ๐Ÿ”„ Pull Sync GitHub data to local database โ”‚ +โ”‚ ๐Ÿšช Quit Ctrl+C โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ ``` @@ -78,14 +69,14 @@ After successful login with organization configured: The title bar contains: -- Left side: `GitHub Brain / ` -- Right side: `๐Ÿ‘ค ` (right-aligned) +- Left side: `GitHub Brain / ` +- Right side: `๐Ÿ‘ค @ ยท ๐Ÿข ยท ` (right-aligned, version in dim style) -User status values: +Right side components (shown only when available): -- `๐Ÿ‘ค Not logged in` - No GITHUB_TOKEN in .env or token invalid -- `๐Ÿ‘ค @username (no org)` - Token valid but no organization configured -- `๐Ÿ‘ค @username (org)` - Token and organization configured +- `๐Ÿ‘ค @username` - Shown when logged in +- `๐Ÿข org` - Shown when organization is configured +- `` - Always shown, in dim style ### Menu Navigation @@ -93,13 +84,13 @@ User status values: - Press Enter to select - Press Esc to go back (in submenus) - Press Ctrl+C to quit -- Highlight current selection with `>` +- Highlight current selection with `โ–ถ` (blue) ### Menu Items 1. **๐Ÿ”ง Setup** - Opens the setup submenu (see [Setup Menu](#setup-menu) section) -2. **๐Ÿ“ฅ Pull** - Runs the pull operation (see [pull](#pull) section) -3. **๐Ÿšช Quit** - Exit the application +2. **๐Ÿ”„ Pull** - Runs the pull operation (see [pull](#pull) section) +3. **๐Ÿšช Quit** - Exit the application (Ctrl+C) ### Default Selection @@ -388,7 +379,7 @@ Console at the beginning of pull: ``` โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ -โ”‚ GitHub Brain 1.0.0 / ๐Ÿ“ฅ Pull ๐Ÿ‘ค @wham (my-org) โ”‚ +โ”‚ GitHub Brain 1.0.0 / ๐Ÿ”„ Pull ๐Ÿ‘ค @wham (my-org) โ”‚ โ”‚ โ”‚ โ”‚ ๐Ÿ“‹ Repositories โ”‚ โ”‚ ๐Ÿ“‹ Discussions โ”‚ @@ -412,7 +403,7 @@ Console during first item pull: ``` โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ -โ”‚ GitHub Brain 1.0.0 / ๐Ÿ“ฅ Pull ๐Ÿ‘ค @wham (my-org) โ”‚ +โ”‚ GitHub Brain 1.0.0 / ๐Ÿ”„ Pull ๐Ÿ‘ค @wham (my-org) โ”‚ โ”‚ โ”‚ โ”‚ โ ‹ Repositories: 1,247 โ”‚ โ”‚ ๐Ÿ“‹ Discussions โ”‚ @@ -436,7 +427,7 @@ Console when first item completes: ``` โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ -โ”‚ GitHub Brain 1.0.0 / ๐Ÿ“ฅ Pull ๐Ÿ‘ค @wham (my-org) โ”‚ +โ”‚ GitHub Brain 1.0.0 / ๐Ÿ”„ Pull ๐Ÿ‘ค @wham (my-org) โ”‚ โ”‚ โ”‚ โ”‚ โœ… Repositories: 2,847 โ”‚ โ”‚ โ ™ Discussions: 156 โ”‚ @@ -460,7 +451,7 @@ Console when an error occurs: ``` โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ -โ”‚ GitHub Brain 1.0.0 / ๐Ÿ“ฅ Pull ๐Ÿ‘ค @wham (my-org) โ”‚ +โ”‚ GitHub Brain 1.0.0 / ๐Ÿ”„ Pull ๐Ÿ‘ค @wham (my-org) โ”‚ โ”‚ โ”‚ โ”‚ โœ… Repositories: 2,847 โ”‚ โ”‚ โŒ Discussions: 156 (errors) โ”‚ @@ -1317,7 +1308,7 @@ Download the appropriate archive for your platform from [releases](https://githu ```bash # Specific version -curl -L https://github.com/wham/github-brain/releases/download/v1.2.3/github-brain-darwin-arm64.tar.gz | tar xz +curl -L https://github.com/wham/github-brain/releases/download/v1.2.3/github-brain-darwin-arm64.tar.gz ยท tar xz ``` ## Code Quality