Add username + profile link to sidebar#1138
Conversation
Greptile SummaryThis PR adds the current user's
Confidence Score: 4/5Safe to merge — small, well-guarded UI change with no logic risk The change is minimal and correct: username is properly nil-guarded in Svelte, the URL format matches the app routes, and the TypeScript type is accurate. Minor concerns: no tests for the new nav prop, and a pre-existing profile URL bug in settings/base_controller.rb is surfaced (but not introduced) by this PR. No files in this PR need special attention; the pre-existing URL bug is in Important Files Changed
Sequence DiagramsequenceDiagram
participant B as Browser
participant IC as InertiaController
participant AL as AppLayout (Svelte)
participant H as hackati.me
B->>IC: GET page request
IC->>AL: Inertia props (nav.current_user includes username)
AL->>B: Renders sidebar with @username profile link
B->>H: User clicks → GET /@username
H->>B: Returns public profile page
Prompt To Fix All With AIThis is a comment left during a code review.
Path: app/javascript/layouts/AppLayout.svelte
Line: 317-318
Comment:
**Inconsistent profile URL format elsewhere in codebase**
This PR correctly uses `https://hackati.me/@${username}` which matches the `/@:username` route pattern defined in `config/routes.rb:309`. However, `app/controllers/settings/base_controller.rb:164` builds `profile_url` without the `@`:
```ruby
profile_url: (@user.username.present? ? "https://hackati.me/#{@user.username}" : nil)
```
This produces `https://hackati.me/username` (no `@` prefix), which doesn't match any defined route and would result in a 404. That line should be updated to:
```ruby
profile_url: (@user.username.present? ? "https://hackati.me/@#{@user.username}" : nil)
```
This is a pre-existing bug surfaced by this PR's addition of the correct URL format.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: app/controllers/inertia_controller.rb
Line: 138
Comment:
**No tests for new nav prop**
The PR adds `username` to the Inertia nav props but doesn't include any tests verifying that this field is present and correctly passed through. Per project conventions, new functionality should include test coverage. A basic controller or integration test asserting `username` is present in the nav props would improve confidence in this change.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat: show username in sidebar" | Re-trigger Greptile |
Before:
After: