feat(core/dfn-panel): show linking terms in panel#5251
Open
marcoscaceres wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds visibility into a definition’s alternate “linking terms” (from data-lt) by rendering them in the DFN panel, addressing the usability request in #3741.
Changes:
- Render a “Linking terms:” line in the DFN panel when
data-ltis present and contains aliases beyond the DFN’s own text. - Normalize/dedupe
data-ltvalues for display and omit the term matching the DFN’s text content. - Add a spec test covering presence/absence and whitespace normalization behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/core/dfn-panel.js |
Adds linkingTermsToHTML() and injects linking-term display into the panel markup. |
tests/spec/core/dfn-panel-spec.js |
Adds coverage ensuring linking terms appear only when appropriate and handle trimming/deduping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds a "Possible linking syntaxes:" section to each dfn popup panel,
showing the correct ReSpec inline shorthand for linking to the definition.
Handles all dfn types: [= =] for concepts, {{ }} for IDL, [^ ^] for
elements/attributes, {^ ^} for CDDL. Includes data-lt aliases and per-item
copy-to-clipboard buttons. Fixes selectors in dfn-index-spec.js.
Closes #3741
- Add "interface mixin" and "callback interface" to IDL_TYPES - Add removeOnSave to copy buttons so they're stripped from exports - Include buttons in trapFocus selector (a11y: keyboard users can reach copy buttons)
13771de to
6cf689e
Compare
…fault
Split comma-separated data-dfn-for values so each produces a separate
linking syntax (e.g. {{Foo/method()}} and {{Bar/method()}} instead of
the invalid {{Foo, Bar/method()}}). Also skip primaryTerm when
data-lt-noDefault is set, matching getDfnTitles behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3741