Skip to content

Conversation

@ff1451
Copy link
Collaborator

@ff1451 ff1451 commented Jan 19, 2026

No description provided.

@ff1451 ff1451 self-assigned this Jan 19, 2026
@ff1451 ff1451 linked an issue Jan 19, 2026 that may be closed by this pull request
@ff1451 ff1451 requested a review from Copilot January 19, 2026 20:24
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 fixes a button overlapping issue in the signup flow by introducing a viewport utility that dynamically calculates and updates CSS custom properties for viewport height and safe area insets. The margin styling is moved from individual buttons to their container elements for more consistent spacing across mobile devices.

Changes:

  • Added a new viewport utility (viewport.ts) that calculates and updates viewport height and safe-area-inset-bottom values dynamically
  • Moved bottom margin from buttons to parent containers in StepLayout and TermStep components
  • Added fallback values to CSS safe-area-inset variables for better browser compatibility

Reviewed changes

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

Show a summary per file
File Description
src/utils/ts/viewport.ts New utility to dynamically calculate viewport dimensions and safe area insets
src/pages/Auth/SignUp/components/StepLayout.tsx Moved margin-bottom styling from button to container div
src/pages/Auth/SignUp/TermStep.tsx Moved margin-bottom styling from button to container div and removed mb-8 class
src/main.tsx Initialize viewport utility on application startup
src/index.css Added fallback values (0px) to safe-area-inset CSS variables

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

Comment on lines 8 to 13
const el = document.createElement('div');
el.style.cssText = 'position:fixed;bottom:0;padding-bottom:env(safe-area-inset-bottom)';
document.body.appendChild(el);
const sab = getComputedStyle(el).paddingBottom;
document.body.removeChild(el);
document.documentElement.style.setProperty('--sab', sab);
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Creating and destroying a DOM element on every viewport event (resize, scroll, focus, etc.) can cause performance issues, especially on mobile devices where these events fire frequently. Consider calculating the safe-area-inset-bottom value once on initialization or caching the result, rather than recreating the element every time setVars is called.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to 9
installViewportVars();

Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

The cleanup function returned by installViewportVars is never called in main.tsx, which means event listeners will never be removed. This could lead to memory leaks in scenarios where the application needs to clean up (though less common in single-page applications). Consider either using the cleanup function or documenting that cleanup is intentionally not performed for the application's lifetime.

Suggested change
installViewportVars();
const cleanupViewportVars = installViewportVars();
window.addEventListener('beforeunload', cleanupViewportVars);

Copilot uses AI. Check for mistakes.
@ff1451 ff1451 merged commit 2e1b229 into develop Jan 19, 2026
1 check passed
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.

[fix] 회원가입 버튼 겹침 문제 수정

2 participants