Skip to content

[CORE-233] Fix option flickers while adding#37

Open
nikkalin1008 wants to merge 3 commits intomainfrom
fix/CORE-233-error-and-glitch-when-deleting-question
Open

[CORE-233] Fix option flickers while adding#37
nikkalin1008 wants to merge 3 commits intomainfrom
fix/CORE-233-error-and-glitch-when-deleting-question

Conversation

@nikkalin1008
Copy link
Contributor

Type of changes

  • Fix

Purpose

  • Fix option flickers while adding
  • Fix error adding "others" option
  • Fix OAuth authenticate window

@nikkalin1008 nikkalin1008 force-pushed the fix/CORE-233-error-and-glitch-when-deleting-question branch from 3984186 to e09794e Compare March 10, 2026 07:14
@nikkalin1008 nikkalin1008 marked this pull request as ready for review March 10, 2026 07:47
Copilot AI review requested due to automatic review settings March 10, 2026 07:47
Copy link
Contributor

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 addresses three bugs: (1) options flickering when adding new choices due to unstable React keys, (2) an error when adding an "others" option due to misplaced key prop, and (3) the OAuth authentication popup not appearing centered on screen.

Changes:

  • Fixed OAuth popup centering by computing left/top coordinates based on screen position and outer window dimensions before calling window.open.
  • Fixed flickering and "other" option error by correcting the key prop placement from the inner OptionsInput to the outer div, and refactoring syncQuestionFromApi to preserve client-side option arrays instead of overwriting them with server-returned choices (which had different IDs, causing remounts).
  • Removed now-outdated JSDoc comments on Option and DetailOption types that referenced the old strategy of using API choice IDs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/shared/components/AccountButton/AccountButton.tsx Centers the OAuth popup window on screen using computed left/top from screen position and window dimensions
src/features/form/components/AdminFormDetailPages/types/question.ts Removes JSDoc comments about stable ID strategy that no longer applies
src/features/form/components/AdminFormDetailPages/components/OptionsQuestion.tsx Moves key prop from inner OptionsInput to outer div wrapper, fixing "other" option rendering bug
src/features/form/components/AdminFormDetailPages/SectionEditPage.tsx Refactors syncQuestionFromApi to preserve client-side options/detailOptions arrays (preventing flicker) and uses immutable spread-based state update

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

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