Skip to content

Fix link stories View button to external URL#1320

Merged
maebeale merged 2 commits intomainfrom
maebeale/stories-external-url-btn
Mar 4, 2026
Merged

Fix link stories View button to external URL#1320
maebeale merged 2 commits intomainfrom
maebeale/stories-external-url-btn

Conversation

@maebeale
Copy link
Collaborator

@maebeale maebeale commented Mar 3, 2026

What is the goal of this PR and why is this important?

  • The stories index "View" button previously always linked to the internal show page (with no_redirect), even for stories with an external URL
  • This was inconsistent with the card links, which redirect to the external URL
  • Admins had no way to distinguish between viewing the external content and viewing internal story details

How did you approach the change?

  • When a story has an external URL, the "View" button now links directly to that URL (opens in new tab), matching card behavior
  • Added an admin-only "Details" button (styled with admin-only bg-blue-100) that links to the internal show page with no_redirect: true, so admins can still access the show page
  • For stories without an external URL, behavior is unchanged — "View" links to the show page
  • Added request specs covering external link handling for admin and regular user roles

UI Testing Checklist

  • Stories index: story with external URL shows "View" linking to external URL (opens in new tab)
  • Stories index: story with external URL shows admin-only "Details" button linking to show page
  • Stories index: story without external URL shows "View" linking to show page (no "Details" button)
  • Stories index: regular user sees "View" for external stories but not "Details"

Anything else to add?

  • Named the admin button "Details" rather than "Show" to better communicate its purpose

🤖 Generated with Claude Code

maebeale and others added 2 commits March 3, 2026 08:46
- View button now links directly to the external URL (opening in a
  new tab) for stories with a website_url, matching card behavior
- Added admin-only "Details" button so admins can still access the
  internal show page when an external URL is present
- Added request specs covering external link handling for both admin
  and regular user roles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
show? allows regular users to see published stories, so the Details
button was appearing for non-admins. Switch to edit? which requires
admin, consistent with the Edit button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maebeale maebeale requested a review from jmilljr24 March 4, 2026 12:41
@maebeale maebeale changed the title Link stories View button to external URL Fix link stories View button to external URL Mar 4, 2026
@maebeale maebeale merged commit 724372c into main Mar 4, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/stories-external-url-btn branch March 4, 2026 14:04
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