app_icons: mahjong tile glyph
Some checks are pending
md-naming / markdown naming convention (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (mypy, mypy) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (pylint, pylint) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (rest, ) (push) Waiting to run
Pre-commit checks / pre-commit (${{ matrix.group }}) (shellcheck, shellcheck) (push) Waiting to run
Python tests / test (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / lib-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run

Todo: 6d3ac82c

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-11-21 15:24:56 +01:00
parent aae7dc57f6
commit 339790efab
8 changed files with 61 additions and 48 deletions

View File

@ -0,0 +1,10 @@
{
"title": "Mahjong launcher icon",
"objective": "Register a family icon for com.kuhy.mahjong that passes every icon_qa check.",
"acceptance_criteria": [
"apps.get_app('mahjong') renders the standard set",
"icon_qa.py prints PASS for all six checks"
],
"out_of_scope": ["Changing other apps or style.py"],
"verifier": "pytest python_pkg/app_icons/tests; ~/.claude/skills/app-icon/scripts/icon_qa.py"
}

View File

@ -0,0 +1,25 @@
{
"intent": "com.kuhy.mahjong (kuhyx/mahjong-teacher app/) gets a family launcher icon: an upright tile with one dot.",
"scope": [
"python_pkg/app_icons: glyph, registry entry, launcher label, registry test",
"No style.py or other app changes"
],
"changes": [
"New glyph mahjong-tile in _glyph_art_extra.py (dot r=52 so it does not merge with the wall at 48px)",
"Registry entry mahjong (Android only) and label Mahjong"
],
"verification": [
{
"command": "pytest -q python_pkg/app_icons/tests --no-cov",
"result": "pass",
"evidence": "154 passed"
},
{
"command": "icon_qa.py <mahjong-teacher worktree>/app",
"result": "pass",
"evidence": "bw, px48, px16, bg, accent, svg all PASS"
}
],
"risks": ["None outside the new entry"],
"rollback": ["git revert this commit", "rerun app_icons tests"]
}

View File

@ -1,48 +0,0 @@
{
"intent": "The Brother status report stops lying while a job is stuck: it names the real reason the USB probe was skipped, installs pyusb on its own, and flags a stalled job (paper misfeed) or a hung backend left behind by a cancelled job.",
"scope": [
"python_pkg/brother_printer/{_stuck_job,_cups_fallback,cups_service,constants,data_classes,display}.py, run.sh, tests",
"Non-goal: fixing the printer's paper pick-up, which is mechanical"
],
"changes": [
"USBResult.probe_note carries _usb_probe_skip_reason(): CUPS busy / pyusb missing / printer silent; display prints it instead of 'pyusb not available'",
"run.sh ensure_pyusb: probes /usr/bin/python3 (what sudo runs; the user's python3 is a pyenv shim) and pacman-installs python-pyusb",
"_stuck_job.py: scans /proc for usb://Brother backends; orphaned backend of a cancelled job -> cups:backend-orphaned + y/N SIGKILL offer; job-impressions-completed frozen 15 s -> cups:job-stalled",
"41xxx status now reads 'Out of Paper / not feeding' since a misfeed sets the same paper-empty bit"
],
"verification": [
{
"command": "./run.sh during stalled job 105 (2026-10-12 16:01)",
"result": "pass",
"evidence": "Note: USB status probe skipped: CUPS has a job on the printer; status obtained via CUPS only."
},
{
"command": "fake orphan (exec -a usb://Brother/... sleep 40) + display_usb_results with stdin y",
"result": "pass",
"evidence": "Queue blocked by a hung backend of a cancelled job / Kill hung backend PID 960784 ... Backend killed; process gone"
},
{
"command": "flag_stuck_job with frozen vs moving counter",
"result": "pass",
"evidence": "frozen: cups:job-stalled after 15.0s; moving: cleared after 1.0s"
},
{
"command": "python3 -m pytest -q --cov=python_pkg.brother_printer --cov-branch python_pkg/brother_printer/tests",
"result": "pass",
"evidence": "431 passed, coverage 100.00%"
},
{
"command": "lpr Krasnale-sie-rzadza.pdf (jobs 106, 107 pages 52-55), monitored via ipptool",
"result": "pass",
"evidence": "all 55 pages on paper, user-confirmed; printer back at 10001 Ready"
}
],
"risks": [
"Stall window is 15 s: a healthy run froze the counter up to ~9 s, so a very slow first page could false-flag",
"A status run during printing now blocks up to 15 s while it samples progress"
],
"rollback": [
"git revert the commit",
"Run ./run.sh on an idle printer and confirm Ready 10001"
]
}

View File

@ -91,4 +91,13 @@ MORE_APPS: Final[tuple[AppIcon, ...]] = (
# Android only: the desktop half is the server's own web page.
linux=False,
),
AppIcon(
key="mahjong",
repo=_HOME / "src/mahjong-teacher/app",
accent="#B8862E",
glyph="mahjong-tile",
icon_name="mahjong",
# Android only: the PC plays the same game in a normal browser.
linux=False,
),
)

View File

@ -80,3 +80,16 @@ _CAMERA = """\
A 64 64 0 0 1 768 400 L 768 688 A 64 64 0 0 1 704 752 L 320 752 \
A 64 64 0 0 1 256 688 L 256 400 A 64 64 0 0 1 320 336 Z"/>
<circle cx="512" cy="544" r="88"/>"""
# A mahjong tile -- mahjong (com.kuhy.mahjong), the Riichi teaching game: one
# upright tile showing the one-of-circles dot. The game's own object, and no
# other family glyph is a tall rounded card with a single dot.
#
# Geometry, ink x=326..698 (372 wide), y=236..788 (552 tall):
# tile rounded rect x=362..662, y=272..752, corner r=56 (stroked).
# dot filled circle r=52 about (512,512). Ink gap dot->tile wall is
# 150-52-36 = 62px sideways: r=72 left 42px, which merged into the
# wall at 48px (icon_qa px48), so the dot stays small.
_MAHJONG_TILE = """\
<rect x="362" y="272" width="300" height="480" rx="56" ry="56"/>
<circle fill="{{ACCENT}}" cx="512" cy="512" r="52"/>"""

View File

@ -39,6 +39,7 @@ from python_pkg.app_icons._glyph_art_extra import (
_CAMERA,
_HEADPHONES,
_LIGHTBULB,
_MAHJONG_TILE,
_PROMPT_BUBBLE,
)
from python_pkg.app_icons._glyph_art_more import (
@ -130,6 +131,7 @@ GLYPHS: Final[dict[str, Glyph]] = {
_SCREEN_TICK_PLAY,
),
Glyph("square-tick", "Rounded square holding a tick", _SQUARE_TICK),
Glyph("mahjong-tile", "Upright tile with one filled dot", _MAHJONG_TILE),
)
}

View File

@ -53,6 +53,7 @@ LABELS: Final[dict[str, str]] = {
"leetcode": "LeetGuard",
"todoimpl": "TodoImpl",
"logo_review": "LogoJudge",
"mahjong": "Mahjong",
}

View File

@ -25,6 +25,7 @@ _EXPECTED: dict[str, tuple[str, str, bool, str]] = {
"leetcode": ("code-brackets", "leetcode-guard-app", True, "src/leetcode-guard/app"),
"todoimpl": ("screen-tick-play", "todoimpl", False, "src/todoImplementer/app"),
"logo_review": ("square-tick", "logo-review", False, "src/logo-review/app"),
"mahjong": ("mahjong-tile", "mahjong", False, "src/mahjong-teacher/app"),
}