Skip to content

Add Edit button to the standalone prop page#134

Merged
eswan18 merged 1 commit into
mainfrom
claude/edit-button-on-closed-prop-page
Apr 26, 2026
Merged

Add Edit button to the standalone prop page#134
eswan18 merged 1 commit into
mainfrom
claude/edit-button-on-closed-prop-page

Conversation

@eswan18
Copy link
Copy Markdown
Owner

@eswan18 eswan18 commented Apr 26, 2026

Summary

Follow-up to #133 — adds an Edit button to the standalone prop page at /props/[propId], which is used when forecasting on a prop is closed. That page already had a Resolve button but no way to edit, so competition admins still couldn't edit closed props from the UI.

Changes

  • app/props/[propId]/prop-page-header.tsx — accept a new canEdit prop and render an Edit button (mirroring the existing Resolve button) that opens the existing PropEditDialog.
  • app/props/[propId]/page.tsx — compute canEdit to match the RLS policy: system admin OR competition admin (when the prop belongs to a competition) OR the prop's owner. Looks up the user's competition role via getCurrentUserRole only when the prop has a competition_id.

Test plan

  • npx tsc --noEmit clean
  • npm run lint — no new errors
  • npx vitest run — 192 tests pass
  • Manual: as a competition admin (non-system-admin), open a closed prop and verify the Edit button appears and opens the edit dialog
  • Manual: as a non-admin forecaster, verify the Edit button does not appear

https://claude.ai/code/session_013LjY2hYrqzHmZi4fmYxyTz


Generated by Claude Code

The standalone prop page (/props/[propId]) — used for props whose
forecasting window is closed — already had a Resolve affordance but
no way to edit. Mirror the Resolve pattern: add an Edit button that
opens the existing PropEditDialog, gated on a canEdit check that
covers system admins, competition admins (when the prop belongs to
a competition), and personal-prop owners.
@eswan18 eswan18 merged commit 89ab8e1 into main Apr 26, 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.

2 participants