Fix link cards navigating away from palinks #44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-link-click-redirect"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Changes
app/views/links/_link.html.erb-- title links tolink_path(link)instead oflink.urlapp/views/links/show.html.erb-- title is plain text, added "Visit" button withtarget="_blank"Test Plan
Review Checklist
Related Notes
palinks-- project this affectsPR #44 Review
DOMAIN REVIEW
Tech stack: Ruby on Rails (ERB views, resourceful routing)
Diff summary (2 files, +3/-2):
app/views/links/_link.html.erb-- link card title now routes tolink_path(link)(show page) instead oflink.url(external URL)app/views/links/show.html.erb-- title rendered as plain text; new "Visit" button opens external URL in a new tab withtarget="_blank"andrel="noopener"Correctness:
link_path(link)is valid --resources :linksinconfig/routes.rbgenerates this helper for the show action. Confirmed.rel: "noopener"on the external link is correct security practice -- prevents the opened page from accessingwindow.opener. Good.btn btn-primaryclass on the Visit button is consistent with the existingbtn btn-secondaryandbtn btn-dangerclasses already used on the show page's action buttons.Observations:
link.urltarget (line 13), confirming this branch has not been checked out locally -- the diff is the source of truth and the change is correct.URI.parse(link.url).host rescue link.urldomain display on the card partial is untouched and still provides users a visual hint of where the link goes, which is good UX alongside the new behavior.BLOCKERS
None.
The change is a two-line view-layer fix (no model, controller, or security surface changes). The BLOCKER criteria do not apply:
links_controller_sort_test.rbexists), and adding view tests for this fix would be scope creep relative to the issue.NITS
Missing
noreferreron Visit link (low): The Visit button usesrel: "noopener"but omitsnoreferrer. Addingrel: "noopener noreferrer"is a common hardening pattern that also prevents theRefererheader from being sent to the external site. Non-blocking, but worth considering.Card partial still links repo URL externally (consistency observation): The card partial's "repo" link (line 17) still navigates externally via
link.forgejo_url. This is probably intentional (repo links are a different UX intent than the title), but worth confirming the distinction is deliberate. Non-blocking.SOP COMPLIANCE
fix-link-click-redirect-- descriptive of the fix, though does not include issue number43-. Minor convention gap, non-blocking.Closes #43present in Related Notes section.PROCESS OBSERVATIONS
link_pathhelper is verified against routes.VERDICT: APPROVED