Skip to content

Update header information#65

Merged
gtsiolis merged 3 commits intomainfrom
george/update-header
Mar 3, 2026
Merged

Update header information#65
gtsiolis merged 3 commits intomainfrom
george/update-header

Conversation

@gtsiolis
Copy link
Member

@gtsiolis gtsiolis commented Mar 3, 2026

See DES-152 for more context.

BEFORE AFTER
Screenshot 2026-03-03 at 15 20 18 Screenshot 2026-03-03 at 15 16 57

@gtsiolis gtsiolis self-assigned this Mar 3, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8530bc and a6fad93.

📒 Files selected for processing (11)
  • internal/config/containers.go
  • internal/ui/app.go
  • internal/ui/app_test.go
  • internal/ui/components/header.go
  • internal/ui/components/header_test.go
  • internal/ui/components/testdata/header.golden
  • internal/ui/run.go
  • internal/ui/run_login.go
  • internal/ui/run_login_test.go
  • internal/ui/run_logout.go
  • internal/ui/styles/styles.go

📝 Walkthrough

Walkthrough

Adds ContainerConfig.DisplayName() with an emulator name map, and threads emulator name + endpoint through the UI by expanding NewApp/NewHeader signatures and updating header rendering, tests, run entrypoints, and golden output. Also removes two exported style variables.

Changes

Cohort / File(s) Summary
Container Display Names
internal/config/containers.go
Added emulatorDisplayNames map and func (c *ContainerConfig) DisplayName() string.
UI App / Run Entrypoints
internal/ui/app.go, internal/ui/run.go, internal/ui/run_login.go, internal/ui/run_logout.go
Changed NewApp signature to accept (version, emulatorName, endpoint string, cancel func()) and updated call sites to pass emulatorName/endpoint (derived from config or empty).
UI Tests (App / Run)
internal/ui/app_test.go, internal/ui/run_login_test.go
Updated tests to the new NewApp arity, supplying empty strings or values before the cancel callback.
Header Component & Tests
internal/ui/components/header.go, internal/ui/components/header_test.go
Added emulatorName and endpoint fields; updated NewHeader(version, emulatorName, endpoint) and View rendering to include those fields and trim trailing spaces.
Header Golden Data
internal/ui/components/testdata/header.golden
Updated golden output to reflect new header lines (emulator name and host) and reordered labels.
Styles Cleanup
internal/ui/styles/styles.go
Removed exported Title and Version style variables from the styles package.

Sequence Diagram(s)

sequenceDiagram
  participant Run as "run.go / entrypoint"
  participant Config as "config"
  participant App as "internal/ui.NewApp"
  participant Header as "internal/ui/components.Header"
  Run->>Config: read container/config (emulator, endpoint)
  Config-->>Run: emulatorName, endpoint
  Run->>App: NewApp(version, emulatorName, endpoint, cancel)
  App->>Header: NewHeader(version, emulatorName, endpoint)
  Header-->>App: Header component (renders view with emulator & host)
  App-->>Run: UI starts / program.Run()
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • carole-lavillonniere
  • anisaoshafi
🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Update header information' is vague and generic, using non-descriptive terms that don't convey meaningful information about what specifically changed in the header. Use a more specific title that describes the actual changes, such as 'Add emulator name and endpoint to header display' or 'Update header to show emulator info and display name'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description references DES-152 and includes before/after screenshots showing header output changes, which is directly related to the changeset's modifications of header display information.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch george/update-header

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/ui/run_logout.go (1)

18-18: Consider the header rendering with all empty strings.

Passing empty strings for version, emulatorName, and endpoint will result in a sparse header display (e.g., "lstk ()" with empty lines below). This may be intentional for the logout flow, but worth confirming the rendered output looks acceptable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/ui/run_logout.go` at line 18, The header is being constructed with
empty strings by calling NewApp("", "", "", cancel), which renders
sparse/awkward header text; either pass real values (e.g., pass the module's
version, emulatorName, and endpoint variables) into NewApp instead of empty
strings, or update NewApp to treat empty version/emulatorName/endpoint as
“hidden” (skip rendering those lines) so calling NewApp("", "", "", cancel)
produces a compact logout header; locate the NewApp call in run_logout.go and
adjust the caller or the NewApp rendering logic accordingly (reference:
NewApp(version, emulatorName, endpoint, cancel) and the header-rendering code
inside NewApp).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/ui/run.go`:
- Around line 33-40: The endpoint construction can produce a trailing colon when
cfg.Containers[0].Port is empty; update the logic where emulatorName and
endpoint are set (before calling NewApp) to check cfg.Containers[0].Port and
only append ":<port>" when non-empty (or substitute a sensible default port),
e.g., read cfg via config.Get(), get cfg.Containers[0].Port, and build endpoint
conditionally so endpoint is either "localhost.localstack.cloud" or
"localhost.localstack.cloud:<port>" before passing it into NewApp.

---

Nitpick comments:
In `@internal/ui/run_logout.go`:
- Line 18: The header is being constructed with empty strings by calling
NewApp("", "", "", cancel), which renders sparse/awkward header text; either
pass real values (e.g., pass the module's version, emulatorName, and endpoint
variables) into NewApp instead of empty strings, or update NewApp to treat empty
version/emulatorName/endpoint as “hidden” (skip rendering those lines) so
calling NewApp("", "", "", cancel) produces a compact logout header; locate the
NewApp call in run_logout.go and adjust the caller or the NewApp rendering logic
accordingly (reference: NewApp(version, emulatorName, endpoint, cancel) and the
header-rendering code inside NewApp).

ℹ️ Review info

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ac17a7 and 64df2f7.

📒 Files selected for processing (11)
  • internal/config/containers.go
  • internal/ui/app.go
  • internal/ui/app_test.go
  • internal/ui/components/header.go
  • internal/ui/components/header_test.go
  • internal/ui/components/testdata/header.golden
  • internal/ui/run.go
  • internal/ui/run_login.go
  • internal/ui/run_login_test.go
  • internal/ui/run_logout.go
  • internal/ui/styles/styles.go
💤 Files with no reviewable changes (1)
  • internal/ui/styles/styles.go

Copy link
Member

@silv-io silv-io left a comment

Choose a reason for hiding this comment

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

LGTM! Just a bit of weirdness in the final header rendering and the extraction of the Container metadata

@gtsiolis gtsiolis force-pushed the george/update-header branch from e8530bc to a6fad93 Compare March 3, 2026 16:43
@gtsiolis gtsiolis requested a review from anisaoshafi as a code owner March 3, 2026 16:43
@gtsiolis gtsiolis merged commit 1cccd38 into main Mar 3, 2026
6 of 7 checks passed
@gtsiolis gtsiolis deleted the george/update-header branch March 3, 2026 16:44
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