fix(xref/ui): disambiguate overloaded method signatures in search results#495
fix(xref/ui): disambiguate overloaded method signatures in search results#495marcoscaceres wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes ambiguous “How to Cite?” suggestions on the /xref UI when multiple WebIDL overloads share the same base citation (e.g., Window/postMessage()), by detecting duplicate IDL citations and surfacing overload-specific parameter hints derived from the URI fragment.
Changes:
- Detects duplicated IDL citation groups and flags corresponding result rows as overloaded.
- Adds overload hint extraction from WebIDL fragment IDs (e.g.,
#dom-window-postmessage-message-options). - Renders overload hints as
<small>(...)</small>adjacent to ambiguous IDL citations.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR updates the xref frontend’s result rendering to better handle overloaded WebIDL definitions by detecting when multiple IDL results would generate the same citation text and adding a UI hint derived from the entry’s URI fragment to help users distinguish them.
Changes:
- Add detection of “overloaded” IDL entries by grouping results that would produce identical citation text.
- Extend IDL citation rendering to optionally append a
<small>overload hint. - Add URI-fragment parsing to extract parameter-name hints for overloaded IDL entries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Updates the xref frontend rendering to better handle overloaded WebIDL members that currently show identical citation text in search results, aiming to reduce ambiguity for users linking via ReSpec.
Changes:
- Adds detection of potentially overloaded/ambiguous IDL results by grouping entries that would render the same citation.
- Extracts overload “parameter” hints from WebIDL fragment identifiers (e.g.,
#dom-...-param1-param2). - Appends overload hints as
<small>text next to IDL citations when an ambiguity is detected.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Updates the /xref frontend rendering logic to better distinguish overloaded WebIDL search results by detecting duplicate IDL citations and deriving parameter “hints” from the result URI fragments.
Changes:
- Add detection of potentially overloaded IDL entries that would render identical citation strings.
- Extract a parameter-list hint from WebIDL-style URI fragments (e.g.,
#dom-window-postmessage-...) for ambiguous results. - Render overload hints as
<small>(...)</small>next to IDL citations in search results.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
47d5627 to
c98311c
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR improves cross-reference search result citations for WebIDL by detecting overloaded definitions that would otherwise render with identical citation text and adding parameter hints to disambiguate them.
Changes:
- Detect ambiguous/overloaded IDL entries in search results and mark them for disambiguation.
- Parse URI fragments to extract overload parameter hints.
- Render overload hints as
<small>text next to citations when needed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR improves the /xref UI’s suggested citation text for overloaded WebIDL entries by detecting ambiguous “same citation text” cases and appending parameter-list hints derived from the entry’s URI fragment.
Changes:
- Detect IDL result groups that would render identical citations and mark them as requiring disambiguation.
- Extend IDL citation rendering to optionally append an overload hint in
<small>text. - Add URI-fragment parsing logic to extract a readable overload hint for ambiguous IDL entries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Updates the Xref search UI to detect when multiple WebIDL results would render the same citation (common with overloaded methods) and to surface URI-fragment-derived parameter hints to help users pick the right overload.
Changes:
- Detect overloaded IDL results that would produce identical citations.
- Extract overload “parameter list” hints from WebIDL-style
#dom-...fragments. - Render overload hints as
<small>(...)</small>alongside citations for ambiguous IDL entries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR updates the client-side xref search results UI to better disambiguate overloaded WebIDL methods whose suggested {{...}} citations would otherwise be identical, addressing ambiguity like Window/postMessage().
Changes:
- Add detection of potentially overloaded IDL entries that would generate the same citation text.
- Extract overload “parameter hints” from WebIDL fragment IDs and display them as
<small>annotations next to ambiguous citations. - Extend
howToCiteIDL()to optionally include overload hints.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Updates the static Xref search UI to detect IDL results that would render the same citation text (e.g., overloaded methods) and adds disambiguation hints derived from WebIDL URI fragments.
Changes:
- Detect “overloaded”/duplicate IDL citation groups and mark the affected entries.
- Extend IDL citation rendering to append
<small>parameter hints for ambiguous results. - Add logic to extract a parameter-list hint from
#dom-...style URI fragments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When multiple xref results share the same term and context (e.g., overloaded methods like Window/postMessage), extract parameter info from the URI fragment to show distinct linking text suggestions. Closes #383
c98311c to
945231c
Compare
There was a problem hiding this comment.
Pull request overview
Updates the xref search UI to detect potentially ambiguous WebIDL results caused by overloads and to surface extra disambiguation information derived from IDL fragment URIs.
Changes:
- Detects duplicate/overloaded IDL search results and flags affected entries.
- Extracts overload “parameter hint” text from the URI fragment for flagged results.
- Escapes additional citation output for safer HTML rendering in some citation paths.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Instead of appending a <small> hint after the citation, embed the
parameter names directly inside the {{ }} brackets. This produces
copy-pasteable cite text that resolves without ambiguity, e.g.
{{Window/postMessage(message, options)}} instead of
{{Window/postMessage()}} <small>(message, options)</small>.
There was a problem hiding this comment.
Pull request overview
Updates the xref search UI to better handle overloaded WebIDL results by detecting when multiple IDL entries would produce the same ReSpec citation and attempting to disambiguate them using parameter hints derived from the entry URI fragment.
Changes:
- Add detection of “overloaded” IDL entries that would render identical citation text.
- Extract overload parameter hints from WebIDL-style
#dom-...fragments and apply them to the displayed IDL citation. - Improve HTML escaping in some citation renderers (IDL and term citations).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot Can you address any unresolved comments and any concerns you have? |
…ation Agent-Logs-Url: https://github.com/speced/respec-web-services/sessions/3856cbfc-2f26-4105-b882-db96f03098c9 Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
Addressed the remaining unresolved feedback in c9382ad:
|
|
@copilot Can you review this and fix any issues that come up? |
Agent-Logs-Url: https://github.com/speced/respec-web-services/sessions/ddb44eac-0c8b-4050-9210-f242b70f3e59 Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
|
@copilot Can you confirm that all your comments have been addressed? Please resolve them if you’re happy. Can you fix anything outstanding from your feedback that hasn’t been addressed? |
Agent-Logs-Url: https://github.com/speced/respec-web-services/sessions/0d42d7b8-1bd1-444d-a41a-036286a77375 Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
All reviewer concerns are addressed. Summary of current state:
|
An enum-value and a method with the same name/for/spec/status
would be falsely grouped as overloads. They render differently
("term" vs term()) so should not trigger disambiguation hints.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sidvishnoi
left a comment
There was a problem hiding this comment.
Can we extract this into 3 PRs please, as it's doing 3 things?
- Using
safeTerm(security) - Copy to clipboard
- Disambiguating hint for overloaded method signatures
| <td>${entry.shortname}</td> | ||
| <td>${entry.type}</td> | ||
| <td>${cite}</td> | ||
| <td class="cite-cell" role="button" tabindex="0" title="Click to copy">${cite}</td> |
There was a problem hiding this comment.
Let's add a <button>, so we don't lose the table-cell role either.
Co-authored-by: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com>
Summary
{{Window/postMessage(message, options)}}instead of ambiguous{{Window/postMessage()}}forcontext, not by entireforlistCloses #383