Skip to content

fix: FunctionSignature return type border - #9050

Open
canerakdas wants to merge 1 commit into
nodejs:mainfrom
canerakdas:fix/function-signature-only-return
Open

fix: FunctionSignature return type border#9050
canerakdas wants to merge 1 commit into
nodejs:mainfrom
canerakdas:fix/function-signature-only-return

Conversation

@canerakdas

Copy link
Copy Markdown
Member

Description

The bordered wrapper component should not be rendered in the FunctionSignature component when only the return type is present.

Ref: https://openjs-foundation.slack.com/archives/CVAMEJ4UV/p1785348769820369

Validation

The FunctionSignature "Return Type" variant should now be fixed in Chromatic, and the other variants shouldn't have any regressions.

@canerakdas
canerakdas requested a review from a team as a code owner July 30, 2026 16:23
Copilot AI review requested due to automatic review settings July 30, 2026 16:23
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Jul 30, 2026 4:24pm

Request Review

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Scoped presentation change in Signature CSS with no API or data-handling impact; :has() is widely supported in target browsers.

Overview
FunctionSignature (and other signature layouts) no longer show a bordered, padded box when the root contains only a return-type row.

SignatureItem now exposes data-kind on its wrapper so SignatureRoot can use :has(> [data-kind='return']:only-child) to drop border and horizontal/vertical padding in that case. Multi-parameter signatures keep the existing framed look.

@node-core/ui-components is bumped to 1.7.4.

Reviewed by Cursor Bugbot for commit 2de503a. Bugbot is set up for automated code reviews on this repo. Configure here.

@canerakdas canerakdas changed the title fix: remove the border and padding when Signature has only return fix: FunctionSignature return type border Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.09%. Comparing base (eab3644) to head (2de503a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9050      +/-   ##
==========================================
- Coverage   75.15%   75.09%   -0.06%     
==========================================
  Files         102      102              
  Lines        9124     9124              
  Branches      374      375       +1     
==========================================
- Hits         6857     6852       -5     
- Misses       2263     2268       +5     
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the Signature UI so that when a signature contains only a return-type item, the usual bordered/padded wrapper styling is removed—addressing the “Return Type” variant visual issue reported for FunctionSignature.

Changes:

  • Add a data-kind attribute to SignatureItem to enable cross-module styling based on item kind.
  • Update SignatureRoot styles to remove border and padding when its only direct child is a return item.
  • Bump @node-core/ui-components version to 1.7.4.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/ui-components/src/Common/Signature/SignatureRoot/index.module.css Removes border/padding from the root wrapper when it contains only a return item.
packages/ui-components/src/Common/Signature/SignatureItem/index.tsx Adds data-kind hook used by SignatureRoot to detect a return-only signature.
packages/ui-components/package.json Version bump for publishing the UI change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ui-components/src/Common/Signature/SignatureItem/index.tsx
@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 10.77 MB
New Total First Load JS 10.77 MB
Delta 0 B (0.00%)

Comment thread packages/ui-components/src/Common/Signature/SignatureItem/index.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants