Skip to content

fix(ci): path guards so docs-only pushes stop triggering deploys and releases - #25

Merged
ohnishant merged 9 commits into
mainfrom
t3code/fix/ci-path-guards
Aug 23, 2026
Merged

ohnishant merged 9 commits into
mainfrom
t3code/fix/ci-path-guards

Conversation

@ohnishant

Copy link
Copy Markdown
Owner

Every workflow fired on any push to main, so a README edit rebuilt the site and cut a patch release. This adds path filters per workflow, matched to what each one actually ships.

Pages. Now only runs when the deployed artifact can change: Go source (the playground bundles peepo.wasm compiled from every package), go.mod/go.sum, web/, assets/, or scripts/build-web.sh. Docs and workflow edits no longer redeploy.

Release. Only cuts a release when Go source or the module graph moved, so docs-only pushes stop burning patch versions. Added workflow_dispatch for manual releases.

Tests. Skips entirely on docs-only changes (\*\*.md, docs/, LICENSE.txt) for both push and pull_request. Also adds the missing lint job (gofmt + go vet, the two checks AGENTS.md requires green) and wires it into ci-ok.

One thing to watch: if branch protection requires the ci ok check, a docs-only PR will hang because the workflow skips. Either keep that check non-required, or add an always-runs no-op workflow as the required status instead.

Verified: YAML parses, and locally go test / go vet / gofmt are all clean.

normalize() rebuilds the DOM after every input event, so the browser's
native undo history never survives; ctrl+z did nothing. Keep our own
stack instead of pulling in an editor component:

- snapshot commits land 400ms after the last mutation and store the
  previous {source, caretOffset}, so one step rewinds a typed burst
- ctrl/cmd+z undoes, ctrl/cmd+shift+z and ctrl+y redo; the combos are
  always swallowed since native undo would corrupt the rebuilt DOM
- programmatic replaces (autocomplete accept, example load) reset the
  stack, as sketched in #18
- depth capped at 200 snapshots

Closes #18
Self-review found committed is only initialized because loadExample
runs synchronously at startup; make commitUndoPoint adopt the current
state instead of throwing if that init ever moves.
The CSS already asked for JetBrains Mono and Fira Code but loaded
neither, so every visitor saw a fallback. Ship Hack woff2 (regular +
bold, MIT license included) with @font-face and put it first in the
mono stacks for editor, output, and autocomplete.
buildEditorFragment now splits quoted spans before emote substitution
and wraps them in a .str span. The quote pairing mirrors the lexer's
readString: no escapes, newlines allowed, unterminated runs to EOF.
Emote names still render as images inside strings, as before.

editorSource/forEachPiece/setCaretOffset already recurse into element
nodes, so the span wrapper needs no caret-math changes.
The editor gets a real text-editor gutter: numbers derived from the
source (never the DOM), vertical scroll mirrored from the editor,
horizontal scrolls left alone, and clicking a number places the caret
at that line's first character. applySnapshot updates the gutter too,
so undo/redo keep the count honest.

Two layout fixes make internal scrolling possible at all: main's grid
row is capped with minmax(0,1fr) and the wide layout gives body a
definite height, so long source scrolls inside the pane instead of
stretching the page and dragging the gutter away. The editor switches
from pre-wrap to pre for the same reason - a wrapped line would span
several rows and desynchronize the numbers.
- pair strings the way the lexer does: #-to-EOL comment regions are
  carved out first, so a quote in a comment can no longer open a
  phantom string across real code; comments render muted, emotes
  inside them still render as images
- ignore gutter clicks on empty space below the last number instead
  of teleporting the caret to line 1
- resync gutter scroll after undo/redo restores, for engines that
  skip the scroll event when clamping scrollTop
- drop hack-bold.woff2: no stylesheet requests bold monospace

Found via the self-review posted on #23.
@ohnishant
ohnishant merged commit b2beade into main Aug 23, 2026
14 checks passed
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