Skip to content

feat: display gocdm version in ui corners#102

Open
arran4 wants to merge 1 commit intomasterfrom
feat/display-version-8349584984254119109
Open

feat: display gocdm version in ui corners#102
arran4 wants to merge 1 commit intomasterfrom
feat/display-version-8349584984254119109

Conversation

@arran4
Copy link
Copy Markdown
Owner

@arran4 arran4 commented Apr 18, 2026

Adds the application version to the bottom right of both the login and main menu screens.


PR created automatically by Jules for task 8349584984254119109 started by @arran4

This commit passes the Version variable from the cli to the dialog UI layers.
It modifies the ShowLogin and ShowMenu function signatures to accept the version
string, wraps the TUI forms in an overarching vertical layout (tview.FlexRow),
and appends a new tview.TextView at the bottom right containing the version.
Tests have been updated to supply a default "dev" version matching the original
signatures.

Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the display of the application version in the TUI login and menu screens. Changes include updating function signatures in the cli and dialog packages to accept a version string and modifying the TUI layout to include a footer for this information. Feedback suggests improving the versionView styling by respecting the theme's background color and disabling dynamic color parsing to prevent issues with version strings containing brackets. Additionally, a bug was identified where the version footer disappears after closing the help modal because the root view is reset incorrectly.

Comment thread dialog/dialog.go
Comment on lines +101 to +110
versionView := tview.NewTextView().
SetText(version).
SetTextAlign(tview.AlignRight).
SetDynamicColors(true).
SetTextColor(tcell.ColorDarkGray)
if rc != nil {
if attr, ok := rc.Attributes["title_color"]; ok {
versionView.SetTextColor(MapColor(attr.Foreground))
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There are two improvements for the versionView styling:

  1. Background Color: The versionView background is not set to match the theme's screen_color. If a custom background is used, this will result in a black bar at the bottom of the screen.
  2. Dynamic Colors: SetDynamicColors(true) is enabled, which could cause rendering issues if the version string contains characters like [ or ] (e.g., [dev]). It is safer to leave this disabled.

Additionally, this styling logic is duplicated in dialog/login.go. Consider refactoring it into a helper function.

Suggested change
versionView := tview.NewTextView().
SetText(version).
SetTextAlign(tview.AlignRight).
SetDynamicColors(true).
SetTextColor(tcell.ColorDarkGray)
if rc != nil {
if attr, ok := rc.Attributes["title_color"]; ok {
versionView.SetTextColor(MapColor(attr.Foreground))
}
}
versionView := tview.NewTextView().
SetText(version).
SetTextAlign(tview.AlignRight).
SetTextColor(tcell.ColorDarkGray)
if rc != nil {
if attr, ok := rc.Attributes["title_color"]; ok {
versionView.SetTextColor(MapColor(attr.Foreground))
}
if attr, ok := rc.Attributes["screen_color"]; ok {
versionView.SetBackgroundColor(MapColor(attr.Background))
}
}

Comment thread dialog/dialog.go
Comment on lines +112 to +114
rootFlex := tview.NewFlex().SetDirection(tview.FlexRow).
AddItem(flex, 0, 1, true).
AddItem(versionView, 1, 1, false)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The introduction of rootFlex as the new root requires updating all existing app.SetRoot(flex, ...) calls to app.SetRoot(rootFlex, ...) to maintain the version display.

Specifically, the help modal's SetDoneFunc (around line 138 in the full file) still resets the root to flex, which will cause the version footer to disappear after the user closes the help details modal.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

medium

The introduction of rootFlex as the new root requires updating all existing app.SetRoot(flex, ...) calls to app.SetRoot(rootFlex, ...) to maintain the version display.

Specifically, the help modal's SetDoneFunc (around line 138 in the full file) still resets the root to flex, which will cause the version footer to disappear after the user closes the help details modal.

@jules

Comment thread dialog/login.go
Comment on lines +197 to +206
versionView := tview.NewTextView().
SetText(version).
SetTextAlign(tview.AlignRight).
SetDynamicColors(true).
SetTextColor(tcell.ColorDarkGray)
if rc != nil {
if attr, ok := rc.Attributes["title_color"]; ok {
versionView.SetTextColor(MapColor(attr.Foreground))
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Similar to the menu screen, the versionView here should also respect the theme's screen_color to avoid a black bar at the bottom, and SetDynamicColors(true) should be removed to prevent parsing errors with version strings containing brackets.

Suggested change
versionView := tview.NewTextView().
SetText(version).
SetTextAlign(tview.AlignRight).
SetDynamicColors(true).
SetTextColor(tcell.ColorDarkGray)
if rc != nil {
if attr, ok := rc.Attributes["title_color"]; ok {
versionView.SetTextColor(MapColor(attr.Foreground))
}
}
versionView := tview.NewTextView().
SetText(version).
SetTextAlign(tview.AlignRight).
SetTextColor(tcell.ColorDarkGray)
if rc != nil {
if attr, ok := rc.Attributes["title_color"]; ok {
versionView.SetTextColor(MapColor(attr.Foreground))
}
if attr, ok := rc.Attributes["screen_color"]; ok {
versionView.SetBackgroundColor(MapColor(attr.Background))
}
}

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.

1 participant