Skip to content

Update card.tsx - #5415

Closed
MaddipatlaChetan24 wants to merge 2 commits into
uber:mainfrom
MaddipatlaChetan24:patch-4
Closed

MaddipatlaChetan24 wants to merge 2 commits into
uber:mainfrom
MaddipatlaChetan24:patch-4

Conversation

@MaddipatlaChetan24

Copy link
Copy Markdown
Contributor

Fixes #1, Fixes #2

Description

Hoists the levels array (['', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']) out of
the SemanticTitle component in Card into a module-level constant
(HEADING_LEVELS). Previously this array literal was re-allocated on every
render of SemanticTitle, which runs for every Card with a title and
re-runs on every re-render. The array's contents never change, so it only
needs to be allocated once at module load. No change to rendered output or
component behavior.

Scope

Patch: Bug Fix

@MaddipatlaChetan24

Copy link
Copy Markdown
Contributor Author

can you please check this !!

@dyesin dyesin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Strip the unrelated formatting noise, keep only the hoist.

@dyesin dyesin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

strip the unrelated formatting noise, keep only the hoist.

@dyesin

dyesin commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Before we review it, please note that "check this" isn't a submission we can accept. It hands the verification work to maintainers, and our review time is limited.

We welcome AI-assisted contributions, but you are the author and must stand behind every line. Before requesting review, please:

Run it. Set up the dev environment, run the full test suite, and confirm the change works as intended.
Understand it. Be ready to explain why each change was made and what could break. "The model suggested it" isn't an answer.
Justify it. Describe the actual problem this solves and how you confirmed it's fixed. For performance changes, include evidence.
Test it. Add or update tests following the patterns already used in the repo.
Keep it focused. One concern per PR, with no unrelated edits.

Once you can confirm all of the above in the PR description, we're happy to take a look. Until then, we'll mark this as a draft.

@dyesin dyesin closed this Sep 25, 2026
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.

2 participants