Skip to content

Preserve Gigs tab in URL hash#385

Merged
michaelmwu merged 1 commit into
mainfrom
michaelmwu/gigs-leads-stable-hash
Jul 11, 2026
Merged

Preserve Gigs tab in URL hash#385
michaelmwu merged 1 commit into
mainfrom
michaelmwu/gigs-leads-stable-hash

Conversation

@michaelmwu

@michaelmwu michaelmwu commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Persist the Gigs/Leads selection in the dashboard URL (#gigs or #leads).
  • Restore the selected tab on page refresh and respond to browser hash changes.
  • Regenerate the committed dashboard bundle and cover the refresh flow with Playwright.

Why

Refreshing the Gigs dashboard previously always returned users to Gigs, even after they had selected Leads. The URL now carries that state so it survives reloads and can be shared.

Validation

  • bun run typecheck
  • bun run lint
  • bun run test
  • bun run build
  • uv run pytest tests/integration/test_dashboard_playwright.py -q
  • Commit hooks: Ruff, Ruff format, and Pyrefly

Note

Low Risk
Client-only URL hash and tab state in the admin dashboard; no API, auth, or data-model changes in this diff.

Overview
The admin Gigs view now keeps the Gigs vs Leads sub-tab in the URL (#gigs or #leads) so reloads and shared links reopen the same tab.

Tab changes go through selectGigTab, which updates React state and uses history.replaceState on the hash. Initial state and in-app navigation (without a push) read the hash via gigTabFromHash, and a hashchange listener keeps the UI in sync when the hash changes. Posting a lead still switches back to Gigs but now updates the hash as well. The committed dashboard Vite manifest points at the rebuilt bundle asset.

Reviewed by Cursor Bugbot for commit fe50583. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Jul 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_35100384-3f33-4516-b63c-cdbc372bc883)

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@michaelmwu, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cbf86951-6b0e-493f-bdb6-893dcb9f5e7d

📥 Commits

Reviewing files that changed from the base of the PR and between 596ab11 and fe50583.

📒 Files selected for processing (6)
  • apps/admin_dashboard/src/main.tsx
  • apps/api/src/five08/backend/static/dashboard/.vite/manifest.json
  • apps/api/src/five08/backend/static/dashboard/assets/index-LL0oAOC_.js
  • apps/api/src/five08/backend/static/dashboard/assets/index-_nigGMGP.js
  • apps/api/src/five08/backend/static/dashboard/index.html
  • tests/integration/test_dashboard_playwright.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch michaelmwu/gigs-leads-stable-hash

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05ebf34037

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2367 to +2368
const onHashChange = () => setActiveGigTab(gigTabFromHash())
window.addEventListener("hashchange", onHashChange)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep tab state in sync when routes clear the hash

When a user is on /dashboard/gigs#leads, navigates to another dashboard view, and then returns to Gigs via the sidebar, navigate() clears the hash with history.pushState(...); pushState does not dispatch a hashchange event, so this listener never resets activeGigTab. The page can therefore render the Leads tab at /dashboard/gigs, and refreshing or sharing that visible URL flips back to the Gigs tab instead of preserving the current state.

Useful? React with 👍 / 👎.

@cursor

cursor Bot commented Jul 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_1d3fd9b7-8865-45c4-bdd8-b9429167f3e0)

@michaelmwu
michaelmwu added this pull request to the merge queue Jul 11, 2026
Merged via the queue into main with commit 01e91bf Jul 11, 2026
13 checks passed
@michaelmwu
michaelmwu deleted the michaelmwu/gigs-leads-stable-hash branch July 11, 2026 06:17
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.

1 participant