Skip to content

Fix dashboard links not working when there is a trailing slash in the URL#2499

Merged
emmadesilva merged 2 commits into
masterfrom
fix-dashboard-links-not-working-when-there-is-a-trailing-slash
Jul 4, 2026
Merged

Fix dashboard links not working when there is a trailing slash in the URL#2499
emmadesilva merged 2 commits into
masterfrom
fix-dashboard-links-not-working-when-there-is-a-trailing-slash

Conversation

@emmadesilva

@emmadesilva emmadesilva commented Jul 4, 2026

Copy link
Copy Markdown
Member

Fixes hydephp/realtime-compiler#31. Tested it fixes the issue and that it handles both standard and pretty URLs.

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e2c0d70) to head (5127885).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##              master     #2499   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity      1615      1615           
===========================================
  Files            169       169           
  Lines           4074      4074           
===========================================
  Hits            4074      4074           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes broken links in the Realtime Compiler dashboard when the dashboard is accessed with a trailing slash (e.g. /dashboard/), by ensuring preview links resolve from the site root instead of relative to the dashboard path.

Changes:

  • Added DashboardController helpers to generate root-relative preview links for pages and media assets.
  • Updated the dashboard Blade template to use the new helpers for page “View” links and media preview/fullscreen URLs.
  • Added a regression test that renders the dashboard under /dashboard/ and asserts generated links are root-relative.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/realtime-compiler/tests/RealtimeCompilerTest.php Adds a regression test validating dashboard links remain root-relative when accessed via /dashboard/.
packages/realtime-compiler/src/Http/DashboardController.php Introduces link-normalization helpers to generate root-relative preview URLs.
packages/realtime-compiler/resources/dashboard.blade.php Switches page/media preview URLs to use controller helpers instead of relative paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@emmadesilva emmadesilva merged commit 00d3407 into master Jul 4, 2026
19 checks passed
@emmadesilva emmadesilva deleted the fix-dashboard-links-not-working-when-there-is-a-trailing-slash branch July 4, 2026 01:33
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.

Dashboard links not working from /dashboard/ route

2 participants