Skip to content

Extract hardcoded window size constraints to named constants#6

Closed
Copilot wants to merge 3 commits intofeat/window-wrapperfrom
copilot/sub-pr-5
Closed

Extract hardcoded window size constraints to named constants#6
Copilot wants to merge 3 commits intofeat/window-wrapperfrom
copilot/sub-pr-5

Conversation

Copy link

Copilot AI commented Dec 22, 2025

Addresses review feedback on #5 to eliminate magic numbers for minimum window dimensions (300px width, 200px height) repeated across resize logic.

Changes

  • Added MIN_WINDOW_WIDTH and MIN_WINDOW_HEIGHT constants to src/constants/index.js
  • Updated WindowWrapper.jsx to import and use these constants instead of hardcoded values (6 occurrences replaced)
// Before
newWidth = Math.max(300, startWidth + (e.clientX - startX));
if (newWidth > 300) newLeft = startLeft + delta;

// After
newWidth = Math.max(MIN_WINDOW_WIDTH, startWidth + (e.clientX - startX));
if (newWidth > MIN_WINDOW_WIDTH) newLeft = startLeft + delta;

Window resize constraints now centralized in constants file for consistent updates.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

christopher-ling and others added 2 commits December 21, 2025 22:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: christopher-ling <145088109+christopher-ling@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback from review on Feat/window wrapper PR Extract hardcoded window size constraints to named constants Dec 22, 2025
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