feat(templates): show browser/OS version and icons on active sessions#276
Merged
Conversation
- Parse the User-Agent on render so browser and OS show name over version on two lines, applied retroactively to existing sessions with no migration - Add small inline-SVG brand icons for browser and OS with monochrome glyphs and generic fallbacks, styled entirely via currentColor - Drop non-version values such as the Linux/ChromeOS architecture and bound label and version length to protect the table layout Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
@codex review |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhances the Active Sessions page (
/account/devices) so the Browser and OS columns are far more informative and polished:User-Agent(parse-on-render), so the version applies retroactively to existing sessions with no migration or data backfill. Example:Chromeover120.0.0.0,macOSover10.15.7.<svg>monochrome glyphs styled viacurrentColor(matching the existing GitHub/GitLab login icons) — no image assets, no new dependencies, single-binary friendly. They tint blue on the "This device" row.The Device column keeps its prominent boxed icon as the primary identifier; Browser/OS use a lighter 16px glyph so the visual hierarchy stays clear.
Robustness
Display values are derived from attacker-controlled
User-Agent, so the parse layer now:x86_64), markup, and other junk are suppressed (only digit-leading values are shown), so Linux sessions display justLinuxinstead of a misleadingLinux x86_64.Notes
ParsedUserAgentnow exposesBrowser/BrowserVersionandOS/OSVersionas separate fields (internalservicespackage only — not a public API).LoginSession.Browser/OScolumns remain forensic-only (display re-parses the raw UA); they store the bare name as before, so there is no schema change.Windows 10.0,macOS 10.15.7), so those values reflect what the UA reports.Testing
make generate,make fmt,golangci-lint(0 issues)go testforservices/handlers/templates: all pass🤖 Generated with Claude Code