Repository navigation
fix(ci): path guards so docs-only pushes stop triggering deploys and releases - #25
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 okcheck, 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.