feat(DescriptionList): render description as link via item.to - #478
IgorShevchik wants to merge 5 commits into
Conversation
Add optional 'to' (and 'target') fields to DescriptionListItem so consumers can turn a value into a B24Link without registering a custom slot. When 'slot' is set on an item the link wrapping is skipped, so existing custom-rendered items keep their previous behaviour. https://claude.ai/code/session_013gYN6XWQ18LRJdDsatDpf7
Two render cases and two behaviour tests for `item.to` / `item.target`. Each fails against the pre-feature component — verified by reverting DescriptionList.vue with the tests kept: all four go red, plus the two render snapshots.
The revived branch was recorded in August. Two things about it no longer held against today's `main`. Four snapshots were stale: `B24Link`'s focus-visible outline moved to `--ui-color-design-outline-focused-stroke` and its `isaction` attribute is gone. Regenerated, no behaviour change. The fifth failure was real and only in the `vue` project. The fixture used `to: '/docs'`, but the test router in `test/utils/mount.ts` registers exactly one route, `/`. Vue Router warned, and `test/utils/console-gate.ts` turns a warning raised during render into a failure. `Breadcrumb` and `NavigationMenu` emit the same warning and sit in `KNOWN_NOISY_SPECS`, but that register may only shrink — adding an entry is a decision, not a formality — so the fixture moves to `/` instead. Verified by mutation after the change: removing the `v-if="item.to"` branch reddens all four cases in both projects. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012MsMuj8Fic9tjWVjyEyrxc
|
Closing this. The implementation is fine; the case for the feature is not. The <B24DescriptionList :items="items">
<template #description="{ item }">
<B24Link v-if="item.to" :to="item.to" :target="item.target">{{ item.description }}</B24Link>
<template v-else>{{ item.description }}</template>
</template>
</B24DescriptionList>That is the whole diff, written by the consumer instead of shipped in the type. What the prop buys is one No demand. The shape has no precedent here. Six item types put What the review found, recorded so a future attempt starts aheadThe JSDoc promise is false as written. One of the four tests asserts nothing. expect(plain.find('[data-slot="text"] a').exists()).toBe(false)
Smaller things. Both playground pages still link Not a finding, worth recording: A short "linking a description" note will be added to the The branch is left as it is. Generated by Claude Code |
#576) #478 proposed adding `to` and `target` to `DescriptionListItem` so a description could render as a link. It was closed: the `description` slot already receives the item, so the same result needs no addition to the public type, and nothing in the tracker asked for the prop. What was missing was the recipe, not the capability. This adds a `Link in the description` section next to the existing custom-slot section, with a runnable example, and states the thing the closed PR's own JSDoc got wrong — the slot is global rather than per item, so the `v-else` branch is what keeps the remaining items rendering as plain text. The example is a real component under `docs/app/components/content/examples/`, so it is typechecked with the docs project rather than being prose that rots. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012MsMuj8Fic9tjWVjyEyrxc
Linked issue
Revives
feat/description-list-link—ca8b44a1and90457795, 2026-05-07. The original branch is untouched.Why this exists
mainwas re-rooted atb55bd3e7(2026-07-10) and now holds 173 commits. The old feature branches share no merge base with it, so a PR opened straight fromfeat/description-list-linkreports over 1200 files changed and reads as a PR that deletes most of the repository. Both authored commits are cherry-picked onto currentmaininstead; they applied without conflict.Type of change
Description
An item may render its description as a link:
item.to(anythingB24Linkaccepts) plusitem.target. Withouttothe description renders exactly as before, so nothing existing moves — the whole change is onev-if/v-elseinside the existingdescriptionslot.tois documented as ignored whenslotis set, since the consumer is rendering the description themselves.Two things added on top of the May commits
Tests. The branch shipped none for the feature. Added two render cases and two behaviour tests — link only when
tois set,hrefcorrect, plain text otherwise, andtargetforwarded. Mutation-checked rather than assumed: revertingDescriptionList.vuewith the tests kept turns all four red, plus both new snapshots.A prerender fix. The May example pointed at
/users/owner, a route that has never existed here. Today's docs crawler follows in-example links, sodocs:generatefailed with[404] Page not found: /users/owner, linked from the DescriptionList page. That is not a flaw in the feature — it is an example written before the crawler behaved this way. The example now links to/docs/getting-startedandhttps://bitrix24.com, matching what every other example with an internaltodoes.Verification
Gate with
CI=true:dev:prepare·lint·typecheck·test(7136 passed, 6 skipped, 310 files) ·build·docs:generate(1262 routes, green after the example fix).Checklist
Generated by Claude Code