Skip to content

Commit 8d00418

Browse files
Spring cleaning (#1074)
* fix: use owner/repo format for project badges Updates badge URLs to use GitHub-style owner/repo format (e.g., "hackclub/hackatime") instead of project names. This ensures compatibility with external badge services that expect repository paths. Changes: - Add Repository#full_path method to get owner/repo format - Update settings controller to pass both display names and repo paths - Update Badges component to display project names but use repo paths in URLs * fix: improve user lookup in API v1 stats endpoint Use the robust lookup_user method for username parameter in the /api/v1/stats endpoint to ensure consistent user lookup across all API endpoints. This properly handles Slack UIDs (HCA IDs), numeric user IDs, and usernames in the correct priority order. * fix: reduce clutter on new user homepage Simplify the new user experience by: - Removing redundant "Hello friend" text from setup notice (header already provides context) - Hiding GitHub link banner when setup notice is shown to focus user on primary action This reduces visual clutter and helps new users focus on completing setup first. * fix: enable full app layout for new OAuth application page Remove layout=false directive that was preventing the app header and navigation from appearing on the new OAuth application creation page. * fix: add antigravity editor to docs Add documentation for Antigravity, a VSCode fork from Google with built-in AI features. Includes setup instructions for tracking time with Hackatime using the WakaTime extension. * fix: improve stat card subtitle positioning Remove absolute positioning from subtitle text to allow it to flow naturally after the main value. This prevents the subtitle from being pushed to the bottom when other cards have longer content. * fix: align settings action buttons to card end on larger screens Remove width constraint from footer to allow action buttons to align to the right edge of the full card width instead of being constrained to a narrower container. * fix: improve heartbeat importer visibility on light themes Update import provider cards and radio buttons to have better contrast on light themes: - Use bg-surface-100 instead of bg-darker for better card visibility - Increase radio button border thickness and use darker border color - Add hover and focus states for better interactivity * Split up settings controller + perf + goal display * Make stat card subtitles larger * Fix AG + VS Code * Remove Shiba refs * Bundle update
1 parent 49ea531 commit 8d00418

29 files changed

Lines changed: 568 additions & 415 deletions

.claude/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"includeCoAuthoredBy": false,
3+
"gitAttribution": false,
4+
"attribution": {
5+
"commits": false,
6+
"pullRequests": false
7+
}
8+
}

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Read @AGENTS.md

Gemfile.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ GEM
8282
ast (2.4.3)
8383
autotuner (1.1.0)
8484
aws-eventstream (1.4.0)
85-
aws-partitions (1.1225.0)
85+
aws-partitions (1.1226.0)
8686
aws-sdk-core (3.243.0)
8787
aws-eventstream (~> 1, >= 1.3.0)
8888
aws-partitions (~> 1, >= 1.992.0)
@@ -337,7 +337,7 @@ GEM
337337
net-ssh (>= 5.0.0, < 8.0.0)
338338
net-smtp (0.5.1)
339339
net-protocol
340-
net-ssh (7.3.0)
340+
net-ssh (7.3.1)
341341
nio4r (2.7.5)
342342
nokogiri (1.19.1-aarch64-linux-gnu)
343343
racc (~> 1.4)
@@ -357,7 +357,7 @@ GEM
357357
faraday (>= 1.0, < 3.0)
358358
faraday-net_http_persistent
359359
net-http-persistent
360-
oj (3.16.15)
360+
oj (3.16.16)
361361
bigdecimal (>= 3.0)
362362
ostruct (>= 0.2)
363363
ostruct (0.6.3)
@@ -548,8 +548,8 @@ GEM
548548
bigdecimal
549549
concurrent-ruby (~> 1.0, >= 1.0.2)
550550
logger
551-
skylight (7.0.0)
552-
activesupport (>= 7.1.0)
551+
skylight (7.1.0)
552+
activesupport (>= 7.2.0)
553553
slack-ruby-client (3.1.0)
554554
faraday (>= 2.0.1)
555555
faraday-mashify
@@ -588,12 +588,12 @@ GEM
588588
tailwindcss-rails (4.4.0)
589589
railties (>= 7.0.0)
590590
tailwindcss-ruby (~> 4.0)
591-
tailwindcss-ruby (4.2.0)
592-
tailwindcss-ruby (4.2.0-aarch64-linux-gnu)
593-
tailwindcss-ruby (4.2.0-aarch64-linux-musl)
594-
tailwindcss-ruby (4.2.0-arm64-darwin)
595-
tailwindcss-ruby (4.2.0-x86_64-linux-gnu)
596-
tailwindcss-ruby (4.2.0-x86_64-linux-musl)
591+
tailwindcss-ruby (4.2.1)
592+
tailwindcss-ruby (4.2.1-aarch64-linux-gnu)
593+
tailwindcss-ruby (4.2.1-aarch64-linux-musl)
594+
tailwindcss-ruby (4.2.1-arm64-darwin)
595+
tailwindcss-ruby (4.2.1-x86_64-linux-gnu)
596+
tailwindcss-ruby (4.2.1-x86_64-linux-musl)
597597
thor (1.5.0)
598598
thruster (0.1.19)
599599
thruster (0.1.19-aarch64-linux)

app/controllers/api/hackatime/v1/hackatime_controller.rb

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,39 @@ def push_heartbeats
4646
def status_bar_today
4747
Time.use_zone(@user.timezone) do
4848
hbt = @user.heartbeats.today
49+
total_seconds = hbt.duration_seconds
50+
51+
# Check if user has a daily goal
52+
daily_goal = @user.goals.find_by(period: "day")
53+
4954
result = {
5055
data: {
5156
grand_total: {
52-
text: @user.format_extension_text(hbt.duration_seconds),
53-
total_seconds: hbt.duration_seconds
57+
text: @user.format_extension_text(total_seconds),
58+
total_seconds: total_seconds
5459
}
5560
}
5661
}
62+
63+
# Include goal information if daily goal exists
64+
if daily_goal
65+
goal_progress = ProgrammingGoalsProgressService.new(user: @user, goals: [ daily_goal ]).call.first
66+
67+
if goal_progress
68+
# Append goal progress to the user's preferred text format
69+
user_text = result[:data][:grand_total][:text]
70+
goal_text = ApplicationController.helpers.short_time_simple(daily_goal.target_seconds)
71+
72+
result[:data][:grand_total][:text] = "#{user_text} / #{goal_text} today"
73+
result[:data][:goal] = {
74+
target_seconds: daily_goal.target_seconds,
75+
tracked_seconds: goal_progress[:tracked_seconds],
76+
completion_percent: goal_progress[:completion_percent],
77+
complete: goal_progress[:complete]
78+
}
79+
end
80+
end
81+
5782
render json: result
5883
end
5984
end

app/controllers/api/v1/stats_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def show
1212

1313
query = Heartbeat.where(time: start_date..end_date)
1414
if params[:username].present?
15-
user = User.find_by(username: params[:username]) || User.find_by(slack_uid: params[:username])
15+
user = lookup_user(params[:username])
1616
return render json: { error: "User not found" }, status: :not_found unless user
1717

1818
query = query.where(user_id: user.id)

app/controllers/docs_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class DocsController < InertiaController
1111
].freeze
1212

1313
ALL_EDITORS = [
14-
[ "Android Studio", "android-studio" ], [ "AppCode", "appcode" ], [ "Aptana", "aptana" ],
15-
[ "Arduino IDE", "arduino-ide" ], [ "Azure Data Studio", "azure-data-studio" ],
14+
[ "Android Studio", "android-studio" ], [ "Antigravity", "antigravity" ], [ "AppCode", "appcode" ],
15+
[ "Aptana", "aptana" ], [ "Arduino IDE", "arduino-ide" ], [ "Azure Data Studio", "azure-data-studio" ],
1616
[ "Brackets", "brackets" ],
1717
[ "C++ Builder", "c++-builder" ],
1818
[ "CLion", "clion" ], [ "Cloud9", "cloud9" ], [ "Coda", "coda" ],

app/controllers/settings/access_controller.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ def render_access(status: :ok)
3737
)
3838
end
3939

40+
def section_props
41+
api_key_token = @user.api_keys.last&.token
42+
43+
{
44+
settings_update_path: my_settings_access_path,
45+
user: user_props,
46+
options: options_props,
47+
paths: paths_props,
48+
config_file: {
49+
content: generated_wakatime_config(api_key_token),
50+
has_api_key: api_key_token.present?,
51+
empty_message: "No API key is available yet. Rotate your API key to generate one.",
52+
api_key: api_key_token,
53+
api_url: "https://#{request.host_with_port}/api/hackatime/v1"
54+
}
55+
}
56+
end
57+
4058
def access_params
4159
params.require(:user).permit(:hackatime_extension_text_type)
4260
end

app/controllers/settings/badges_controller.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,13 @@ def show
55
settings_update_path: my_settings_profile_path
66
)
77
end
8+
9+
private
10+
11+
def section_props
12+
{
13+
options: options_props,
14+
badges: badges_props
15+
}
16+
end
817
end

0 commit comments

Comments
 (0)