mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-22 20:32:26 +01:00
app_icons: todo_implementer card-check-play
Register com.kuhy.todo_implementer (~/src/todoImplementer/app) with a new card-check-play glyph (board card, tick, filled play arrow) and the launcher label TodoImpl. Negative space measured at the final scale. Prunes the oldest evidence artifact to stay under the 60-file cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWYeKVg9WihaikbfDSe
This commit is contained in:
parent
79c8a7ad09
commit
4213b4c03b
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"title": "Launcher icon for todo_implementer",
|
||||||
|
"objective": "Register com.kuhy.todo_implementer in the shared icon family with a card-check-play glyph and label TodoImpl, keeping every family invariant (negative space at final scale, label width rule, 100% coverage).",
|
||||||
|
"acceptance_criteria": ["apps.get_app('todo_implementer') returns glyph card-check-play", "glyph gaps at the final fitted scale >= MIN_NEGATIVE_SPACE", "labels test suite passes for TodoImpl"],
|
||||||
|
"out_of_scope": ["Other apps' icons", "style.py"],
|
||||||
|
"verifier": "python3 -m pytest -q python_pkg/app_icons/tests"
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"intent": "Give the todoImplementer native Flutter app (com.kuhy.todo_implementer) a launcher icon from the shared family and a launcher label.",
|
||||||
|
"scope": ["python_pkg/app_icons: new glyph module, registry entry, label, glyph test", "Non-goal: restyling any other app's icon or style.py"],
|
||||||
|
"changes": [
|
||||||
|
"New glyph card-check-play (_glyph_art_board.py): stroked rounded card, stroked tick, filled play arrow",
|
||||||
|
"Registry entry todo_implementer -> ~/src/todoImplementer/app, linux=True; label TodoImpl"
|
||||||
|
],
|
||||||
|
"verification": [
|
||||||
|
{
|
||||||
|
"command": "python3 -m pytest -q python_pkg/app_icons/tests --cov=python_pkg/app_icons --cov-branch",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "130 passed; no app_icons source line missing; row gaps at final scale >= MIN_NEGATIVE_SPACE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "python3 -m python_pkg.app_icons preview --app todo_implementer --app todo --app tutor",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "full, circle-masked and 48dp rows read as a card with tick and play arrow, distinct from todo's checklist"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"risks": ["Another session has uncommitted app_icons edits (game_research) in the main checkout: merging may conflict in glyphs.py/_apps_more.py/labels.py"],
|
||||||
|
"rollback": ["git revert this commit", "rerun the app_icons tests"]
|
||||||
|
}
|
||||||
@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
"intent": "screen-locker's workout poke (phone POSTs a finished workout to tcp/8773) can reach the PC from the home LAN, persisted across firewall re-applies, without exposing the port on WireGuard.",
|
|
||||||
"scope": [
|
|
||||||
"linux_configuration/features/lib/wg_firewall.sh: ALLOW_WORKOUT_POKE renders 'ip saddr ${LAN_SUBNET} tcp dport 8773 accept'; allow_workout_poke()",
|
|
||||||
"linux_configuration/features/setup_wireguard_ssh.sh: default, save_config, require_root list, allow-workout-poke dispatch",
|
|
||||||
"linux_configuration/features/lib/wg_sshd.sh: usage line",
|
|
||||||
"linux_configuration/features/lib/tests/test_wg_firewall.sh: render + apply-path tests",
|
|
||||||
"Non-goal: no wg0 rule for 8773; off the LAN the poke fails fast and the normal sync credits the workout"
|
|
||||||
],
|
|
||||||
"changes": [
|
|
||||||
"New ALLOW_WORKOUT_POKE flag (default false) persisted in .wireguard_ssh.conf like ALLOW_DOT",
|
|
||||||
"allow-workout-poke subcommand: export flag, save_config, render, verify-then-apply, install verify units"
|
|
||||||
],
|
|
||||||
"verification": [
|
|
||||||
{
|
|
||||||
"command": "bash linux_configuration/features/lib/tests/test_wg_firewall.sh",
|
|
||||||
"result": "pass",
|
|
||||||
"evidence": "18 passed, 0 failed: unset/false render no 8773 rule; true renders exactly one, LAN-only; allow_workout_poke saves the flag as true before applying and the applied ruleset carries the rule"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "shell_coverage_jail.sh --subject linux_configuration/features/lib/tests/run_all.sh <jail_args> --min 0 --fail-on-case-error",
|
|
||||||
"result": "pass",
|
|
||||||
"evidence": "jailed suite exit 0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "sudo setup_wireguard_ssh.sh allow-workout-poke on the host (run by the user)",
|
|
||||||
"result": "pass",
|
|
||||||
"evidence": "nft list ruleset shows ip saddr <LAN> tcp dport 8773 accept in inet filter input"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "pre-commit run --files <the four files>",
|
|
||||||
"result": "pass",
|
|
||||||
"evidence": "all hooks passed"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"risks": [
|
|
||||||
"Any LAN host can reach tcp/8773; the poke server authenticates requests itself."
|
|
||||||
],
|
|
||||||
"rollback": [
|
|
||||||
"git revert this commit, set ALLOW_WORKOUT_POKE=false in .wireguard_ssh.conf and re-run any allow-* to re-render",
|
|
||||||
"After rollback: setup_wireguard_ssh.sh verify reports no drift and no 8773 rule"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -23,6 +23,16 @@ MORE_APPS: Final[tuple[AppIcon, ...]] = (
|
|||||||
# and home_inventory, whose desktop entries use the hicolor set.
|
# and home_inventory, whose desktop entries use the hicolor set.
|
||||||
linux=True,
|
linux=True,
|
||||||
),
|
),
|
||||||
|
AppIcon(
|
||||||
|
key="todo_implementer",
|
||||||
|
repo=_HOME / "src/todoImplementer/app",
|
||||||
|
accent="#B8862E",
|
||||||
|
glyph="card-check-play",
|
||||||
|
icon_name="todo-implementer",
|
||||||
|
# Desktop is the Flutter web build in a Chrome --app window, so it
|
||||||
|
# gets the hicolor set like tutor.
|
||||||
|
linux=True,
|
||||||
|
),
|
||||||
AppIcon(
|
AppIcon(
|
||||||
key="tunedeck",
|
key="tunedeck",
|
||||||
repo=_HOME / "src/tunedeck",
|
repo=_HOME / "src/tunedeck",
|
||||||
|
|||||||
26
python_pkg/app_icons/_glyph_art_board.py
Normal file
26
python_pkg/app_icons/_glyph_art_board.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
"""Fourth batch of SVG path fragments, continued from :mod:`_glyph_art_extra`.
|
||||||
|
|
||||||
|
Split off purely to keep every glyph module under the 250-line cap; which file
|
||||||
|
a glyph lives in carries no meaning. :mod:`glyphs` imports from all of them.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
# A board card with a tick and a play arrow -- todo_implementer, the board that
|
||||||
|
# runs Claude sessions on todo notes: the card is a task, the play arrow starts
|
||||||
|
# its run, the tick is the task landing. ``checklist`` (todo) already owns the
|
||||||
|
# tick-rows idea, so the card outline is what tells the two apart.
|
||||||
|
#
|
||||||
|
# Geometry (authoring space; the fit shrinks it, tests measure the final gaps):
|
||||||
|
# card stroked rounded rect x=208..816, y=272..752, corner r=72.
|
||||||
|
# tick stroked (345,525)->(410,590)->(515,465), left of centre.
|
||||||
|
# play filled triangle x=615..712, y=430..610, no stroke.
|
||||||
|
# Centrelines: card->tick 137px (two half strokes), tick->play 100px and
|
||||||
|
# play->card 104px (one half stroke each), so every gap stays clear of
|
||||||
|
# MIN_NEGATIVE_SPACE=36 after the ~0.82 fit.
|
||||||
|
_CARD_CHECK_PLAY = """\
|
||||||
|
<path d="M 280 272 L 744 272 A 72 72 0 0 1 816 344 L 816 680 \
|
||||||
|
A 72 72 0 0 1 744 752 L 280 752 A 72 72 0 0 1 208 680 L 208 344 \
|
||||||
|
A 72 72 0 0 1 280 272 Z"/>
|
||||||
|
<path d="M 345 525 L 410 590 L 515 465"/>
|
||||||
|
<path fill="{{ACCENT}}" stroke="none" d="M 615 430 L 712 520 L 615 610 Z"/>"""
|
||||||
@ -29,6 +29,7 @@ from python_pkg.app_icons._glyph_art import (
|
|||||||
_SHIELD_CUTLERY,
|
_SHIELD_CUTLERY,
|
||||||
_STORAGE_BOX,
|
_STORAGE_BOX,
|
||||||
)
|
)
|
||||||
|
from python_pkg.app_icons._glyph_art_board import _CARD_CHECK_PLAY
|
||||||
from python_pkg.app_icons._glyph_art_extra import (
|
from python_pkg.app_icons._glyph_art_extra import (
|
||||||
_CAMERA,
|
_CAMERA,
|
||||||
_HEADPHONES,
|
_HEADPHONES,
|
||||||
@ -68,6 +69,11 @@ GLYPHS: Final[dict[str, Glyph]] = {
|
|||||||
glyph.name: glyph
|
glyph.name: glyph
|
||||||
for glyph in (
|
for glyph in (
|
||||||
Glyph("cloud-down", "Cloud with a download arrow", _CLOUD_DOWN),
|
Glyph("cloud-down", "Cloud with a download arrow", _CLOUD_DOWN),
|
||||||
|
Glyph(
|
||||||
|
"card-check-play",
|
||||||
|
"Board card with a tick and a filled play arrow",
|
||||||
|
_CARD_CHECK_PLAY,
|
||||||
|
),
|
||||||
Glyph("barbell", "Barbell with plates and collars", _BARBELL),
|
Glyph("barbell", "Barbell with plates and collars", _BARBELL),
|
||||||
Glyph("clock", "Clock face with hands", _CLOCK),
|
Glyph("clock", "Clock face with hands", _CLOCK),
|
||||||
Glyph("punch-card", "Time card with punched holes", _PUNCH_CARD),
|
Glyph("punch-card", "Time card with punched holes", _PUNCH_CARD),
|
||||||
|
|||||||
@ -46,6 +46,7 @@ LABELS: Final[dict[str, str]] = {
|
|||||||
"book_guard_app": "BookGuard",
|
"book_guard_app": "BookGuard",
|
||||||
"daily_limits": "DailyLimit",
|
"daily_limits": "DailyLimit",
|
||||||
"tutor": "Tutor",
|
"tutor": "Tutor",
|
||||||
|
"todo_implementer": "TodoImpl",
|
||||||
"tunedeck": "TuneDeck",
|
"tunedeck": "TuneDeck",
|
||||||
"sufler": "Sufler",
|
"sufler": "Sufler",
|
||||||
"macro_cam": "MacroCam",
|
"macro_cam": "MacroCam",
|
||||||
|
|||||||
45
python_pkg/app_icons/tests/test_glyph_card_check_play.py
Normal file
45
python_pkg/app_icons/tests/test_glyph_card_check_play.py
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
"""Tests for the todo_implementer glyph (board card, tick, play arrow)."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
from python_pkg.app_icons import apps, fit, glyphs, labels, render, style
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def _row_gaps(y: int, tmp_path: Path) -> list[int]:
|
||||||
|
"""Transparent runs between inked runs along row ``y`` at the final scale."""
|
||||||
|
glyph = glyphs.get_glyph("card-check-play")
|
||||||
|
placement = fit.placement(glyph, "#FFFFFF")
|
||||||
|
png = tmp_path / "card.png"
|
||||||
|
svg = render.build_svg(glyph, "#FFFFFF", with_background=False, offset=placement)
|
||||||
|
render.rasterise(svg, png, style.CANVAS)
|
||||||
|
with Image.open(png) as image:
|
||||||
|
alpha = np.asarray(image.convert("RGBA"))[y, :, 3]
|
||||||
|
edges = np.flatnonzero(np.diff((alpha > 127).astype(np.int8)))
|
||||||
|
ends, starts = edges[1::2], edges[2::2]
|
||||||
|
return [int(start - end) for end, start in zip(ends, starts, strict=False)]
|
||||||
|
|
||||||
|
|
||||||
|
def test_todo_implementer_uses_it() -> None:
|
||||||
|
app = apps.get_app("todo_implementer")
|
||||||
|
assert app.glyph == "card-check-play"
|
||||||
|
assert app.linux
|
||||||
|
assert labels.LABELS["todo_implementer"] == "TodoImpl"
|
||||||
|
|
||||||
|
|
||||||
|
def test_negative_space_at_final_scale(tmp_path: Path) -> None:
|
||||||
|
"""Card edge -> tick -> play -> card edge across the middle: none merge."""
|
||||||
|
best: list[int] = []
|
||||||
|
for y in range(int(style.CENTRE) - 80, int(style.CENTRE) + 81, 8):
|
||||||
|
gaps = _row_gaps(y, tmp_path)
|
||||||
|
if len(gaps) == 3:
|
||||||
|
best = gaps
|
||||||
|
assert min(gaps) >= style.MIN_NEGATIVE_SPACE, (y, gaps)
|
||||||
|
assert best, "no row crosses card, tick, play and card"
|
||||||
Loading…
Reference in New Issue
Block a user