Skip to content

Fix the two checks the shader plate failed - #387

Merged
drehtuer merged 1 commit into
feature/designer-material-and-roundnessfrom
fix/shader-plate-checks
Oct 5, 2026
Merged

drehtuer merged 1 commit into
feature/designer-material-and-roundnessfrom
fix/shader-plate-checks

Conversation

@drehtuer

@drehtuer drehtuer commented Oct 5, 2026

Copy link
Copy Markdown
Owner

#384 was merged into feature/designer-material-and-roundness with two checks red. This PR fixes both.

  • SonarCloud quality gate: reliability rating 2 against 1. The issue was kotlin:S899 at ShaderTimings.kt:113 and :115: ShaderTimingStore.save ignored what File.delete() returned when it gave up a partial write. It now uses a discard helper, the same one MaterialCache has, which falls back to deleteOnExit. The existing ShaderTimingsTest cases (a directory in the way, partial-file cleanup) already exercise both paths.
  • Documentation: mermaid parse error in the shader plate's sequence diagram in docs/architecture.md. Mermaid ends a statement at a ; even inside a Note, so plate up; bar follows … became plate up, bar follows ….

Checks, run locally in the devcontainer:

  • :render:filament test, detekt, ktlint and lint are green.
  • The Documentation job's mermaid step (same mermaid-cli image) parses all 21 diagrams.
  • markdownlint-cli2 reports 0 errors.

🤖 Generated with Claude Code

SonarCloud's quality gate failed on reliability (kotlin:S899): ShaderTimingStore
ignored what File.delete returned when it gave up a partial write. It now
discards the file the way MaterialCache does, deleting it on exit when it
cannot be deleted now.

The Documentation job failed to parse the shader plate's sequence diagram:
mermaid ends a statement at a semicolon, even inside a Note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

@drehtuer
drehtuer merged commit 5cae2a2 into feature/designer-material-and-roundness Oct 5, 2026
9 checks passed
@drehtuer
drehtuer deleted the fix/shader-plate-checks branch October 5, 2026 07:28
drehtuer added a commit that referenced this pull request Oct 5, 2026
Answers the owner's face-designer feedback from the Pixel 10a: three
bugs fixed, a body colour, an edge-rounding slider, and the designer
split into three steps.

**Based on #387** (`fix/shader-plate-checks`), stacked as
`.claude/CLAUDE.md` asks.

## Bugs, each with a regression test
- **"Rolling from the face designer adds numbers to the die."**
- *Cause:* every face was printed, and the artwork was laid over the
print by its alpha (decision 59), so any clear part of a drawing showed
the set's number through it.
- *Fix:* a face is now **drawn or printed, never both**. The decoded
atlas says once which cells hold anything (`AtlasImage.drawnCells`,
`AtlasCoverage`). The renderer leaves those cells out of the printed
numbers (`Stage.drawnCells`, `DieNumbers.fieldOf(drawn)`, `PrintedDice`
keyed by die and drawn faces). Undrawn faces keep their numbers.
- This also changes third-party sets whose artwork leaves gaps around a
printed number; they now show the artwork alone. **Decision 96**, and
`docs/dice-sets.md` is updated.
- **"The rendered spinning die only shows blank faces."**
  - *Cause:* the Solid view deliberately left every pen stroke out.
- *Fix:* strokes are now drawn as the shapes their ink covers
(`StrokeOutline`), projected onto the turning die, and the eraser paints
the body colour.
- **"Loading an image has no effect."** There is no image-loading option
in the designer.
- *What it was:* the guide toggle, drawn with the prototype's
framed-landscape glyph. In the dark theme the guide was pale grey on
white paper, so it looked like it did nothing.
- *Fix:* the guide is drawn in whichever of black or white reads on the
paper (`PaperInk`), and the switch now says **Guide**, as in the
prototype.
  - Putting a photo on a face would be a new feature.
- **"Edges 1–4 only make sense for the d4."**
  - *Not the solver:* every shape but the d4 gets the full radius.
- *Cause 1:* the designer always drew its turning die sharp, so the
steps changed nothing on screen.
- *Cause 2:* how much rounding *shows* depends on the shape. Over 1.5–12
% a d4's corners move 2 mm, a d20's 0.5 mm. The table is in
`docs/face-designer.md`.

## New
- **Body colour (decision 97):**
- A die-level colour from the pen's twelve or the shared `ColourPicker`.
  - Numbers switch automatically to black or white so they read on it.
- Written as the existing per-die `color` / `number_color` keys, so the
format and the validator are unchanged.
  - The canvas, strip and turning die are all drawn on it.
- **Edges slider (decision 98, amending 94):**
- Covers 1.5–12 % in 0.5 % steps, and says the share and the
millimetres, which TalkBack reads too.
  - The turning die is drawn rounded (`RoundedSolid`).
- **The range is still the set file's**: the phone runs that would
measure it were not made. See the open box in `docs/TODO.md` 4.6.
- **Three steps (decision 99): Shape → Material → Faces.**
- One screen and one presenter, with a step bar under the title that
goes to any step.
- The footer has Back and Next on the first two steps, and Back, Save to
set and Roll it on the last.
  - The draft is written whenever a step is left.
- A route that names a die (quick mode, the way back from a test throw)
opens on Faces.
  - The phone's Back leaves the designer from any step, as before.
- **Docs and design:**
- The prototype `design/dInfinityPhone.dc.html` shows the steps, the
colour row and the slider.
- Updated: `design/README.md`, the README feature line,
`docs/face-designer.md`, `docs/architecture.md` decisions 96–99,
`docs/physics-and-rendering.md` ("How round a die may be"),
`docs/STATUS.md` and `docs/TODO.md`.

## Tests and coverage
- New test files: `StrokeOutlineTest`, `RoundedSolidTest`,
`PaperInkTest`, `DesignerGuideTest` and `DesignerStepsTest`.
- Extended: tests in designer, feature/designer, render/filament,
core/model and app.
- New device test:
`AtlasTextureTest.theStageSaysWhichFacesTheUploadedAtlasDrawsOn`. It
compiles but has not been run yet.

| Module | Function | Branch |
|---|---|---|
| designer | 97.4 → 98.0 % | 88.0 → 88.7 % |
| feature/designer | 98.1 → 98.7 % | 65.7 → 66.1 % |
| render/filament | 76.6 → 76.6 % | 73.3 → 73.6 % |
| core/model | unchanged | unchanged |

Locally in the devcontainer:
- `./gradlew build test coverageReport lint detekt ktlintCheck` is
green.
- The Documentation job's mermaid and markdownlint checks pass: 21
diagrams parse, 0 lint errors.

## Not done: needs the phone
- **The edge-rounding range.** The harness and `FairnessTest` runs at
1.5 %, 3 % and 12 % on d4, d6 and d20 were not made; the commands are in
`docs/TODO.md` 4.6. The permission settings blocked the agent's attempt.
- **For the owner to judge:**
  - Walk the three steps.
  - Roll a die drawn on some faces only.
  - Try a dark body colour.
  - Watch the pen's lines on the Solid tab.
  - Toggle **Guide** in the dark theme.
  - Drag the slider on a d6 and on a d20.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant