From 6353ca582d144deaef9ddd0ecb1250fa48b27bcc Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 20 Nov 2026 20:17:48 +0000 Subject: [PATCH] Show the knet1. prefix and share one 24px link target. Wrap the invite prefix in code so its dot stays part of the token, and replace the repeated min-height classes with km-text-link-target, including the about and contact links. Co-authored-by: Rodrigo --- src/app/(home)/_components/about-contact.tsx | 6 +- .../(home)/_components/benchmark-results.tsx | 2 +- .../(home)/_components/network-section.tsx | 19 +++-- src/app/(home)/_components/quick-start.tsx | 2 +- src/app/(home)/page.tsx | 22 ++--- src/app/global.css | 7 ++ tests/homepage-network.test.mjs | 27 ++++++ tests/text-link-target.test.mjs | 85 +++++++++++++++++++ 8 files changed, 143 insertions(+), 27 deletions(-) create mode 100644 tests/text-link-target.test.mjs diff --git a/src/app/(home)/_components/about-contact.tsx b/src/app/(home)/_components/about-contact.tsx index cfbbf7d..a7f709a 100644 --- a/src/app/(home)/_components/about-contact.tsx +++ b/src/app/(home)/_components/about-contact.tsx @@ -20,10 +20,10 @@ export function AboutContact() { . Written in Rust and released under the MIT and Apache-2.0 licenses.

- + Source code → - + Related projects →
@@ -42,7 +42,7 @@ export function AboutContact() { href={links.linkedin} target="_blank" rel="noopener noreferrer" - className="km-text-link" + className="km-text-link km-text-link-target" > LinkedIn (opens in a new tab) diff --git a/src/app/(home)/_components/benchmark-results.tsx b/src/app/(home)/_components/benchmark-results.tsx index aaca79a..197a346 100644 --- a/src/app/(home)/_components/benchmark-results.tsx +++ b/src/app/(home)/_components/benchmark-results.tsx @@ -36,7 +36,7 @@ export function BenchmarkResults() { All results and methodology → diff --git a/src/app/(home)/_components/network-section.tsx b/src/app/(home)/_components/network-section.tsx index f2a1109..f5cdadd 100644 --- a/src/app/(home)/_components/network-section.tsx +++ b/src/app/(home)/_components/network-section.tsx @@ -1,12 +1,21 @@ import Link from "next/link"; +import type { ReactNode } from "react"; import { NetworkDiagram } from "./network-diagram"; -const FLOW = [ +const FLOW: readonly { + title: string; + command: string; + detail: ReactNode; +}[] = [ { title: "Invite", command: "kimetsu network invite --name laptop", - detail: - "A creates the invite. The code starts with knet1. The default name is friends. Nothing is listening yet.", + detail: ( + <> + A creates the invite. The code starts with knet1. The + default name is friends. Nothing is listening yet. + + ), }, { title: "Join", @@ -19,7 +28,7 @@ const FLOW = [ detail: "A runs share while B runs kimetsu network request. If discovery misses A, pass the peer: line share printed.", }, -] as const; +]; export function NetworkSection() { return ( @@ -45,7 +54,7 @@ export function NetworkSection() {
Read the Network guide diff --git a/src/app/(home)/_components/quick-start.tsx b/src/app/(home)/_components/quick-start.tsx index 1ac0c3c..48389d9 100644 --- a/src/app/(home)/_components/quick-start.tsx +++ b/src/app/(home)/_components/quick-start.tsx @@ -49,7 +49,7 @@ export function QuickStart() {

All installation options → diff --git a/src/app/(home)/page.tsx b/src/app/(home)/page.tsx index bdb21f4..f57416c 100644 --- a/src/app/(home)/page.tsx +++ b/src/app/(home)/page.tsx @@ -42,34 +42,22 @@ export default function HomePage() { Kimetsu

diff --git a/src/app/global.css b/src/app/global.css index b25cdbc..7e6c7f7 100644 --- a/src/app/global.css +++ b/src/app/global.css @@ -219,6 +219,13 @@ html { text-underline-offset: 4px; } +/* 24px target for standalone text links. Kept off .km-text-link so prose links stay inline. */ +.km-text-link-target { + display: inline-flex; + min-height: 24px; + align-items: center; +} + .km-text-link:hover { text-decoration: underline; } diff --git a/tests/homepage-network.test.mjs b/tests/homepage-network.test.mjs index 9038431..c748e44 100644 --- a/tests/homepage-network.test.mjs +++ b/tests/homepage-network.test.mjs @@ -114,6 +114,33 @@ test("documents the network result tables and links them from the index", () => assert.match(results, /RTX 5060 Ti 16 GB/); }); +test("keeps the invite prefix dot inside a code token", () => { + const invite = section + .match(/A creates the invite\.[\s\S]*?Nothing is listening yet\./)?.[0] + .replace(/\s+/g, " "); + assert.equal( + invite, + "A creates the invite. The code starts with knet1. The default name is friends. Nothing is listening yet.", + ); + assert.equal( + section.includes("On B, membership is saved. Nothing is listening."), + true, + ); + assert.equal( + section.includes( + "A runs share while B runs kimetsu network request. If discovery misses A, pass the peer: line share printed.", + ), + true, + ); + for (const command of [ + 'command: "kimetsu network invite --name laptop"', + 'command: "kimetsu network join "', + 'command: "kimetsu network share"', + ]) { + assert.equal(section.includes(command), true, command); + } +}); + test("does not repeat install commands in the network section", () => { for (const command of [ "kimetsu plugin install grok-bot", diff --git a/tests/text-link-target.test.mjs b/tests/text-link-target.test.mjs new file mode 100644 index 0000000..5c7977a --- /dev/null +++ b/tests/text-link-target.test.mjs @@ -0,0 +1,85 @@ +import assert from "node:assert/strict"; +import { readFile } from "node:fs/promises"; +import test from "node:test"; + +const css = await readFile( + new URL("../src/app/global.css", import.meta.url), + "utf8", +); + +const sources = { + benchmarks: await readFile( + new URL( + "../src/app/(home)/_components/benchmark-results.tsx", + import.meta.url, + ), + "utf8", + ), + network: await readFile( + new URL( + "../src/app/(home)/_components/network-section.tsx", + import.meta.url, + ), + "utf8", + ), + quickStart: await readFile( + new URL("../src/app/(home)/_components/quick-start.tsx", import.meta.url), + "utf8", + ), + page: await readFile( + new URL("../src/app/(home)/page.tsx", import.meta.url), + "utf8", + ), + about: await readFile( + new URL("../src/app/(home)/_components/about-contact.tsx", import.meta.url), + "utf8", + ), +}; + +const repeatedTarget = "inline-flex min-h-[24px] items-center"; + +test("defines one tap-target utility beside km-text-link", () => { + const linkStart = css.indexOf(".km-text-link {"); + const linkRule = css.slice(linkStart, css.indexOf("}", linkStart) + 1); + assert.equal(linkRule.includes("inline-flex"), false); + assert.equal(linkRule.includes("min-height"), false); + assert.match( + css, + /\.km-text-link-target\s*\{[^}]*display:\s*inline-flex;[^}]*min-height:\s*24px;[^}]*align-items:\s*center;[^}]*\}/s, + ); +}); + +test("replaces the repeated min-height class string with the utility", () => { + for (const [name, source] of Object.entries(sources)) { + assert.equal(source.includes(repeatedTarget), false, name); + } + assert.equal(sources.benchmarks.match(/km-text-link-target/g)?.length, 1); + assert.equal(sources.network.match(/km-text-link-target/g)?.length, 1); + assert.equal(sources.quickStart.match(/km-text-link-target/g)?.length, 1); + assert.equal(sources.page.match(/km-text-link-target/g)?.length, 5); + assert.match( + sources.quickStart, + /className="km-text-link km-text-link-target mt-4"/, + ); + assert.match( + sources.benchmarks, + /href="\/docs\/network\/results" className="km-text-link"/, + ); + assert.equal(sources.benchmarks.includes("km-text-link mt-auto pt-6"), true); +}); + +test("gives the about and contact links the same 24px target", () => { + assert.match( + sources.about, + /href=\{links\.github\}[^>]*className="km-text-link km-text-link-target"[^>]*>\s*Source code →/, + ); + assert.match( + sources.about, + /href="\/projects"[^>]*className="km-text-link km-text-link-target"[^>]*>\s*Related projects →/, + ); + assert.match( + sources.about, + /href=\{links\.linkedin\}[\s\S]*?className="km-text-link km-text-link-target"[\s\S]*?LinkedIn/, + ); + assert.equal(sources.about.match(/km-text-link-target/g)?.length, 3); +});