Skip to content

feat: display hostname in session header and sidebar#889

Open
jonocodes wants to merge 3 commits intoslopus:mainfrom
jonocodes:feature/hostname-display
Open

feat: display hostname in session header and sidebar#889
jonocodes wants to merge 3 commits intoslopus:mainfrom
jonocodes:feature/hostname-display

Conversation

@jonocodes
Copy link

@jonocodes jonocodes commented Mar 19, 2026

Summary

  • Show hostname alongside working directory in the session header subtitle (e.g. lute:~/projects/myapp)
  • Show hostname in active session rows in the sidebar (ActiveSessionsGroup)
  • Update getSessionSubtitle to include hostname prefix for historical session items in the sidebar

Screenshots

Before
image

After
image

Implementation

  • New machineDisplay.ts — pure utility with no React dependencies, 17 passing tests
  • getMachineDisplayName() priority: Machine.displayName > short hostname > session.metadata.host
  • SessionView.tsx — hostname integrated into header subtitle
  • ActiveSessionsGroup.tsx — hostname subtitle line added to CompactSessionRow
  • sessionUtils.tsgetSessionSubtitle now returns hostname:~/path format

Test plan

  • Open a session — verify hostname:~/path appears in the header subtitle
  • Check sidebar active sessions — verify hostname appears below session title
  • Check sidebar historical sessions — verify subtitle shows hostname:~/path
  • Verify graceful fallback when no hostname available (shows just ~/path)
  • Unit tests: vitest run sources/utils/machineDisplay.spec.ts (17/17 passing)

🤖 Generated with Claude Code

jonocodes and others added 3 commits March 17, 2026 13:49
- Add getMachineDisplayName() in new machineDisplay.ts utility
- Pure function with no React dependencies, fully testable
- Integrate hostname into SessionView subtitle
- Format: hostname:~/path/to/dir
- Respects Machine.displayName for custom names
- 17 passing tests following existing patterns

Closes slopus#870

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Add hostname subtitle to active session rows in ActiveSessionsGroup
- Update getSessionSubtitle to return "hostname:~/path" format
- Consistent with hostname display already added to session header

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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