Skip to content

Dev#97

Merged
masudparvez2050 merged 2 commits intomainfrom
dev
Mar 11, 2026
Merged

Dev#97
masudparvez2050 merged 2 commits intomainfrom
dev

Conversation

@masudparvez2050
Copy link
Contributor

No description provided.

refactor: improve code readability by formatting line height calculat…
Copilot AI review requested due to automatic review settings March 11, 2026 20:00
@masudparvez2050 masudparvez2050 merged commit 549f48f into main Mar 11, 2026
1 of 2 checks passed
Copy link

Copilot AI left a comment

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 updates the MissionVision About page component, primarily adjusting how the computed lineHeight call is formatted within the truncation measurement effect.

Changes:

  • Reformats parseInt(getComputedStyle(...).lineHeight) into a multi-line call for both mission and vision truncation checks.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +48 to 52
const lineHeight = parseInt(
getComputedStyle(missionRef.current).lineHeight,
);
const maxHeight = lineHeight * 5;
setMissionNeedsTruncate(missionRef.current.scrollHeight > maxHeight);
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

parseInt(getComputedStyle(...).lineHeight) is brittle here: lineHeight can be a non-integer (or even 'normal'), and parseInt truncates decimals / can yield NaN. Consider using Number.parseFloat(...) (and/or a safe fallback) and explicitly handle non-numeric values to avoid incorrect maxHeight calculations.

Copilot uses AI. Check for mistakes.
Comment on lines +56 to 60
getComputedStyle(visionRef.current).lineHeight,
);
const maxHeight = lineHeight * 5;
setVisionNeedsTruncate(visionRef.current.scrollHeight > maxHeight);
}
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

maxHeight is calculated as lineHeight * 5, but the UI applies line-clamp-6 when truncating. This mismatch can cause missionNeedsTruncate / visionNeedsTruncate to be true (and show the "See more" button) even when the text wouldn’t actually be clamped. Align the multiplier with the clamp line count (or derive both from a shared constant).

Copilot uses AI. Check for mistakes.
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