Skip to content

Make AI agent time clickable link to user profile#220

Merged
AnnatarHe merged 1 commit intomainfrom
claude/add-statusline-profile-link-DqZlk
Feb 10, 2026
Merged

Make AI agent time clickable link to user profile#220
AnnatarHe merged 1 commit intomainfrom
claude/add-statusline-profile-link-DqZlk

Conversation

@AnnatarHe
Copy link
Copy Markdown
Contributor

@AnnatarHe AnnatarHe commented Feb 10, 2026

Summary

Enhanced the statusline output to make the AI agent session time display a clickable link to the user's profile page when both user login and web endpoint information are available.

Changes

  • Modified formatStatuslineOutput() to wrap the session time display with an OSC8 hyperlink to the user's profile page ({webEndpoint}/users/{userLogin})
  • The link is only added when both userLogin and webEndpoint parameters are non-empty
  • Added comprehensive test coverage for the new functionality:
    • TestFormatStatuslineOutput_TimeWithProfileLink: Verifies the profile link is created when both parameters are provided
    • TestFormatStatuslineOutput_TimeWithoutProfileLink: Ensures no malformed links are created when either parameter is missing

Implementation Details

  • Uses the existing wrapOSC8Link() utility function to create terminal-compatible hyperlinks
  • Maintains backward compatibility - the time display remains unchanged visually, only the underlying link behavior is added
  • The magenta-colored time indicator (⏱️) now serves as a clickable navigation element to the user's profile

https://claude.ai/code/session_01GihLQR12WQ9guABhJT59ts


Open with Devin

Wrap the ⏱️ time section with an OSC8 link to the user's profile page
at {webEndpoint}/users/{userLogin}, allowing users to click the time
display to view their status on shelltime.xyz.

https://claude.ai/code/session_01GihLQR12WQ9guABhJT59ts
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @AnnatarHe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience by making the AI agent session time in the statusline interactive. Users can now directly access their profile page by clicking on the session time, provided the necessary user and endpoint information is present. This change improves navigation and accessibility within the application.

Highlights

  • Clickable AI Agent Time: The AI agent session time displayed in the statusline is now a clickable link.
  • User Profile Navigation: Clicking the session time navigates to the user's profile page, constructed from webEndpoint and userLogin.
  • Conditional Linking: The profile link is only generated if both userLogin and webEndpoint are available, preventing malformed links.
  • Enhanced Test Coverage: New unit tests were added to ensure correct behavior for both the presence and absence of the profile link.
Changelog
  • commands/cc_statusline.go
    • Implemented conditional logic to wrap the AI agent session time with an OSC8 hyperlink to the user's profile.
  • commands/cc_statusline_test.go
    • Added TestFormatStatuslineOutput_TimeWithProfileLink to verify correct link generation.
    • Added TestFormatStatuslineOutput_TimeWithoutProfileLink to confirm links are not created when data is missing.
Activity
  • No specific activity (comments, reviews, progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@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 enhances the statusline by making the AI agent session time a clickable link to the user's profile. The changes are well-contained and include corresponding tests. My review focuses on improving the robustness of the URL construction to prevent potential malformed links and on strengthening the new test cases to ensure they are more precise and cover all relevant scenarios.

Comment thread commands/cc_statusline.go
if sessionSeconds > 0 {
timeStr := color.Magenta.Sprintf("⏱️ %s", formatSessionDuration(sessionSeconds))
if userLogin != "" && webEndpoint != "" {
url := fmt.Sprintf("%s/users/%s", webEndpoint, userLogin)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To prevent potential issues with double slashes in the generated URL if webEndpoint has a trailing slash, it's safer to normalize it before formatting the string. Using strings.TrimSuffix will ensure the URL is always correctly formed.

This would be a good improvement for the other URL constructions in this function as well for consistency.

Suggested change
url := fmt.Sprintf("%s/users/%s", webEndpoint, userLogin)
url := fmt.Sprintf("%s/users/%s", strings.TrimSuffix(webEndpoint, "/"), userLogin)

Comment on lines +369 to +371
// The time section should not contain a link to users/ profile
// Count occurrences of "shelltime.xyz/users/" - should only be in session cost and daily cost links
assert.NotContains(s.T(), output, "shelltime.xyz/users//")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The comment on line 370 is misleading because when userLogin is empty, no user-specific links (including for session and daily cost) should be generated at all. Additionally, the assertion on line 371 is weak as it only checks for a double slash. A more robust test would be to assert that no /users/ path is present in the output, confirming that no user-specific link was created.

Suggested change
// The time section should not contain a link to users/ profile
// Count occurrences of "shelltime.xyz/users/" - should only be in session cost and daily cost links
assert.NotContains(s.T(), output, "shelltime.xyz/users//")
assert.NotContains(s.T(), output, "shelltime.xyz/users/")


// No webEndpoint - should not have profile link on time
output = formatStatuslineOutput("claude-opus-4", 1.23, 4.56, 3661, 75.0, "main", false, nil, nil, "testuser", "", "session-abc123")
assert.Contains(s.T(), output, "1h1m")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This test case for an empty webEndpoint is missing an assertion to verify that no link is actually generated. To make the test more complete, you should add an assertion to check that the user profile link is not present in the output.

assert.Contains(s.T(), output, "1h1m")
	assert.NotContains(s.T(), output, "/users/testuser")

@AnnatarHe AnnatarHe merged commit c67291c into main Feb 10, 2026
6 of 7 checks passed
@AnnatarHe AnnatarHe deleted the claude/add-statusline-profile-link-DqZlk branch February 10, 2026 12:38
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