Skip to content

Commit 128259a

Browse files
authored
chore: fixes to doc skills and pipelines (#15067)
1 parent 7494380 commit 128259a

File tree

2 files changed

+48
-5
lines changed

2 files changed

+48
-5
lines changed

.claude/skills/writing-docs/reference/mdx-patterns.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,30 @@ If you don't have the URL, leave a placeholder comment:
286286
<!-- TODO: add screenshot of <description> -->
287287
```
288288

289-
Never invent a Cloudinary URL.
289+
Never invent a Cloudinary URL.
290+
291+
## Keyboard Shortcuts
292+
293+
### Keys to press `Kbd` component
294+
295+
Wrap any key name the user must press in the `Kbd` component from `docs-ui`:
296+
297+
```mdx
298+
import { Kbd } from "docs-ui"
299+
300+
Press <Kbd>Enter</Kbd> to confirm, or <Kbd>Escape</Kbd> to cancel.
301+
```
302+
303+
### OS-dependent shortcuts (CMD vs CTRL) `getOsShortcut`
304+
305+
When a shortcut differs between macOS (⌘ Cmd) and Windows/Linux (Ctrl), use the `getOsShortcut` utility from `docs-ui` so the correct key is shown automatically based on the user's OS:
306+
307+
```mdx
308+
import { Kbd, getOsShortcut } from "docs-ui"
309+
310+
Press <Kbd>{getOsShortcut()}</Kbd>+<Kbd>S</Kbd> to save.
311+
```
312+
313+
`getOsShortcut()` returns `"Cmd"` on macOS and `"Ctrl"` on other platforms.
314+
315+
> **Rule:** Never hard-code `Cmd` or `Ctrl` alone. If the shortcut uses the primary modifier key, always use `getOsShortcut()` so both platforms are covered.

.github/workflows/tsdoc-generation.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,36 @@ jobs:
9898
- Use @since ${{ steps.version.outputs.next_version }} ONLY on symbols that are demonstrably new in this commit's diff
9999
- If a symbol was in the file before this commit, omit @since
100100
101-
- name: Build PR body
102-
id: pr-body
101+
- name: Build PR metadata
102+
id: pr-meta
103103
if: steps.changed-files.outputs.has_files == 'true'
104104
run: |
105105
SHORT_SHA="${{ github.sha }}"
106106
SHORT_SHA="${SHORT_SHA:0:7}"
107107
COMMIT_URL="${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"
108+
COMMIT_SUBJECT=$(git log --format="%s" -1 ${{ github.sha }})
109+
110+
# Build a concise title from the commit subject (strip conventional commit prefix if present)
111+
CLEAN_SUBJECT=$(echo "$COMMIT_SUBJECT" | sed 's/^[a-z]*([^)]*): //' | sed 's/^[a-z]*: //')
112+
# Truncate to 60 chars to leave room for the prefix
113+
CLEAN_SUBJECT=$(echo "$CLEAN_SUBJECT" | cut -c1-60)
114+
PR_TITLE="docs: add TSDocs for \"${CLEAN_SUBJECT}\""
115+
116+
echo "pr_title=${PR_TITLE}" >> "$GITHUB_OUTPUT"
117+
108118
{
109119
echo 'BODY<<PR_BODY_EOF'
110120
echo "## Automated TSDoc Additions"
111121
echo ""
112122
echo "This PR adds TSDoc comments to TypeScript source files changed in commit [\`${SHORT_SHA}\`](${COMMIT_URL})."
113123
echo ""
124+
echo "**Triggered by:** ${COMMIT_SUBJECT}"
125+
echo ""
126+
echo "**Files updated:**"
127+
echo "${{ steps.changed-files.outputs.files }}" | while IFS= read -r f; do
128+
[ -n "$f" ] && echo "- \`$f\`"
129+
done
130+
echo ""
114131
echo "> Review carefully before merging. Claude may have missed context or used incorrect descriptions."
115132
printf '\n'
116133
echo 'PR_BODY_EOF'
@@ -125,7 +142,7 @@ jobs:
125142
base: develop
126143
branch: docs/add-tsdocs
127144
branch-suffix: timestamp
128-
title: "docs: add TSDocs for ${{ github.sha }}"
145+
title: ${{ steps.pr-meta.outputs.pr_title }}
129146
labels: "type: chore"
130147
add-paths: packages/**
131-
body: ${{ steps.pr-body.outputs.BODY }}
148+
body: ${{ steps.pr-meta.outputs.BODY }}

0 commit comments

Comments
 (0)