Skip to content

feat: refactor see more links#157

Merged
nikilok merged 2 commits into
mainfrom
feat/see-more-search
Jun 9, 2026
Merged

feat: refactor see more links#157
nikilok merged 2 commits into
mainfrom
feat/see-more-search

Conversation

@nikilok

@nikilok nikilok commented Jun 9, 2026

Copy link
Copy Markdown
Owner
  • creating a unified component so we don't have to replicate styling

Summary by CodeRabbit

  • New Features

    • Introduced a reusable "See more on" link component featuring glass-pill styling for outbound links.
  • Improvements

    • Updated company details page to use the new component for GOV.UK, Google, and LinkedIn links, ensuring consistent visual design and behavior across all external navigation points.

- creating a unified component so we don't have to replicate styling
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
learn-tanstack-start Ready Ready Preview, Comment Jun 9, 2026 11:00am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@nikilok, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 43 minutes and 54 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 13d982b0-e52e-4692-bc89-03db29df516d

📥 Commits

Reviewing files that changed from the base of the PR and between 23e1fed and bfbfb6e.

📒 Files selected for processing (3)
  • apps/web/src/components/BingLogo.tsx
  • apps/web/src/components/DuckDuckGoLogo.tsx
  • apps/web/src/routes/company.$id.$slug.tsx
📝 Walkthrough

Walkthrough

This PR introduces a reusable SeeMoreLink component for styled external links and refactors the company profile route to use it, replacing inline anchor tags for GOV.UK, Google, and LinkedIn links while maintaining conditional rendering logic and accessibility attributes.

Changes

SeeMoreLink Component Extraction and Integration

Layer / File(s) Summary
SeeMoreLink component definition
apps/web/src/components/SeeMoreLink.tsx
New SeeMoreLink component renders a glass-pill styled external anchor with configurable href, optional logo (ReactNode), optional label, and ariaLabel, enforces safe external link attributes, and includes an ExternalLink icon.
Route integration and link refactoring
apps/web/src/routes/company.$id.$slug.tsx
Company profile route imports SeeMoreLink and replaces inline external link markup: GOV.UK link is conditionally rendered only when company_number exists with brand/logo controlled by flagState.govukBranded; Google and LinkedIn links are rendered with searchQuery-driven hrefs and displayName-based ariaLabels.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • nikilok/learn-tanstack-start#150: Addresses the same company_number guard for the GOV.UK link in the "See more on" section with similar conditional rendering logic.
  • nikilok/learn-tanstack-start#145: Also modifies the LinkedIn "See more on" external link in the company profile route, which is now refactored to use the new SeeMoreLink component.

Poem

🐰 A link component hops along,
With style and safety, clear and strong,
External pills in glass-y dress,
External links now say "see more"—
No more repetitive anchor lore! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing a reusable SeeMoreLink component and refactoring existing see more links to use it.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/see-more-search

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 and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/src/routes/company`.$id.$slug.tsx:
- Around line 434-442: The GOV.UK SeeMoreLink is missing an explicit accessible
name; update the SeeMoreLink invocation (the component named SeeMoreLink where
flagState.govukBranded and GovUkLogo are used, referencing
profile.company_number) to include an ariaLabel prop (e.g. "View company details
on GOV.UK") so the link has a descriptive accessible name regardless of
flagState.govukBranded or the SVG internals.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 065b98bf-c89b-4633-a4e6-d2d71ad61f5d

📥 Commits

Reviewing files that changed from the base of the PR and between 34ec93d and 23e1fed.

📒 Files selected for processing (2)
  • apps/web/src/components/SeeMoreLink.tsx
  • apps/web/src/routes/company.$id.$slug.tsx

Comment on lines +434 to +442
<SeeMoreLink
href={`https://find-and-update.company-information.service.gov.uk/company/${profile.company_number}`}
target="_blank"
rel="noopener noreferrer"
className="glass inline-flex w-fit items-center gap-2 rounded-full px-5 py-2.5 text-sm font-medium text-black no-underline transition-[box-shadow]! duration-300! dark:text-white"
>
{flagState.govukBranded ? (
<GovUkLogo className="h-5 w-auto" />
) : (
'GOV.UK'
)}
<ExternalLink size={14} aria-hidden="true" />
</a>
logo={
flagState.govukBranded ? (
<GovUkLogo className="h-5 w-auto" />
) : undefined
}
label={flagState.govukBranded ? undefined : 'GOV.UK'}
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add ariaLabel for consistency and accessibility.

The GOV.UK link omits the ariaLabel prop while the Google and LinkedIn links below include descriptive aria labels. When flagState.govukBranded is true and only the logo is displayed, the link's accessible name relies entirely on the SVG's internal accessibility attributes.

For consistency and to ensure a clear, descriptive accessible name regardless of the branding flag state, provide an explicit ariaLabel such as "View company details on GOV.UK".

♿ Suggested fix
 <SeeMoreLink
   href={`https://find-and-update.company-information.service.gov.uk/company/${profile.company_number}`}
   logo={
     flagState.govukBranded ? (
       <GovUkLogo className="h-5 w-auto" />
     ) : undefined
   }
   label={flagState.govukBranded ? undefined : 'GOV.UK'}
+  ariaLabel="View company details on GOV.UK"
 />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/routes/company`.$id.$slug.tsx around lines 434 - 442, The GOV.UK
SeeMoreLink is missing an explicit accessible name; update the SeeMoreLink
invocation (the component named SeeMoreLink where flagState.govukBranded and
GovUkLogo are used, referencing profile.company_number) to include an ariaLabel
prop (e.g. "View company details on GOV.UK") so the link has a descriptive
accessible name regardless of flagState.govukBranded or the SVG internals.

- Yes privacy related search gives users options
@nikilok nikilok merged commit 457fd0a into main Jun 9, 2026
5 checks passed
@nikilok nikilok deleted the feat/see-more-search branch June 9, 2026 11: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.

1 participant