Tile position editor cannot reorder into an occupied position
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- postgresql, typescript
调研方向
先从 src/routes/admin/tiles/+page.server.ts 中的更新 action 和 src/lib/server/db/schema.ts 中的位置约束开始,然后检查 src/routes/admin/tiles/+page.svelte 中的表单流程。使用两个磁贴复现从位置 0 移动到位置 1 的操作。完成标准是:已占用的位置可以安全地重新排序或交换,并且冲突会返回验证错误,而不是未处理的数据库错误。
由索引模型根据 Issue 内容生成。
描述
Problem
The admin tiles page promises reordering by position, but bingo_tile.position is unique and the update action writes the submitted position directly. Moving a tile to any existing position causes PostgreSQL's unique-constraint error instead of changing the order; swapping two positions is impossible through the UI.
Reproduction
- Open
/admin/tileswith two tiles at positions 0 and 1. - Change the position of tile 0 to 1 and save.
- The database rejects the update on the unique
positionconstraint, currently surfaced as a server error.
Suggested fix
Implement a reorder operation that adjusts the intervening positions in a transaction (or use a temporary unused position for swaps), and return a validation error rather than an unhandled database error for conflicts.
Affected code
src/lib/server/db/schema.tssrc/routes/admin/tiles/+page.server.tssrc/routes/admin/tiles/+page.svelte
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hacksu/bingo 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 72/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 72/100
-
难度 3/5 1-2 天 新手友好度 78/100
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 70/100
siyuan-note/siyuan#20517 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 条评论 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
zsviczian/obsidian-excalidraw-plugin#3000 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
pnpm/get.pnpm.io#68 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
nuxt-modules/better-auth#578 · 2 条评论 ·
维护者通常 1 天内回复