feat: add related tools section to tool pages - #103
Conversation
There was a problem hiding this comment.
Hey @varun-pahuja, nice work on this! Code looks clean and thanks for the screenshots in both themes.
One thing before I merge. The lists same-category tools first, in registry order test checks the exact list ["jwt-decoder", "base64", "invoice-generator"]. We have 7 new-tool issues open right now and each one adds a DeveloperApplication tool at the end of TOOLS. So once the first one gets merged, json-formatter's third related tool changes and this test starts failing for everyone after that.
Can you move that exact-order check to your mini registry? Or on the real registry, just check that the first two are jwt-decoder and base64. The invoice-generator test has the same problem (it assumes there's no other business tool), so same fix there.
Also thanks for pointing out the Maximum update depth exceeded error in CommandPalette.tsx, I'll check that one separately.
Let me know if you have any questions.
|
Thanks @anurag629, good catch! Pushed 8de94c4: the exact-order checks now run against small mini registries passed through the The new CI run is waiting for approval when you have a moment. Ready for another look! |
anurag629
left a comment
There was a problem hiding this comment.
Hey @varun-pahuja, looks great, thanks for the quick fix! Running the exact-order checks on the mini registries is exactly what I had in mind, and CI is green. Merging this now.


What and why
Tool pages only linked home. This adds a small Related tools block to the
shared tool page layout so every tool page surfaces 2–3 relevant sibling tools
with descriptive, keyword-rich anchors (the tool name) — internal links that
spread authority and keep visitors on-site. Closes #40.
lib/tools.ts: deterministicgetRelatedTools(currentSlug, limit = 3, tools = TOOLS)— same
applicationCategoryfirst, then the rest of the registry in declarationorder, excluding the current tool; unknown slug returns
[]; no randomness.components/shared/ToolPageLayout.tsx:// Related toolsheading +<nav aria-label="Related tools">grid, placed after the FAQ and before theCTA banner. Anchor text is the tool name;
cardDescriptionsits under it,clamped to 2 lines. Existing tokens only (
card,--fg,--fg-muted,--fg-dim,--cyan) — no hardcoded colors, so light and dark themes areunaffected.
Type of change
Checklist
npm run lint && npm run test && npm run buildpasses locallylib/and have a test inlib/__tests__/Notes for reviewers
Exact results under Node v22.23.3 (matches
.nvmrc):npm run lint→ 0 errors, 13 warnings (identical to unmodifieddevelop)npm run test→ 5 files, 34 tests passed (baseline: 4 files / 27; the 7 new tests covergetRelatedTools)npm run build→ exit 0Red/green:
lib/__tests__/tools-related.test.tsfails 7/7 on theunmodified tree (the helper doesn't exist yet) and passes 7/7 with this
change. Verified at 375px viewport: cards stack full-width, no horizontal
overflow (
document.scrollWidth === window.innerWidth).Screenshots (3 tool pages × light and dark, plus 375px mobile) are attached below.
The
Maximum update depth exceededconsole error fromCommandPalette.tsxalso occurs on unmodified
developand is unrelated to this change.