From abd749a3388a47875a98cd574952b862a0f5817f Mon Sep 17 00:00:00 2001
From: Nick Gomez <122398915+nick-inkeep@users.noreply.github.com>
Date: Sun, 28 Jun 2026 00:57:53 -0700
Subject: [PATCH] fix: fit pack and UI card descriptions to ~2 lines (#2232)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: fit pack and UI card descriptions to ~2 lines
Long card descriptions overflowed their cards. Shorten the codebase-wiki
starter pack and the slash-command MirrorSource/Mirror block previews, and
line-clamp the description text on the starter-pack picker, slash-command
preview, Navigator launcher cards, and share-receive dialog so any long
description truncates cleanly. Add a registry test capping pack descriptions
to the picker two-line budget. Regenerate Lingui catalogs.
* test: cap slash-command preview descriptions at the line-clamp-3 budget
Mirrors the STARTER_PACKS 64-char budget test for the slash-command
PREVIEW_CONFIG descriptions (line-clamped to 3 lines in SlashCommandMenu).
Asserts each resolved preview.description from getComponentItems() is
<= 120 chars, with a guard against a false green if resolution stops
yielding strings. Addresses the review's consistency suggestion.
* fix: drop redundant owner/repo from the share-receive clone card
The clone-card description repeated the owner/repo that the dialog header
already shows in full (the Repository metadata row) and restated the card
title's action — and that interpolated value was the only thing that
overflowed for long repo names. Make it a short static line, parallel to
the local card ('Pick the folder where you've cloned it.'); line-clamp-2
stays as a backstop. Removes the now-unused shareOwner/shareRepo consts.
GitOrigin-RevId: 2f1ff5cf0220e6b6ffa6442920f2b7e3cccf1d3e
---
.changeset/fit-card-descriptions.md | 5 +++++
packages/app/src/components/NavigatorApp.tsx | 2 +-
packages/app/src/components/PackCardGrid.tsx | 4 +++-
packages/app/src/components/ShareReceiveDialog.tsx | 10 +++-------
.../src/editor/slash-command/SlashCommandMenu.tsx | 2 +-
.../editor/slash-command/component-items.test.ts | 12 ++++++++++++
.../src/editor/slash-command/component-items.tsx | 4 ++--
packages/app/src/locales/en/messages.json | 14 +++++++-------
packages/app/src/locales/en/messages.po | 12 ++++++------
packages/app/src/locales/pseudo/messages.json | 14 +++++++-------
packages/app/src/locales/pseudo/messages.po | 6 +++---
packages/server/src/seed/starter.test.ts | 8 ++++++++
packages/server/src/seed/starter.ts | 2 +-
13 files changed, 59 insertions(+), 36 deletions(-)
create mode 100644 .changeset/fit-card-descriptions.md
diff --git a/.changeset/fit-card-descriptions.md b/.changeset/fit-card-descriptions.md
new file mode 100644
index 00000000..e1bf19e9
--- /dev/null
+++ b/.changeset/fit-card-descriptions.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+Stop starter-pack and other card descriptions from overflowing their cards. The "Codebase wiki" starter pack and the slash-command MirrorSource / Mirror block previews had descriptions long enough to wrap to many lines and stretch their cards; those are now concise. The description text on the starter-pack picker, the slash-command block preview, the Navigator project-launcher cards, and the share-receive dialog is now line-clamped, so any long description truncates cleanly instead of distorting the layout.
diff --git a/packages/app/src/components/NavigatorApp.tsx b/packages/app/src/components/NavigatorApp.tsx
index d1625713..40376673 100644
--- a/packages/app/src/components/NavigatorApp.tsx
+++ b/packages/app/src/components/NavigatorApp.tsx
@@ -356,7 +356,7 @@ function NavigatorCard({ title, description, onClick, dataTestId, Icon }: Naviga
{Icon ?
{pack.description}
++ {pack.description} +
); diff --git a/packages/app/src/components/ShareReceiveDialog.tsx b/packages/app/src/components/ShareReceiveDialog.tsx index 33ba89eb..4329f475 100644 --- a/packages/app/src/components/ShareReceiveDialog.tsx +++ b/packages/app/src/components/ShareReceiveDialog.tsx @@ -497,8 +497,6 @@ function ShareReceiveDialogInner({ const cloneEnabled = cloneController !== undefined && !cloneRunning; const cloneLabel = cloneRunning ? t`Cloning...` : t`Clone to a new folder`; - const shareOwner = share.owner; - const shareRepo = share.repo; const lookingForUrl = canonicalGitHubRemoteUrl(expected); const signedInLogin = authStatus?.authenticated ? authStatus.login : undefined; const cloneErrorMessage = cloneError?.detail ? formatCloneErrorMessage(cloneError.detail) : ''; @@ -605,10 +603,8 @@ function ShareReceiveDialogInner({ aria-disabled={cloneController !== undefined && !cloneEnabled} > {cloneLabel} - -+
{selectedItem.preview.description}
> diff --git a/packages/app/src/editor/slash-command/component-items.test.ts b/packages/app/src/editor/slash-command/component-items.test.ts index 25bd0963..8945dbf6 100644 --- a/packages/app/src/editor/slash-command/component-items.test.ts +++ b/packages/app/src/editor/slash-command/component-items.test.ts @@ -65,6 +65,18 @@ describe('getComponentItems (slash menu)', () => { expect(items.some((i) => i.name === `component-${compatName}`)).toBe(false); } }); + + test('every component preview description fits the slash aside 3-line budget (<= 120 chars)', () => { + const MAX_PREVIEW_DESCRIPTION_LENGTH = 120; + const descriptions = getComponentItems() + .map((i) => i.preview?.description) + .filter((d): d is string => typeof d === 'string'); + expect(descriptions.length).toBeGreaterThan(0); + const tooLong = descriptions + .filter((d) => d.length > MAX_PREVIEW_DESCRIPTION_LENGTH) + .map((d) => `${d.length} chars: ${d.slice(0, 50)}`); + expect(tooLong).toEqual([]); + }); }); describe('createChildNode — default props on slash insert', () => { diff --git a/packages/app/src/editor/slash-command/component-items.tsx b/packages/app/src/editor/slash-command/component-items.tsx index f30125b7..37307f3e 100644 --- a/packages/app/src/editor/slash-command/component-items.tsx +++ b/packages/app/src/editor/slash-command/component-items.tsx @@ -220,7 +220,7 @@ const PREVIEW_CONFIG: Record