-
Notifications
You must be signed in to change notification settings - Fork 0
Make AI agent time clickable link to user profile #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -354,6 +354,27 @@ func (s *CCStatuslineTestSuite) TestFormatStatuslineOutput_SessionCostWithoutLin | |||||||||
| assert.NotContains(s.T(), output, "coding-agent/session/") | ||||||||||
| } | ||||||||||
|
|
||||||||||
| func (s *CCStatuslineTestSuite) TestFormatStatuslineOutput_TimeWithProfileLink() { | ||||||||||
| output := formatStatuslineOutput("claude-opus-4", 1.23, 4.56, 3661, 75.0, "main", false, nil, nil, "testuser", "https://shelltime.xyz", "session-abc123") | ||||||||||
|
|
||||||||||
| // Should contain OSC8 link wrapping time section to user profile | ||||||||||
| assert.Contains(s.T(), output, "shelltime.xyz/users/testuser") | ||||||||||
| assert.Contains(s.T(), output, "1h1m") | ||||||||||
| } | ||||||||||
|
|
||||||||||
| func (s *CCStatuslineTestSuite) TestFormatStatuslineOutput_TimeWithoutProfileLink() { | ||||||||||
| // No userLogin - should not have profile link on time | ||||||||||
| output := formatStatuslineOutput("claude-opus-4", 1.23, 4.56, 3661, 75.0, "main", false, nil, nil, "", "https://shelltime.xyz", "session-abc123") | ||||||||||
| assert.Contains(s.T(), output, "1h1m") | ||||||||||
| // 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//") | ||||||||||
|
Comment on lines
+369
to
+371
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment on line 370 is misleading because when
Suggested change
|
||||||||||
|
|
||||||||||
| // 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") | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test case for an empty assert.Contains(s.T(), output, "1h1m")
assert.NotContains(s.T(), output, "/users/testuser") |
||||||||||
| } | ||||||||||
|
|
||||||||||
| func (s *CCStatuslineTestSuite) TestFormatStatuslineOutput_WithQuota() { | ||||||||||
| fh := 45.0 | ||||||||||
| sd := 23.0 | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent potential issues with double slashes in the generated URL if
webEndpointhas a trailing slash, it's safer to normalize it before formatting the string. Usingstrings.TrimSuffixwill 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.