Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Tile position editor cannot reorder into an occupied position

未关闭
#14 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
postgresql, typescript
领域
backend, database

调研方向

先从 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

  1. Open /admin/tiles with two tiles at positions 0 and 1.
  2. Change the position of tile 0 to 1 and save.
  3. The database rejects the update on the unique position constraint, 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.ts
  • src/routes/admin/tiles/+page.server.ts
  • src/routes/admin/tiles/+page.svelte
主要语言
TypeScript
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hacksu/bingo 的其他 Issue

查看 hacksu/bingo 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。