bubbles-ui / bubbles-ui-util: 移行で初めて動いたテストと型チェックの赤を、どう直すか決めたい
Maintainers usually reply within 12 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- build-system, testing
Research direction
Start with bublys-libs/bubbles-ui-util/src/lib/SmartRect.test.ts and SmartRect.ts to determine which scale≠1 coordinate behavior is intended; the issue notes that changing the implementation needs visual confirmation. Then inspect the listed bubbles-ui test files and tsconfig.spec.json, separating mechanical typecheck errors from the two tests whose intent needs review. Done means the disputed tests are unskipped, typechecks pass, and nx run-many -t typecheck is green.
Written by the indexing model from the issue text.
Description
背景
テストランナーを Jest から Vitest に統一した(#<PR番号>)。
bubbles-ui と bubbles-ui-util のテストは、Jest の設定ファイルが読めず長いあいだ一度も実行されていなかった。
移行して初めて動いたところ、OS の振る舞いに関わる食い違いが見つかった。
どちらが正しいかを判断してほしい。
1. SmartRect の座標変換(テストを it.skip で止めている)
bublys-libs/bubbles-ui-util/src/lib/SmartRect.test.ts の 2 件が、期待値と実装の計算で食い違う。
| テスト | 期待値 | 実装の計算 |
|---|---|---|
| toGlobal > scale=0.9のレイヤーから変換する | x = 147 | x = 144 |
| toLocal > scale=0.9のレイヤーに変換する | 50 | 53.75 |
テストのコメントは、消失点を基準に縮める式を前提にしている。
globalX = vanishingPoint.x + (localX - vanishingPoint.x) * scale + offset.x
= 20 + (50 - 20) * 0.9 + 100 = 147
同じファイルの scale=1.0 のケースと往復変換のケースは通る。縮める(scale≠1)ときの式だけがずれている。
決めたいこと
- 正しいのは実装か、テストの期待値か
- 実装が正しい → テストの期待値と式のコメントを今の実装に合わせ、
it.skipを外す - テストが正しい →
SmartRectを直す(奥のレイヤーの泡の位置が変わるので、画面での確認が要る)
- 実装が正しい → テストの期待値と式のコメントを今の実装に合わせ、
- 履歴: テストは
9a942cac(2026-01-26、bubbles-ui-util へ移したとき)から。
SmartRect.tsの最後の変更は9acba1d7(2026-06-30)
2. bubbles-ui の型チェックの赤(このままでは nx typecheck が通らない)
テストは実行時には全部通る(151 件)が、型チェックで次が出る。
| 種類 | 場所 | 中身 |
|---|---|---|
| tsconfig | tsconfig.spec.json |
lib 側が composite: false なのに project reference で参照している(state-management で直したのと同じ) |
| DOM の型が無い | hooks/shortcut.test.ts、bubbles-ui-util の SmartRect.ts |
テスト用 tsconfig に lib: ["dom"] が無く、document / DOMRect が見つからない |
| 拡張子 | Bubble.resize.test.ts |
./Bubble.domain に .js が無い(moduleResolution: nodenext では要る) |
| 型が古い | state/bubbles-dropped-place.test.ts、state/bubbles-focus.test.ts |
UniverseState / CoordinateSystemData の形が変わったのに追従していない(origin はもう無い、など) |
上の 3 つは機械的に直せる。最後の「型が古い」2 本は、今の state の形で何を確かめたいテストなのかを
OS の担当者に見てほしい(型だけ合わせると、テストの意図が変わる恐れがある)。
進め方の案
- SmartRect の正しい式を決める
- bubbles-ui の型チェックを、機械的なもの(tsconfig・DOM・拡張子)と、テストの意図に関わるもの(2 本)に分けて直す
- 型チェックが通ったら、
nx run-many -t typecheckが赤にならないことを確認する
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 9d 13h
- Merged PRs (30d)
- 10
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fumicode/bublys-org
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
fumicode/bublys-org#261 ·
Maintainers usually reply within 12 days
-
enhancement Shiftonton
Difficulty 5/5 Over a week Newbie friendliness 15/100
fumicode/bublys-org#259 ·
Maintainers usually reply within 12 days
-
enhancement Shiftonton
Difficulty 3/5 1-2 days Newbie friendliness 42/100
fumicode/bublys-org#258 ·
Maintainers usually reply within 12 days
-
enhancement Shiftonton
Difficulty 4/5 3-5 days Newbie friendliness 25/100
fumicode/bublys-org#257 ·
Maintainers usually reply within 12 days
-
enhancement Shiftonton
Difficulty 4/5 3-5 days Newbie friendliness 55/100
fumicode/bublys-org#256 ·
Maintainers usually reply within 12 days
All issues in fumicode/bublys-org
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
External sources always come back in English: `lc` isn't passed to `/api/v3/external_sources`Possibly taken @Anurag1428 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
openfoodfacts/openfoodfacts-explorer#2264 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
cloudflare/workers-sdk#17139 ·
Maintainers usually reply within 1 day
-
area: editor P3 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
halisonworks/mod-codeling#290 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
colinhacks/zod#6776 ·
Maintainers usually reply within 1 day