-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Enable sorting of workbook order in Kanban board (#943) #3252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
119 commits
Select commit
Hold shift + click to select a range
7899f11
docs: Create plan (#943)
KATO-Hiro e5e9ed7
docs: Add TDD to AGENTS.md (#943)
KATO-Hiro 38e0006
docs: Update plan (#943)
KATO-Hiro 5b5a4f8
refactor: Remove old mock (#943)
KATO-Hiro 7879606
refactor: Extract calcWorkBookGradeModes to features/utils (#943)
KATO-Hiro 57f6977
test: Add tests for calcWorkBookGradeModes (#943)
KATO-Hiro 6521d6c
feat: Add WorkBookPlacement and SolutionCategory (#943)
KATO-Hiro 35cbdd0
docs: Update plan (#943)
KATO-Hiro 07d1d3c
docs: Add WorkBookPlacement (#943)
KATO-Hiro 59712b6
feat: Add WorkBookPlacement and SolutionCategory (#943)
KATO-Hiro e6a84a7
docs: Add comment (#943)
KATO-Hiro e340b49
docs: Add dnd lib to CONTRIBUTING.md (#943)
KATO-Hiro 1c0e1aa
build(deps): Use @dnd-kit for kanban board (#943)
KATO-Hiro 456d86a
feat: Validate WorkBookPlacement using zod (#943)
KATO-Hiro 3726fae
build: Update deps (#43)
KATO-Hiro a886711
docs: Add plan (#943)
KATO-Hiro fe59718
feat: Add DSL, GCL and NTL to AOJ courses (#943)
KATO-Hiro 37c632c
feat: Add DSL, GCL and NTL to AOJ courses (#943)
KATO-Hiro 90d1a92
feat: Add WorkBookPlacement ans related types (#943)
KATO-Hiro e9349a9
feat: [WIP] Enable sorting of workbook order in Kanban board (#943)
KATO-Hiro f6af23d
feat: Add seed data for Solution Categories (#943)
KATO-Hiro 9cdf57d
docs: Add drafts for bugfix and refactor (#943)
KATO-Hiro 3ce3942
docs: Create bug fix plan (#943)
KATO-Hiro 6daf3a9
refactor: Replace form action with JSON API endpoint for placement up…
KATO-Hiro 543efd8
docs: Add new bug and update plan (#943)
KATO-Hiro 84c3b43
chore: Fix format (#943)
KATO-Hiro 8d6c086
fix: Resolve cross-column drag assignment and improve E2E tests (#943)
KATO-Hiro 7924f18
chore: Fix format (#943)
KATO-Hiro 0fd3431
chore: Rename query params (#943)
KATO-Hiro 36544d4
chore: Fix format (#943)
KATO-Hiro e19a0eb
Merge branch 'staging' of github.com:AtCoder-NoviSteps/AtCoderNoviSte…
KATO-Hiro 5d78ce9
docs: Update plan (#943)
KATO-Hiro be06adb
docs: Update plan (#943)
KATO-Hiro 6626fe9
docs: Revise refactor plan (#943)
KATO-Hiro 73c2f1b
refactor: workbook order management with type-safe placements and Kan…
KATO-Hiro b61730e
chore: Fix format (#943)
KATO-Hiro 374db64
refactor: simplify KanbanBoard with Record-based column state
KATO-Hiro f9cf7b7
chore: Fix format (#943)
KATO-Hiro c1a9783
refactor: extract validateAdminAccess and service helpers for placeme…
KATO-Hiro 5a3136a
feat: improve Kanban UI — nav link, card link, and style tweaks
KATO-Hiro abb09b6
test: add unit tests for solutionCategory and fixture-based curriculu…
KATO-Hiro f13d97c
chore: Update plan (#943)
KATO-Hiro 0e87e6d
docs: TODO list (#943)
KATO-Hiro 332b1d9
chore: Fix typo (#943)
KATO-Hiro aef5236
chore: Add and update refactor plan v2 (#943)
KATO-Hiro e821536
refactor: Phase 7 — color tokens, type renames, BAD_REQUEST constant,…
KATO-Hiro 1bb2960
refactor: Phase 8 — type extraction, WorkbookLink component, props sp…
KATO-Hiro 04131c1
refactor: Phase 9 — layout width, snippet DRY, tab styling (#943)
KATO-Hiro def975d
refactor: Phase 10 — buildKanbanItems, calcPriorityUpdates, TabConfig…
KATO-Hiro e0d52a5
refactor: Phase 11 — service layer, KanbanTabBar extraction (#943)
KATO-Hiro 01bd501
docs: update refactor.md to concise format (#943)
KATO-Hiro 9e7ebef
chore: Add and update refactor plan (#943)
KATO-Hiro 3058bc8
Merge branch 'staging' of github.com:AtCoder-NoviSteps/AtCoderNoviSte…
KATO-Hiro c967bc6
chore: Fix format (#943)
KATO-Hiro 9f768ed
docs: Add todo v3 (#943)
KATO-Hiro 25a8443
docs: Revise todo v3 (#943)
KATO-Hiro 21647e5
docs: Revise todo v3 (#943)
KATO-Hiro 0579b17
docs: Revise todo v3 (#943)
KATO-Hiro 774d15d
refactor: Apply Phase 1-3 refactoring to workbook order feature
KATO-Hiro 6f1b377
docs: Update project rules and architecture docs
KATO-Hiro ca4587a
refactor: Apply Phase 4-5 refactoring to workbook order feature
KATO-Hiro 8dec79b
refactor: Apply Phase 6 service layer restructuring to workbook_place…
KATO-Hiro 483cb83
refactor: Apply Phase 7 investigation and KanbanBoard cleanup
KATO-Hiro 1841837
test: Apply Phase 8 test refactoring to workbook_placements
KATO-Hiro 6550bf7
test: Expand kanban utils tests and extract fixtures
KATO-Hiro c08d42a
docs: Consolidate lessons learned into reusable rules and guides
KATO-Hiro 1e1eeb1
docs: Rewrite refactor.md as reusable refactoring guide
KATO-Hiro 33760fe
feat: Add /refactor-plan skill and consolidate Svelte component rules
KATO-Hiro 332621b
docs: Add AI review (#943)
KATO-Hiro 3d10cdb
Merge branch 'staging' of github.com:AtCoder-NoviSteps/AtCoderNoviSte…
KATO-Hiro d794c74
chore: Fix conflict (#943)
KATO-Hiro 77e6d10
docs: Update AI review (#943)
KATO-Hiro f533f94
Merge branch 'staging' of github.com:AtCoder-NoviSteps/AtCoderNoviSte…
KATO-Hiro c0e7c5b
chore: Fix conflict (#943)
KATO-Hiro ff6d6ef
docs: Update review (#943)
KATO-Hiro 16e05a8
chore: Fix format (#943)
KATO-Hiro b2864db
refactor: Apply fixes based on AI review feedback (#943)
KATO-Hiro 6dc15e2
chore: Fix format (#943)
KATO-Hiro 33344d2
docs: Consolidate dev-notes into plan.md and remove stale files (#943)
KATO-Hiro 28cdf7c
chore: Fix format (#943)
KATO-Hiro 3a8f320
docs: Resolve the TDD contradiction between workflow and conventions …
KATO-Hiro 102f6d5
fix: Double-submit could throw an uncaught unique constraint violatio…
KATO-Hiro 4b03a27
fix: typo (#943)
KATO-Hiro 0565030
docs: Add rules from lessons (#943)
KATO-Hiro c5ecf36
docs: Update plan (#943)
KATO-Hiro bf4fca2
docs: Remove old tasks (#943)
KATO-Hiro fe12792
docs: Move important decisions to code (#943)
KATO-Hiro ab38501
chore: Update docs (#943)
KATO-Hiro b28badf
chore: Add and update rules (#943)
KATO-Hiro 7916518
chore: Add and update rules (#943)
KATO-Hiro 227dc35
docs: Add and update skills (#943)
KATO-Hiro 20333d0
chore: Fix format (#943)
KATO-Hiro 7009a63
chore: Rename (#943)
KATO-Hiro 477dd33
chore: Add type (#943)
KATO-Hiro da0df19
chore: Use const and update descriptions (#943)
KATO-Hiro 95d2010
chore: Use getter (#943)
KATO-Hiro 60230e9
docs: Update plan (#943)
KATO-Hiro 3db6e68
docs: Update plan (#943)
KATO-Hiro e0c65ce
chore: Fix type (#943)
KATO-Hiro e774963
chore: Use type (#943)
KATO-Hiro 1b62f00
chore: Fix format (#943)
KATO-Hiro fb68371
refactor: Extract method (#943)
KATO-Hiro cd46c70
refactor (#943)
KATO-Hiro 4fa7973
chore: Fix order (#943)
KATO-Hiro 83cdf70
docs: Add note (#943)
KATO-Hiro aeecdcc
docs: Update rules and plan (#943)
KATO-Hiro f05eb21
refactor: Use consts instead of hardcoding (#943)
KATO-Hiro fcc0a53
Merge branch 'staging' of github.com:AtCoder-NoviSteps/AtCoderNoviSte…
KATO-Hiro 9045d59
chore: Fix conflict (#943)
KATO-Hiro dc249d5
chore: Fix order (#943)
KATO-Hiro 1aba9c9
refactor: To inline from helper (#943)
KATO-Hiro 83e6e90
docs: Update rules for component boundaries, test integrity, and impl…
KATO-Hiro f54f3b1
docs: Update comment (#943)
KATO-Hiro de548c6
docs: Fix sample (#943)
KATO-Hiro 81d24ab
docs: Add tasks after review (#943)
KATO-Hiro 0ab9aa9
docs: Add dual-enforcement, empty-list fallback, and testing rules
KATO-Hiro a69d430
docs: Clarify redirect behavior in API routes and store migration req…
KATO-Hiro d230287
docs: Fix signnature (#943)
KATO-Hiro 5241da6
docs: Simplify pure function example in svelte-components rule
KATO-Hiro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Coding Style | ||
|
|
||
| ## Naming | ||
|
|
||
| - **Abbreviations**: avoid non-standard abbreviations (`res` → `response`, `btn` → `button`). When in doubt, spell it out. | ||
| - **Lambda parameters**: no single-character names (e.g., use `placement`, `workbook`). Iterator index `i` is the only exception. | ||
| - **`upsert`**: only use when the implementation performs both insert and update. For insert-only, use `initialize`, `seed`, or another accurate verb. | ||
| - **`any`**: before using `any`, check the value's origin — adding a missing `@types/*` or `devDependency` often provides the correct type. | ||
| - **UI labels**: if a label does not match actual behavior, update it or add an inline comment explaining the intentional mismatch. | ||
|
|
||
| ## Syntax | ||
|
|
||
| - **Braces**: always use braces for single-statement `if` blocks. Never `if () return;` — write `if () { return; }`. | ||
| - **Plural type aliases**: define `type Placements = Placement[]` instead of using `Placement[]` directly in signatures and variables. | ||
|
|
||
| ## Markdown Code Blocks | ||
|
|
||
| Always specify a language identifier on every fenced code block. Never write bare ` ``` `. | ||
|
|
||
| Common identifiers: `typescript`, `svelte`, `sql`, `bash`, `mermaid`, `json`, `prisma`, `html`, `css`. | ||
|
|
||
| ## SvelteKit: Routes vs API Endpoints | ||
|
|
||
| - Page routes (`+page.server.ts`): use `redirect()` to navigate | ||
| - API routes (`+server.ts`): use `error()` — throwing `redirect()` returns a 3xx response; `fetch` follows it by default and receives the HTML page at the redirect target instead of a JSON error | ||
|
|
||
| ## Dual-Enforcement Constraints | ||
|
|
||
| When the same constraint is enforced in two layers (e.g. Zod validation + SQL `CHECK`), add an inline comment stating each layer's role and the obligation to keep them in sync: | ||
|
|
||
| ```typescript | ||
| // XOR constraint: dual enforcement via Zod (early validation) and a CHECK in migration.sql (last line of defence). | ||
| // Prisma lacks @@check, so the SQL constraint is maintained manually. Keep both in sync. | ||
| .refine(...) | ||
| ``` | ||
|
|
||
| ## Async Rollback: Capture State Before `await` | ||
|
|
||
| Capture `$state` values before the first `await` for safe rollback. A concurrent update can overwrite the variable while awaiting: | ||
|
|
||
| ```typescript | ||
| const previous = items; // capture before await | ||
| try { | ||
| await saveToServer(items); | ||
| } catch { | ||
| items = previous; | ||
| } | ||
| ``` | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,69 @@ | ||
| --- | ||
| description: Prisma and database rules | ||
| globs: | ||
| paths: | ||
| - 'prisma/**' | ||
| - 'src/lib/server/**' | ||
| - 'src/lib/services/**' | ||
| - 'src/features/**/services/**' | ||
| --- | ||
|
|
||
| # Prisma & Database | ||
|
|
||
| ## Schema Changes | ||
|
|
||
| 1. Edit `prisma/schema.prisma` | ||
| 2. Run `pnpm exec prisma migrate dev --name <description>` to create migration | ||
| 3. Run `pnpm exec prisma generate` to update client (auto-runs after migrate) | ||
| 2. Run `pnpm exec prisma migrate dev --name <snake_case_description>` | ||
|
|
||
| ## Naming | ||
|
|
||
| - Model names: `PascalCase` (e.g., `User`, `TaskAnswer`) | ||
| - Field names: `camelCase` (preferred) or `snake_case` (legacy) | ||
| - Relation fields: Descriptive names matching the relation | ||
|
|
||
| ## Key Models | ||
|
|
||
| - `User`: User accounts with AtCoder validation status | ||
| - `Task`: Tasks with difficulty grades (Q11-D6) | ||
| - `TaskAnswer`: User submission status per task | ||
| - `WorkBook`: task collections | ||
| - `Tag` / `TaskTag`: task categorization | ||
| - Models: `PascalCase` | Fields: `camelCase` (preferred) or `snake_case` (legacy) | ||
|
|
||
| ## Server-Only Code | ||
|
|
||
| - Import database client only in `src/lib/server/` | ||
| - Use `$lib/server/database` for Prisma client access | ||
| - Import DB client only in `src/lib/server/` via `$lib/server/database` | ||
| - Never import server code in client components | ||
|
|
||
| ## Service Layer | ||
|
|
||
| - All CRUD through the service layer (`src/lib/services/` or `src/features/**/services/`) | ||
| - Route handlers call service methods — no direct Prisma in `+server.ts` / `+page.server.ts` | ||
| - Service functions return pure values (`{ error: string } | null`), never `Response` / `json()` | ||
|
|
||
| ## Transactions | ||
|
|
||
| - Use `prisma.$transaction()` for multi-step operations | ||
| - Handle errors with try-catch and proper rollback | ||
| Use `prisma.$transaction()` for multi-step operations. | ||
|
|
||
| ## N+1 Queries | ||
|
|
||
| Replace per-item DB calls in loops with a bulk fetch + `Map`: | ||
|
|
||
| ```typescript | ||
| const records = await prisma.foo.findMany({ where: { id: { in: ids } } }); | ||
| const map = new Map(records.map((r) => [r.id, r])); | ||
| ``` | ||
|
|
||
| ## Enum Types | ||
|
|
||
| Prisma-generated enums and app-defined enums are distinct TypeScript types even with identical members. Keep explicit casts at the boundary — do not remove them as "redundant". | ||
|
|
||
| ## Idempotent Writes | ||
|
|
||
| Prefer `createMany({ skipDuplicates: true })` over catching P2002 for expected unique violations (e.g., double-submit). Maps to `INSERT ... ON CONFLICT DO NOTHING`. Top-level only (not nested); PostgreSQL/CockroachDB/SQLite only. | ||
|
|
||
| ## Zod Schema for Int Fields | ||
|
|
||
| `z.number().positive()` passes decimals. For Prisma `Int` fields use `z.number().int().positive()`. | ||
|
|
||
| ## Validate Constraints | ||
|
|
||
| Prisma does not support `@@check`. To add one: | ||
|
|
||
| 1. `pnpm exec prisma migrate dev --create-only --name <description>` — generate migration without applying | ||
| 2. Edit the generated `migration.sql` to add the CHECK constraint manually | ||
| 3. `pnpm exec prisma migrate dev` — apply | ||
|
|
||
| Document the constraint in `prisma/ERD.md` (the only place it's visible): | ||
|
|
||
| ```mermaid | ||
| %% XOR constraint: workbookplacement_xor_grade_category — exactly one of taskGrade or solutionCategory must be non-null | ||
| ``` |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.