Skip to content

Fix PR and issue detail tab titles#176

Merged
stylessh merged 1 commit intomainfrom
stylessh/fix-pr-tab-titles
Apr 23, 2026
Merged

Fix PR and issue detail tab titles#176
stylessh merged 1 commit intomainfrom
stylessh/fix-pr-tab-titles

Conversation

@stylessh
Copy link
Copy Markdown
Owner

@stylessh stylessh commented Apr 23, 2026

Summary

Fix stale browser tab titles on PR, review, and issue detail pages so they update to the fetched entity title instead of staying on fallback labels like PR #N.

Changes

  • add a shared usePageTitle hook that applies formatPageTitle once detail data is loaded
  • use the hook in PR detail, PR review, and issue detail pages so the tab title reflects the actual PR or issue title after client-side fetches
  • add regression coverage for formatPageTitle

Test Plan

  • pnpm --filter @diffkit/dashboard exec vitest run src/lib/seo.test.ts
  • pnpm --filter @diffkit/dashboard check-types

Screenshots

Not applicable.

Before After
`PR #N DiffKitorIssue #N

Summary by CodeRabbit

  • New Features

    • Dynamic browser tab titles now reflect the issue or pull request being viewed, providing better context while navigating between pages. Review pages display "Review: " prefix for clarity.
  • Tests

    • Added test coverage for page title formatting functionality, verifying proper formatting with app name suffix.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a82c82e-2d52-4efa-9656-1d0051d737d3

📥 Commits

Reviewing files that changed from the base of the PR and between 6c2b8f0 and 50e5498.

📒 Files selected for processing (5)
  • apps/dashboard/src/components/issues/detail/issue-detail-page.tsx
  • apps/dashboard/src/components/pulls/detail/pull-detail-page.tsx
  • apps/dashboard/src/components/pulls/review/review-page.tsx
  • apps/dashboard/src/lib/seo.test.ts
  • apps/dashboard/src/lib/use-page-title.ts

📝 Walkthrough

Walkthrough

Introduces page title handling across issue detail, pull request detail, and pull request review pages by creating a new usePageTitle hook that dynamically updates the browser tab title based on fetched issue or PR data. No existing data fetching or control flow logic is altered.

Changes

Cohort / File(s) Summary
Page Title Hook
apps/dashboard/src/lib/use-page-title.ts
New exported hook that accepts a title string and updates document.title via formatPageTitle whenever the title changes.
Page Components
apps/dashboard/src/components/issues/detail/issue-detail-page.tsx, apps/dashboard/src/components/pulls/detail/pull-detail-page.tsx, apps/dashboard/src/components/pulls/review/review-page.tsx
Imported and invoked usePageTitle hook to dynamically set page titles based on issue/PR data; review page prefixes title with "Review: ".
SEO Tests
apps/dashboard/src/lib/seo.test.ts
Added test suite for formatPageTitle to verify it appends `"

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

tembo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: fixing tab titles for PR and issue detail pages to display actual entity titles instead of fallback labels.
Description check ✅ Passed The description is well-structured and complete, covering the summary, changes, test plan with verification checkmarks, and before/after context despite screenshots not being applicable.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stylessh/fix-pr-tab-titles

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

@coderabbitai coderabbitai Bot added the tembo Pull request created by Tembo label Apr 23, 2026
@stylessh stylessh merged commit ab16402 into main Apr 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tembo Pull request created by Tembo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant