Skip to content

fix: preserve fallback emoji highlights and complete cleanup - #42

Merged
codewarnab merged 3 commits into
mainfrom
codex/phase-1-cleanup
Oct 13, 2026
Merged

codewarnab merged 3 commits into
mainfrom
codex/phase-1-cleanup

Conversation

@codewarnab

@codewarnab codewarnab commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

When Intl.Segmenter is unavailable, highlights could split joined emoji and flags: matching 💻 inside 👩‍💻 produced 👩‍<mark>💻</mark>. Share fallback boundaries between source mapping and end guards so component matches highlight the whole emoji or flag, while adjacent sequences stay separate. Add fallback regressions, code comments, public API documentation, plan notes, and a patch changeset.

Also complete Phase 1 cleanup: consolidate interactive dataset sizes in scripts/bench-data/dataset-sizes.ts while preserving existing options and defaults; move frozen snapshot artifacts to docs/benchmarks/ and update their runner, checks, and references; delete the two finished plans and stale references.

Fixes #38

Validation

  • Regression observed failing before the emoji fix and passing after it.
  • bun run test:highlight (fallback disabled-segmenter cases plus normal suite)
  • bun run test:normalization and bun run test:normalization:tr (98 checks each)
  • bun run check:shaders, bun run typecheck, bun run build, bun run test:mock
  • bun run test:benchmarks (82 checks for the cleanup)
  • Independent subagent review; moved snapshots remain byte-for-byte identical.

The fallback protects these emoji boundaries; it remains a targeted fallback rather than a complete Unicode grapheme segmentation implementation.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 15:46
@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
webgpu-search Ignored Ignored Oct 13, 2026 4:44am UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codewarnab

Copy link
Copy Markdown
Owner Author

Unicode/highlighting check found a fallback bug: when Intl.Segmenter is unavailable, matching 💻 inside 👩‍💻 or the second regional indicator inside a flag could insert highlight tags in the middle of the displayed sequence. Existing normalization and highlighting tests passed because they did not exercise this fallback.

Fixed by sharing fallback boundaries between source mapping and end guards, consuming emoji ZWJ sequences and pairing regional indicators without merging adjacent flags. Added regression coverage with Intl.Segmenter disabled, plus code comments, public API documentation, an improvement-plan note, and a patch changeset. The regression failed on the original implementation and passes with the fix.

@codewarnab codewarnab changed the title chore: consolidate dataset sizes and clean up finished plans fix: preserve fallback emoji highlights and complete cleanup Oct 11, 2026
… size consolidation

- highlight.ts: GB9a tone attach + GB11 Extend*ZWJ loop, shared cluster
  spans via isClusterContinuation so component queries highlight the
  whole sequence (laptop in woman-technologist, tone in thumbs-up);
  ASCII Sk gate keeps a`b 1:1; sticky /yu regexes without ^ anchor.
- check-parity-lint.ts: auto-allow 0x80 ASCII fast-path (was 0x7f only),
  fixing CI 'banned charCodeAt at line 301'.
- run-all/run-fuzzy-benchmark.ts: consume BENCHMARK_DATASET_SIZES so
  scripts/bench-data is the single size definition.
- test-highlight.ts: keycap/VS16/pirate/full-cluster fallback cases.
- IMPROVEMENT-PLAN.md: drop dangling memory-note reference.
@codewarnab
codewarnab merged commit 057add2 into main Oct 13, 2026
4 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.

Cleanup] One list for dataset sizes (20m)

2 participants