feat: 幹事が候補日程を追加・削除できるようにする#22
Merged
Merged
Conversation
幹事管理ページ(/e/[slug]/admin)に候補日程の追加・削除を追加する。 参加者から「この日程では無理」と言われたときに、イベントを作り直さずに 候補を足す/削ることができる。 ## サーバー - `addSlots`: adminToken 照合 → イベント行をロックして既存候補との重複を除外し、 合計 50 件の上限を判定 → sort_order 末尾に追加(既存の並び順を変えない) - `deleteSlot`: 候補が 1 件のときは拒否、確定中の候補なら確定を解除、 紐づく回答は answers の ON DELETE CASCADE で削除 - どちらも last_activity_at を更新するため、既存の Realtime/ポーリング経路で 他端末の集計ページも自動更新される - DB スキーマ変更なし(マイグレーション不要) ## UI - 候補入力 UI を /new と共通化(src/lib/slot-draft.ts + src/components/slot-picker.tsx) - 幹事管理は「候補日程」1 枚のカードに統合し、追加ピッカーは折りたたみ - 削除は Trash2 アイコン + 行内 2 段階確認(候補・参加者で共通) - 回答 0 件・確定済み・締切済みの状態ごとに文面と表示要素を切り替え - 幹事画面の集計に未回答数を表示 ## 参加者側 - 回答後に追加された候補は再編集時に未選択のまま扱い、「新しい候補」として明示する (既定値を入れると「見ていない候補」が「未定と回答」になってしまう) - ダークモードで ○△× の選択色が消えていた既存バグを修正 (outline バリアントの dark:bg-input/30 が呼び出し側の bg-* に勝っていた) - 「確定」の色を primary に統一(primary = 幹事が決めたこと / emerald = 集計の事実) 検証: pnpm check / pnpm test(80 passed)/ pnpm build / playwright(16 passed、docker Postgres) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
幹事管理ページ(
/e/[slug]/admin)で、集計を見ながら候補日程を後から追加・削除できるようにしました。参加者から「この日程では無理」と言われたときに、イベントを作り直さずに候補を足す/削ることができます。DB スキーマ変更はありません(マイグレーション不要)。
サーバー(Server Actions)
addSlotsFOR UPDATEでロックして既存候補との重複を除外 → 合計 50 件の上限を判定 →sort_order末尾に追加(既存の並び順を変えない)deleteSlotanswersのON DELETE CASCADEで削除どちらも
last_activity_atを更新するため、既存の Realtime(未設定時はポーリング)経路で他端末の集計ページも自動更新されます。UI
/newと共通化(src/lib/slot-draft.tsの純ロジック +src/components/slot-picker.tsxの hook/コンポーネント)。new-event-form.tsxは 559 → 197 行に○0・△0・×0・未回答1)参加者側
outlineバリアントのdark:bg-input/30が呼び出し側のbg-*に勝っており、△ は暗褐色の文字だけが残って判読不能でした検証
pnpm check(biome + tsc)exit 0pnpm test80 passed(63 → 80。Zod スキーマ 6 件、候補下書きロジック 11 件を追加)pnpm buildexit 0pnpm test:e2e16 passed(13 → 16、docker Postgres の実 DB)設計と 5 ラウンド分のデザインレビュー記録は
tasks/todo.mdにあります。🤖 Generated with Claude Code