Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fit-card-descriptions.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion packages/app/src/components/NavigatorApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ function NavigatorCard({ title, description, onClick, dataTestId, Icon }: Naviga
{Icon ? <Icon className="size-4 shrink-0 text-muted-foreground" /> : null}
<span className="font-medium text-gray-700 dark:text-foreground text-sm">{title}</span>
</div>
<span className="text-muted-foreground text-xs leading-snug">{description}</span>
<span className="line-clamp-2 text-muted-foreground text-xs leading-snug">{description}</span>
</Button>
);
}
Expand Down
4 changes: 3 additions & 1 deletion packages/app/src/components/PackCardGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ function PackCard({ pack, onSelect }: PackCardProps) {
<h3 className="text-sm font-medium leading-tight">{pack.name}</h3>
</div>

<p className="text-1sm leading-relaxed text-muted-foreground">{pack.description}</p>
<p className="line-clamp-2 text-1sm leading-relaxed text-muted-foreground">
{pack.description}
</p>
</div>
</button>
);
Expand Down
10 changes: 3 additions & 7 deletions packages/app/src/components/ShareReceiveDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) : '';
Expand Down Expand Up @@ -605,10 +603,8 @@ function ShareReceiveDialogInner({
aria-disabled={cloneController !== undefined && !cloneEnabled}
>
<span className="text-sm font-semibold">{cloneLabel}</span>
<span className="text-1sm text-muted-foreground">
<Trans>
Downloads {shareOwner}/{shareRepo} from GitHub.
</Trans>
<span className="line-clamp-2 text-1sm text-muted-foreground">
<Trans>Downloads a fresh copy from GitHub.</Trans>
</span>
</button>
<button
Expand All @@ -623,7 +619,7 @@ function ShareReceiveDialogInner({
<span className="text-sm font-semibold">
<Trans>I already have it locally →</Trans>
</span>
<span className="text-1sm text-muted-foreground">
<span className="line-clamp-2 text-1sm text-muted-foreground">
<Trans>Pick the folder where you've cloned it.</Trans>
</span>
</button>
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/editor/slash-command/SlashCommandMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function SlashCommandMenu({
<div className="mb-2 flex aspect-5/3 items-center justify-center overflow-hidden rounded-md bg-muted/40 p-3 *:max-h-full *:max-w-full [&_img]:size-full [&_img]:rounded-md [&_img]:object-contain">
{selectedItem.preview.render()}
</div>
<p className="px-1 pb-1 text-xs text-muted-foreground">
<p className="line-clamp-3 px-1 pb-1 text-xs text-muted-foreground">
{selectedItem.preview.description}
</p>
</>
Expand Down
12 changes: 12 additions & 0 deletions packages/app/src/editor/slash-command/component-items.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/editor/slash-command/component-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const PREVIEW_CONFIG: Record<string, PreviewConfig> = {
),
},
Mirror: {
description: msg`Read-only copy of a MirrorSource block from another doc. Edit at the source — every Mirror reflects the change live.`,
description: msg`Read-only copy of a MirrorSource block from another doc. Edit at the source and it updates live.`,
render: () => (
<div className="space-y-1.5">
<div className="relative rounded-md border border-dashed border-border/40 px-2 py-1.5">
Expand All @@ -242,7 +242,7 @@ const PREVIEW_CONFIG: Record<string, PreviewConfig> = {
),
},
MirrorSource: {
description: msg`Mark a block as the source of truth. Mirror references elsewhere render this content read-only and update live as you edit here.`,
description: msg`Mark a block as the source of truth. Mirrors elsewhere update live as you edit it.`,
render: () => (
<div className="space-y-1.5">
<div className="relative rounded-md border border-dashed border-border/50 px-2 py-1.5">
Expand Down
14 changes: 7 additions & 7 deletions packages/app/src/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"-3ois8": ["Hard break"],
"-8PP0T": ["Match case"],
"-K0AvT": ["Disconnect"],
"-KCZ6n": [
"Mark a block as the source of truth. Mirror references elsewhere render this content read-only and update live as you edit here."
],
"-LHLx7": ["edited template"],
"-QCLWk": ["Templates available"],
"-Qw-1t": ["GitHub authentication failed. Try signing in again."],
Expand Down Expand Up @@ -348,9 +345,6 @@
"8PmoQF": ["Open the insert menu in an empty or active text position."],
"8RtNI0": ["Failed to load documents"],
"8S1E33": ["Search recent projects..."],
"8TLE9g": [
"Read-only copy of a MirrorSource block from another doc. Edit at the source — every Mirror reflects the change live."
],
"8XQRON": ["Loading repositories"],
"8_brI5": ["Name is required"],
"8cS0nH": ["Config sharing unavailable: ", ["0"], "."],
Expand Down Expand Up @@ -1274,6 +1268,9 @@
"_TF8ep": ["Failed to render PDF"],
"_VRtd7": ["Couldn't send the selection — please try again."],
"_W-elG": ["(inline)"],
"_WPP7e": [
"Read-only copy of a MirrorSource block from another doc. Edit at the source and it updates live."
],
"_XWY2J": ["Terminal disabled"],
"_bth6g": ["Claude Code is installed, but OpenKnowledge tools aren't connected to it yet."],
"_eguJc": ["Uploading"],
Expand Down Expand Up @@ -1415,6 +1412,9 @@
"el312q": ["Install skills into"],
"emgiet": ["Authoritative content; mirrored verbatim everywhere it's referenced."],
"eneWvv": ["Draft"],
"epuNYK": [
"Mark a block as the source of truth. Mirrors elsewhere update live as you edit it."
],
"euc6Ns": ["Duplicate"],
"evs0iw": ["Tags matching \"", ["tagListQuery"], "\""],
"f1XQyZ": ["Move block"],
Expand All @@ -1437,6 +1437,7 @@
"fbsiBw": ["Something went wrong starting the terminal."],
"fcgvCA": ["Claude"],
"fiMNLl": ["Sync settings not yet loaded — try again in a moment"],
"fj5YiP": ["Downloads a fresh copy from GitHub."],
"fo0VXg": ["Uninstall"],
"fqSfXY": ["Replace"],
"fwhX-N": ["Indent or outdent source"],
Expand Down Expand Up @@ -1555,7 +1556,6 @@
"jBVUXo": ["Couldn't open the terminal — please try again."],
"jEZ6Lf": ["provisional"],
"jEdF24": ["Missing page: ", ["linkTitle"], ". Click to create."],
"jGJy-9": ["Downloads ", ["shareOwner"], "/", ["shareRepo"], " from GitHub."],
"jKd3AP": ["Could not enable the terminal: ", ["0"]],
"jPUPvG": ["Couldn't resolve the conflict for ", ["filePath"], "."],
"jRHdCz": ["Failed to load PDF"],
Expand Down
12 changes: 6 additions & 6 deletions packages/app/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2169,8 +2169,8 @@ msgid "Download started"
msgstr "Download started"

#: src/components/ShareReceiveDialog.tsx
msgid "Downloads {shareOwner}/{shareRepo} from GitHub."
msgstr "Downloads {shareOwner}/{shareRepo} from GitHub."
msgid "Downloads a fresh copy from GitHub."
msgstr "Downloads a fresh copy from GitHub."

#: src/components/SkillEditorActions.tsx
#: src/components/SkillStateBadge.tsx
Expand Down Expand Up @@ -3572,8 +3572,8 @@ msgid "Map the architecture"
msgstr "Map the architecture"

#: src/editor/slash-command/component-items.tsx
msgid "Mark a block as the source of truth. Mirror references elsewhere render this content read-only and update live as you edit here."
msgstr "Mark a block as the source of truth. Mirror references elsewhere render this content read-only and update live as you edit here."
msgid "Mark a block as the source of truth. Mirrors elsewhere update live as you edit it."
msgstr "Mark a block as the source of truth. Mirrors elsewhere update live as you edit it."

#: src/components/EditorModeToggle.tsx
msgid "Markdown"
Expand Down Expand Up @@ -4837,8 +4837,8 @@ msgid "Read through this codebase and draft a technical spec for the most comple
msgstr "Read through this codebase and draft a technical spec for the most complex module: an overview, the architecture, key files, and open questions, all linked from a specs index page."

#: src/editor/slash-command/component-items.tsx
msgid "Read-only copy of a MirrorSource block from another doc. Edit at the source — every Mirror reflects the change live."
msgstr "Read-only copy of a MirrorSource block from another doc. Edit at the source — every Mirror reflects the change live."
msgid "Read-only copy of a MirrorSource block from another doc. Edit at the source and it updates live."
msgstr "Read-only copy of a MirrorSource block from another doc. Edit at the source and it updates live."

#: src/components/TrashFailureModal.tsx
msgid "Reason: {reason}"
Expand Down
14 changes: 7 additions & 7 deletions packages/app/src/locales/pseudo/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"-3ois8": ["Ĥàŕď ƀŕēàķ"],
"-8PP0T": ["Ḿàţćĥ ćàśē"],
"-K0AvT": ["Ďĩśćōńńēćţ"],
"-KCZ6n": [
"Ḿàŕķ à ƀĺōćķ àś ţĥē śōũŕćē ōƒ ţŕũţĥ. Ḿĩŕŕōŕ ŕēƒēŕēńćēś ēĺśēŵĥēŕē ŕēńďēŕ ţĥĩś ćōńţēńţ ŕēàď-ōńĺŷ àńď ũƥďàţē ĺĩvē àś ŷōũ ēďĩţ ĥēŕē."
],
"-LHLx7": ["ēďĩţēď ţēḿƥĺàţē"],
"-QCLWk": ["Ţēḿƥĺàţēś àvàĩĺàƀĺē"],
"-Qw-1t": ["ĜĩţĤũƀ àũţĥēńţĩćàţĩōń ƒàĩĺēď. Ţŕŷ śĩĝńĩńĝ ĩń àĝàĩń."],
Expand Down Expand Up @@ -348,9 +345,6 @@
"8PmoQF": ["Ōƥēń ţĥē ĩńśēŕţ ḿēńũ ĩń àń ēḿƥţŷ ōŕ àćţĩvē ţēxţ ƥōśĩţĩōń."],
"8RtNI0": ["Ƒàĩĺēď ţō ĺōàď ďōćũḿēńţś"],
"8S1E33": ["Śēàŕćĥ ŕēćēńţ ƥŕōĴēćţś..."],
"8TLE9g": [
"Ŕēàď-ōńĺŷ ćōƥŷ ōƒ à ḾĩŕŕōŕŚōũŕćē ƀĺōćķ ƒŕōḿ àńōţĥēŕ ďōć. Ēďĩţ àţ ţĥē śōũŕćē — ēvēŕŷ Ḿĩŕŕōŕ ŕēƒĺēćţś ţĥē ćĥàńĝē ĺĩvē."
],
"8XQRON": ["Ĺōàďĩńĝ ŕēƥōśĩţōŕĩēś"],
"8_brI5": ["Ńàḿē ĩś ŕēǫũĩŕēď"],
"8cS0nH": ["Ćōńƒĩĝ śĥàŕĩńĝ ũńàvàĩĺàƀĺē: ", ["0"], "."],
Expand Down Expand Up @@ -1274,6 +1268,9 @@
"_TF8ep": ["Ƒàĩĺēď ţō ŕēńďēŕ ƤĎƑ"],
"_VRtd7": ["Ćōũĺďń'ţ śēńď ţĥē śēĺēćţĩōń — ƥĺēàśē ţŕŷ àĝàĩń."],
"_W-elG": ["(ĩńĺĩńē)"],
"_WPP7e": [
"Ŕēàď-ōńĺŷ ćōƥŷ ōƒ à ḾĩŕŕōŕŚōũŕćē ƀĺōćķ ƒŕōḿ àńōţĥēŕ ďōć. Ēďĩţ àţ ţĥē śōũŕćē àńď ĩţ ũƥďàţēś ĺĩvē."
],
"_XWY2J": ["Ţēŕḿĩńàĺ ďĩśàƀĺēď"],
"_bth6g": ["Ćĺàũďē Ćōďē ĩś ĩńśţàĺĺēď, ƀũţ ŌƥēńĶńōŵĺēďĝē ţōōĺś àŕēń'ţ ćōńńēćţēď ţō ĩţ ŷēţ."],
"_eguJc": ["Ũƥĺōàďĩńĝ"],
Expand Down Expand Up @@ -1415,6 +1412,9 @@
"el312q": ["Ĩńśţàĺĺ śķĩĺĺś ĩńţō"],
"emgiet": ["Àũţĥōŕĩţàţĩvē ćōńţēńţ; ḿĩŕŕōŕēď vēŕƀàţĩḿ ēvēŕŷŵĥēŕē ĩţ'ś ŕēƒēŕēńćēď."],
"eneWvv": ["Ďŕàƒţ"],
"epuNYK": [
"Ḿàŕķ à ƀĺōćķ àś ţĥē śōũŕćē ōƒ ţŕũţĥ. Ḿĩŕŕōŕś ēĺśēŵĥēŕē ũƥďàţē ĺĩvē àś ŷōũ ēďĩţ ĩţ."
],
"euc6Ns": ["Ďũƥĺĩćàţē"],
"evs0iw": ["Ţàĝś ḿàţćĥĩńĝ \"", ["tagListQuery"], "\""],
"f1XQyZ": ["Ḿōvē ƀĺōćķ"],
Expand All @@ -1437,6 +1437,7 @@
"fbsiBw": ["Śōḿēţĥĩńĝ ŵēńţ ŵŕōńĝ śţàŕţĩńĝ ţĥē ţēŕḿĩńàĺ."],
"fcgvCA": ["Ćĺàũďē"],
"fiMNLl": ["Śŷńć śēţţĩńĝś ńōţ ŷēţ ĺōàďēď — ţŕŷ àĝàĩń ĩń à ḿōḿēńţ"],
"fj5YiP": ["Ďōŵńĺōàďś à ƒŕēśĥ ćōƥŷ ƒŕōḿ ĜĩţĤũƀ."],
"fo0VXg": ["Ũńĩńśţàĺĺ"],
"fqSfXY": ["Ŕēƥĺàćē"],
"fwhX-N": ["Ĩńďēńţ ōŕ ōũţďēńţ śōũŕćē"],
Expand Down Expand Up @@ -1555,7 +1556,6 @@
"jBVUXo": ["Ćōũĺďń'ţ ōƥēń ţĥē ţēŕḿĩńàĺ — ƥĺēàśē ţŕŷ àĝàĩń."],
"jEZ6Lf": ["ƥŕōvĩśĩōńàĺ"],
"jEdF24": ["Ḿĩśśĩńĝ ƥàĝē: ", ["linkTitle"], ". Ćĺĩćķ ţō ćŕēàţē."],
"jGJy-9": ["Ďōŵńĺōàďś ", ["shareOwner"], "/", ["shareRepo"], " ƒŕōḿ ĜĩţĤũƀ."],
"jKd3AP": ["Ćōũĺď ńōţ ēńàƀĺē ţĥē ţēŕḿĩńàĺ: ", ["0"]],
"jPUPvG": ["Ćōũĺďń'ţ ŕēśōĺvē ţĥē ćōńƒĺĩćţ ƒōŕ ", ["filePath"], "."],
"jRHdCz": ["Ƒàĩĺēď ţō ĺōàď ƤĎƑ"],
Expand Down
6 changes: 3 additions & 3 deletions packages/app/src/locales/pseudo/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,7 @@ msgid "Download started"
msgstr ""

#: src/components/ShareReceiveDialog.tsx
msgid "Downloads {shareOwner}/{shareRepo} from GitHub."
msgid "Downloads a fresh copy from GitHub."
msgstr ""

#: src/components/SkillEditorActions.tsx
Expand Down Expand Up @@ -3567,7 +3567,7 @@ msgid "Map the architecture"
msgstr ""

#: src/editor/slash-command/component-items.tsx
msgid "Mark a block as the source of truth. Mirror references elsewhere render this content read-only and update live as you edit here."
msgid "Mark a block as the source of truth. Mirrors elsewhere update live as you edit it."
msgstr ""

#: src/components/EditorModeToggle.tsx
Expand Down Expand Up @@ -4832,7 +4832,7 @@ msgid "Read through this codebase and draft a technical spec for the most comple
msgstr ""

#: src/editor/slash-command/component-items.tsx
msgid "Read-only copy of a MirrorSource block from another doc. Edit at the source — every Mirror reflects the change live."
msgid "Read-only copy of a MirrorSource block from another doc. Edit at the source and it updates live."
msgstr ""

#: src/components/TrashFailureModal.tsx
Expand Down
8 changes: 8 additions & 0 deletions packages/server/src/seed/starter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ describe('STARTER_PACKS — all packs structural validation', () => {
}
});

const MAX_PACK_DESCRIPTION_LENGTH = 64;
test(`every pack description fits the picker card's 2-line budget (<= ${MAX_PACK_DESCRIPTION_LENGTH} chars)`, () => {
const tooLong = Object.values(STARTER_PACKS)
.filter((pack) => pack.description.length > MAX_PACK_DESCRIPTION_LENGTH)
.map((pack) => `${pack.id} (${pack.description.length} chars)`);
expect(tooLong).toEqual([]);
});

test('every folder starterTemplate + extraTemplates resolves to a body in pack.templates', () => {
for (const pack of Object.values(STARTER_PACKS)) {
for (const folder of pack.folders) {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/seed/starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ export const STARTER_PACKS: Readonly<Record<PackId, StarterPack>> = {
'codebase-wiki': {
id: 'codebase-wiki',
name: 'Codebase wiki',
description: 'Architecture, modules, and flows.',
description: 'A wiki to help navigate your codebase.',
defaultSubfolder: undefined,
folders: CODEBASE_WIKI_FOLDERS,
templates: CODEBASE_WIKI_TEMPLATES,
Expand Down