Repository navigation
feat: ✨ Refine from data — paint auto-detects any constant wrapper - #90
Merged
Merged
Conversation
…rapper Brackets are guessable from one painted line, but arbitrary wrappers (/blah/, xxblahxx, ...blah...) need multiple samples. Now the paint preview extracts the painted column's values across the file's head, finds each column's longest common PREFIX + SUFFIX (its constant wrapper), keeps that literal, and generalises only the varying middle — then re-compiles + re-previews. Composes with the date/int/word typing + bracket borders. No-op when values share no wrapper. Status shows "✨ refined from data" when it fires. - columnPattern.ts: commonAffix() + sample-aware inferPaintField/compilePaint + refinePaintPattern() (pure, +3 tests: /…/, xx…xx, and no-wrapper cases) - index.ts: column-pattern-preview refactored to gather lines once, collect(), then auto-refine paint patterns from the extracted column values (returns `refined` flag) - renderer: shows the "✨ refined from data" hint; patcolCompiled already uses the returned regex so Use-as-columns / Save get the smart pattern for free tsc 0 · 627 tests · bundle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… fully The refine-from-data wrapper was escaped literally, so a border with spaces like ' ->' had to match EXACTLY (and single brackets caught '>' but left '-' in the value). Peel it via staticToRegex instead → ' ->' becomes '\s+->', so the whole '->' (with any whitespace) is the literal border and only 'adb' is the varying column. +1 test (multi-char whitespace-flexible border). tsc 0 · 628 tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ozgesolidkey
added a commit
that referenced
this pull request
Aug 19, 2026
feat: ✨ Refine from data — paint auto-detects any constant wrapper
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.
Paint now auto-detects ANY constant wrapper around a column value (not just brackets) by sampling that column across the file: longest common prefix+suffix = the wrapper, kept literal (whitespace-flexible via staticToRegex), varying middle generalised. Composes with the date/int/word typing. Fires automatically in the preview ("✨ refined from data").
refined)tsc 0 · 628 tests · bundle.
🤖 Generated with Claude Code