Add focus_owner and a padlock-closed glyph to the icon family

focus_owner (com.kuhy.focus_owner, the Device Owner enforcer) was the one
Flutter app never registered with the shared generator. It shipped a
hand-written vector adaptive icon added purely to unblock its build — the app
had no icon resource at all and every release AND debug build failed on AAPT
"resource mipmap/ic_launcher not found". That placeholder used #E8EAED, so it
was off-family as well as unregistered.

None of the existing 13 glyphs fits a device-policy enforcer, so this adds
padlock-closed: shackle stroked (inheriting the group's round caps), body
filled in the accent, keyhole punched back out in the field colour. A fully
stroked padlock loses its keyhole at 48dp and a fully filled one loses the
shackle's opening; splitting them keeps both.

Geometry was computed against style.py's constraints rather than eyeballed,
per the lesson recorded on _NOTE_ASCENDER: body 292..732 x 520..792, shackle
centreline r=132 about (512,520) so its outer top is 352 (inside the 232 safe
edge) and its legs land at 380/644, well within the body. The keyhole leaves
60px of body above it and 76px below the stem, both clear of
MIN_NEGATIVE_SPACE=36 — checked by rendering at 48px, where the hole survives.

The repo path points into ~/phone-focus-mode/focus-owner: focus-owner was
absorbed as a subtree on 2026-08-24 and both the standalone clone and its
GitHub repo are gone.

app_icons stays at 100% branch coverage; 44 tests pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KU9czAaz7wAkjyJ5uEB3t
This commit is contained in:
Krzysztof Rudnicki 2026-08-24 23:23:28 +02:00
parent 49d82511c3
commit e971bf73bb
4 changed files with 95 additions and 1 deletions

View File

@ -0,0 +1,48 @@
{
"intent": "Give com.kuhy.focus_owner (the Device Owner enforcer on the Pixel 6a) a real shared-family launcher icon instead of the off-family hand-written placeholder that was added only to unblock its build.",
"scope": [
"python_pkg/app_icons/apps.py - register focus_owner",
"python_pkg/app_icons/glyphs.py - register the padlock-closed glyph",
"python_pkg/app_icons/_glyph_art_more.py - the glyph's SVG fragment",
"Non-goal: no new accent. The family accent #B8862E is shared; apps are distinguished by glyph shape only.",
"Non-goal: no change to the 13 existing glyphs or to any other app's entry.",
"The consuming repo (~/phone-focus-mode) is committed separately; it blocks binaries, so the icon lands there in vector form."
],
"changes": [
"Added AppIcon(key='focus_owner', repo=~/phone-focus-mode/focus-owner, glyph='padlock-closed', accent='#B8862E', linux=False). The repo path points into the monorepo because focus-owner was absorbed as a subtree on 2026-08-24 and both the standalone clone and its GitHub repo are gone.",
"Added the _PADLOCK_CLOSED glyph fragment: shackle stroked (inheriting the wrapping group's round caps), body filled in the accent, keyhole punched back out in the field colour via fill-rule='evenodd'. Splitting stroke and fill is deliberate - a fully stroked padlock loses its keyhole at 48dp, a fully filled one loses the shackle's opening.",
"Geometry computed against style.py rather than eyeballed, per the lesson recorded on _NOTE_ASCENDER: body 292..732 x 520..792; shackle centreline r=132 about (512,520) giving an outer top of 352, inside the 232 safe edge, with legs at x=380/644 inside the body; keyhole leaves 60px of body above and 76px below the stem, both clear of MIN_NEGATIVE_SPACE=36."
],
"verification": [
{
"command": "pre-commit run --files python_pkg/app_icons/apps.py python_pkg/app_icons/glyphs.py python_pkg/app_icons/_glyph_art_more.py",
"result": "pass",
"evidence": "ruff, ruff format, mypy, pylint, bandit, codespell, secret scan and 'pytest with coverage enforcement' all Passed."
},
{
"command": "python3 -m pytest python_pkg/app_icons/tests -q --cov=python_pkg.app_icons",
"result": "pass",
"evidence": "44 passed. Every app_icons module reports 100% branch coverage (apps.py, glyphs.py, _glyph_art_more.py, render.py, generate.py, cli.py, preview.py, style.py all 100%)."
},
{
"command": "render.build_svg + render.rasterise at 512px and 48px into the session scratchpad",
"result": "pass",
"evidence": "Rendered and inspected both. Charcoal #1B1D21 field with the #B8862E padlock; centre_offset resolved to (0.0, -24.0). At 48px the keyhole is still a distinct hole rather than merging into the body - the specific failure the negative-space sums were computed to avoid."
},
{
"command": "python3 -c \"from python_pkg.app_icons.glyphs import get_glyph; get_glyph('padlock-closed')\"",
"result": "pass",
"evidence": "Resolves to 'padlock-closed - Closed padlock with a punched-out keyhole'."
}
],
"risks": [
"The glyph is new artwork, so it is judged by eye; mitigated by rendering at both 512px and 48px and by computing the clearances instead of estimating them.",
"apps.py now hardcodes a path into ~/phone-focus-mode. If that repo is ever relocated the entry goes stale - the same exposure every other entry in the registry already has.",
"Android vector drawables support a subset of SVG. The arc and evenodd constructs used here convert cleanly, but the generated drawable is verified by an actual release build in the consuming repo rather than assumed."
],
"rollback": [
"git revert this commit; nothing else imports _PADLOCK_CLOSED or the focus_owner key.",
"After rollback, re-run python3 -m pytest python_pkg/app_icons/tests -q and confirm 44 tests still pass and coverage stays at 100%.",
"The consuming repo's icon commit must be reverted too, or focus-owner is left referencing a glyph the registry no longer defines."
]
}

View File

@ -48,3 +48,30 @@ M 592 352 Q 694 408 736 480 Q 740 392 592 302 Z \
M 232 724 L 792 724 L 792 776 L 232 776 Z"/>
<ellipse fill="{{ACCENT}}" stroke="none" \
cx="501" cy="580" rx="118" ry="90" transform="rotate(-20 501 580)"/>"""
# A closed padlock: shackle down, body filled, keyhole punched out of it in the
# field colour. For the Device Owner enforcer -- the app that locks the device
# down -- where the literal reading is the right one.
#
# Geometry, computed rather than eyeballed (see the _NOTE_ASCENDER note above
# for why that distinction earned its own comment):
# body x=292..732, y=520..792 (440x272, rounded r=40)
# shackle semicircular arc, centreline r=132 about (512,520), stroke 72,
# so its outer top is 520-132-36 = 352, inside the 232 safe edge,
# and its legs land at x=380 and x=644, well inside the body.
# keyhole circle r=40 at (512,620) + tapered stem down to y=716.
# 60px of body above the circle and 76px below the stem, both
# clear of MIN_NEGATIVE_SPACE=36, so it stays a hole at 48dp
# instead of merging into the body edge.
#
# The shackle is stroked (inheriting the group's round caps) while the body is
# filled: a fully stroked padlock loses its keyhole at launcher size, and a
# fully filled one loses the shackle's opening.
_PADLOCK_CLOSED = """\
<path d="M 380 520 L 380 448 A 132 132 0 0 1 644 448 L 644 520"/>
<path fill="{{ACCENT}}" fill-rule="evenodd" stroke="none" d="\
M 332 520 L 692 520 A 40 40 0 0 1 732 560 L 732 752 A 40 40 0 0 1 692 792 \
L 332 792 A 40 40 0 0 1 292 752 L 292 560 A 40 40 0 0 1 332 520 Z \
M 512 580 A 40 40 0 0 0 492 655 L 480 716 L 544 716 L 532 655 \
A 40 40 0 0 0 512 580 Z"/>"""

View File

@ -57,6 +57,16 @@ APPS: Final[dict[str, AppIcon]] = {
icon_name="dufs-client",
linux=False,
),
AppIcon(
key="focus_owner",
# Absorbed into the phone-focus-mode monorepo on 2026-08-24; the
# standalone ~/focus-owner clone is gone, as is its GitHub repo.
repo=_HOME / "phone-focus-mode" / "focus-owner",
accent="#B8862E",
glyph="padlock-closed",
icon_name="focus-owner",
linux=False,
),
AppIcon(
key="workout_app",
repo=_HOME / "screen-locker" / "stronglift_replacement" / "workout_app",

View File

@ -29,7 +29,11 @@ from python_pkg.app_icons._glyph_art import (
_SHIELD_CUTLERY,
_STORAGE_BOX,
)
from python_pkg.app_icons._glyph_art_more import _NOTE_ASCENDER, _TRACK_BARS
from python_pkg.app_icons._glyph_art_more import (
_NOTE_ASCENDER,
_PADLOCK_CLOSED,
_TRACK_BARS,
)
@dataclass(frozen=True)
@ -74,6 +78,11 @@ GLYPHS: Final[dict[str, Glyph]] = {
"Node branching into two levels of child nodes",
_DECISION_TREE,
),
Glyph(
"padlock-closed",
"Closed padlock with a punched-out keyhole",
_PADLOCK_CLOSED,
),
)
}