Skip to content

feat: press-only clicks, hover lift and tag releases for 0.3.0 - #77

Merged
dmccoystephenson merged 1 commit into
mainfrom
feat/roam-button-behaviour
Nov 20, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feat/roam-button-behaviour

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

graphik 0.3.0: optional press-only button clicks, a hover lift on buttons, and a release process based on git tags so the games that use graphik can install it instead of carrying their own copies.

Why

Six games vendor their own copies of graphik, which have drifted apart; improvements made in one (Roam's press-only clicks and hover) never reached the others, and upstream changes reach none of them. A tagged release that every game installs fixes that.

What changed

  • beginFrame() / endFrame(): after the first beginFrame(), drawButton fires once per press instead of every call while held. Without it, behaviour is unchanged. Each press fires at most one callback (no click-through into nested screens or later draws); a press already held when frames start doesn't count; a frame that misses endFrame() doesn't leave clicks stuck.
  • Hover lift: the box is drawn lighter (dark colours) or darker (light colours) while the mouse is over it; surface-mapped int colours keep their hue.
  • Releases: tags, installed as graphik @ https://github.com/Stephenson-Software/graphik/archive/refs/tags/v0.3.0.zip (no git needed). publish.yml is manual-only; RELEASING.md rewritten; issue release: version tags are pushed without the 'v' prefix publish.yml requires, so no release has ever been published #34's tag-prefix problem no longer blocks releases.
  • CI: new "Install from a release archive" job builds a GitHub-style archive, installs it and draws with it (covers the gap issue release: publish.yml's wheel smoke test never imports Graphik, so a wheel missing graphik.py would still publish #46 describes for the old smoke test).
  • Packaging: SPDX licence form (setuptools>=77); no more deprecation warning on install.
  • Docs: README hero and hover images rendered by scripts/make_readme_images.py, new methods documented, Dependents table.

How it was tested

  • pytest: 181 passed (157 before; six existing tests updated only for the hover colour; new tests for both click modes, missed endFrame, nested loops, int colours).
  • An independent review by a separate Claude agent found four defects in the first draft of the click logic; all were fixed and pinned by tests.
  • All dependent games' suites pass against this code (Roam 2226, ophidian 710, apex 627, Rock-Paper-Scissors-2D 211, Tic-Tak-Toe 207).

Player-visible changes

Buttons show hover feedback. A click on a button's top or left edge pixel now counts (the hit test already matched the drawn box upstream).

After merging

Tag v0.3.0 on the merge commit and create the GitHub release; the dependent games' PRs pin that tag.

drafted by Claude on behalf of Daniel Stephenson

🤖 Generated with Claude Code

Graphik gains beginFrame()/endFrame(): after the first beginFrame, a button
fires once per press, in the frame mouse button 1 goes down over it.
Instances that never call beginFrame keep firing while held, as before.
Each press fires at most once, a press already held when frames start does
not count, and a frame that misses endFrame does not leave clicks stuck.
drawButton lifts the box colour while the mouse is over it. Both features
were carried by a consumer's local copy and are now upstream.

graphik is released as git tags installed from the tag archive, not PyPI:
publish.yml becomes manual-only, RELEASING.md describes tag releases, and a
new CI job installs a GitHub-style archive and draws with it. The licence
moves to the SPDX form (setuptools>=77), silencing the deprecation warning
on every install. README gains rendered images, the new methods and a
Dependents table. Version 0.3.0. Tests: 157 -> 181.

drafted by Claude on behalf of Daniel Stephenson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYNeuoCqxFpUXrFhxnTg89
@dmccoystephenson
dmccoystephenson merged commit e703dba into main Nov 20, 2026
6 checks passed
@dmccoystephenson
dmccoystephenson deleted the feat/roam-button-behaviour branch November 20, 2026 02:12
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