Skip to content

Fix EditModal showing stale shortlink data across edits#8

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/implement-dark-theme-ui
Draft

Fix EditModal showing stale shortlink data across edits#8
Copilot wants to merge 6 commits intomainfrom
copilot/implement-dark-theme-ui

Conversation

Copy link

Copilot AI commented Feb 14, 2026

Modal displays incorrect shortlink when editing multiple shortlinks in sequence or immediately after creation.

Root Cause

useState(item) only initializes on mount. State doesn't update when item prop changes between different shortlinks.

Changes

src/components/admin/Menu/Link/Editor/index.tsx

const [formData, setFormData] = React.useState(item);

// Sync formData with item prop when it changes
React.useEffect(() => {
  setFormData(item);
}, [item]);

cypress/e2e/modal-fix.cy.ts

  • Added tests validating modal displays correct data when editing multiple shortlinks sequentially
  • Added test for newly created shortlink edit scenario (reported bug)

Example

Before: Edit shortlink A → close → edit shortlink B → modal shows A's data
After: Edit shortlink A → close → edit shortlink B → modal shows B's data

Application


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

@codesandbox
Copy link

codesandbox bot commented Feb 14, 2026

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel
Copy link

vercel bot commented Feb 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pepper Ready Ready Preview, Comment Feb 14, 2026 9:47am
sarfraz-alam-links Error Error Feb 14, 2026 9:47am

Co-authored-by: Sarfraz-droid <73013838+Sarfraz-droid@users.noreply.github.com>
Co-authored-by: Sarfraz-droid <73013838+Sarfraz-droid@users.noreply.github.com>
Co-authored-by: Sarfraz-droid <73013838+Sarfraz-droid@users.noreply.github.com>
Copilot AI changed the title [WIP] Add dark theme UI using shadcn and Tailwind Implement dark theme UI with shadcn/ui and Tailwind CSS Feb 14, 2026
Copilot AI requested a review from Sarfraz-droid February 14, 2026 09:22
Co-authored-by: Sarfraz-droid <73013838+Sarfraz-droid@users.noreply.github.com>
Co-authored-by: Sarfraz-droid <73013838+Sarfraz-droid@users.noreply.github.com>
Copilot AI changed the title Implement dark theme UI with shadcn/ui and Tailwind CSS Fix EditModal showing stale shortlink data across edits Feb 14, 2026
@Sarfraz-droid
Copy link
Owner

Edit shortlink section has Broken UI

Copy link
Owner

@Sarfraz-droid Sarfraz-droid left a comment

Choose a reason for hiding this comment

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

Edit Section Modal UI is broken

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

Comments