Title: PR #759's world-surface width check mis-measures astral-plane, ZWJ and ⚠️ glyphs (JS width 1 vs Rust unicode-width 2) — must not close #724 as-is · Issue #761 · developing-today/code · GitHub
Open Graph Title: PR #759's world-surface width check mis-measures astral-plane, ZWJ and ⚠️ glyphs (JS width 1 vs Rust unicode-width 2) — must not close #724 as-is · Issue #761 · developing-today/code
X Title: PR #759's world-surface width check mis-measures astral-plane, ZWJ and ⚠️ glyphs (JS width 1 vs Rust unicode-width 2) — must not close #724 as-is · Issue #761 · developing-today/code
Description: Finding Open draft PR #759 ("fix(web): match world surface presenter validation with rust wire rules", head 75a4be64) claims Fixes #724, but its terminal-width measurement in pkgs/id/web/src/world-surface.ts mis-measures every wide glyph...
Open Graph Description: Finding Open draft PR #759 ("fix(web): match world surface presenter validation with rust wire rules", head 75a4be64) claims Fixes #724, but its terminal-width measurement in pkgs/id/web/src/world-...
X Description: Finding Open draft PR #759 ("fix(web): match world surface presenter validation with rust wire rules", head 75a4be64) claims Fixes #724, but its terminal-width measurement in pkgs/id/web/...
Opengraph URL: https://github.com/developing-today/code/issues/761
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PR #759's world-surface width check mis-measures astral-plane, ZWJ and ⚠️ glyphs (JS width 1 vs Rust unicode-width 2) — must not close #724 as-is","articleBody":"## Finding\n\nOpen draft PR #759 (\"fix(web): match world surface presenter validation with rust wire rules\", head `75a4be64`) claims `Fixes #724`, but its terminal-width measurement in `pkgs/id/web/src/world-surface.ts` mis-measures every wide glyph outside the BMP, plus ZWJ emoji sequences and ⚠️ — so it still diverges from the Rust validator in both directions, and merging it as-is would auto-close #724 with its own acceptance criteria (\"ZWJ grapheme clusters handled as one grapheme\", \"width measurement matches Rust's unicode-width semantics\") unmet for those cases.\n\n## Evidence\n\nPR head (cross-checked via `gh api contents?ref=75a4be64`):\n\n```ts\nconst isEastAsianWide =\n /[\\u1100-\\u115F\\u2329\\u232A\\u2E80-\\u303E\\u3040-\\u33FF\\u3400-\\u4DBF\\u4E00-\\u9FFF\\uA960-\\uA97F\\uAC00-\\uD7A3\\uF900-\\uFAFF\\uFE10-\\uFE19\\uFE30-\\uFE6F\\uFF01-\\uFF60\\uFFE0-\\uFFE6]/;\nconst terminalWidth = isEastAsianWide.test(cell.symbol) ? 2 : 1;\n```\n\nAll ranges in the regex are BMP-only. Probed the exact regex + `Intl.Segmenter` grapheme split in Node (each symbol is exactly 1 grapheme, so the grapheme-count check passes and the width check decides):\n\n| Symbol | PR #759 width | Rust `unicode-width` 0.2 width |\n|---|---|---|\n| 😀 U+1F600 | 1 | 2 |\n| 𠮷 U+20BB7 (CJK Ext. B) | 1 | 2 |\n| 👨👩👧 (ZWJ sequence) | 1 | 2 |\n| ⚠️ U+26A0 U+FE0F | 1 | 2 |\n| 界 U+754C | 2 | 2 |\n| x | 1 | 1 |\n\nRust side ground-truthed two ways: `pkgs/id/src/world_presentation.rs:219,350` requires `UnicodeWidthStr::width(symbol) == columns` with `unicode-width = \"0.2\"` (`pkgs/id/Cargo.toml:90`), and a scratch cargo program against the real `unicode-width` 0.2 crate printed width 2 for all four failing symbols above.\n\nConsequences, mirroring #724's original failure modes:\n\n- A **valid** Rust-produced cell `{symbol: \"😀\", columns: 2}` (+ empty continuation) is rejected by the presenter (`renderWorldSurface` returns `false`, world screen falls back) — valid surfaces containing emoji or astral CJK glyphs can never render.\n- An **invalid** cell `{symbol: \"😀\", columns: 1}` is accepted and squeezed into a 1-column grid span — the exact misalignment #724 was filed for.\n\nThe PR's new tests in `world-surface.test.ts` cover only BMP cases (界, x, ab, \"\"), so none of this is caught. Separately, the PR also drops `\"configVersion\": 1` from `pkgs/id/web/bun.lock` — unrelated lockfile churn that should not ride along.\n\n## Dedupe\n\n#724 is the parent finding and is still open; this issue is specifically about PR #759's implementation shortfall and its `Fixes #724` closure. Searches for emoji/unicode-width/astral issues return only #724. Cross-repo: `world-surface.ts` exists only in this repo.\n\n## Acceptance criteria\n\n- [ ] `world-surface.test.ts` gains cases for an astral wide glyph (e.g. 😀 or 𠮷) and a ZWJ cluster: `columns: 2` accepted, `columns: 1` rejected — matching `unicode-width` 0.2.\n- [ ] The width measurement in `world-surface.ts` returns 2 for those cases (e.g. astral CJK ranges U+20000–U+2FA1F, emoji presentation ranges, and ZWJ sequences whose base glyph is wide), without changing the already-correct BMP/ASCII/combining behaviour.\n- [ ] Either PR #759 is updated to satisfy the above before merge, or its `Fixes #724` is removed so #724 stays open for the remaining cases.\n- [ ] The unrelated `bun.lock` `configVersion` removal is dropped from PR #759 or justified there.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-24T13:21:12Z","url":"https://github.com/developing-today/code/issues/761"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7ae45b22-35ac-dd60-ffa2-b13a103828d0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DA0:0DF6:C6724E:1020ACE:6B06415C |
| html-safe-nonce | 013c08451099006c88becb9004476dec42978e8fd4be403358af38d73199966d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REEwOjBERjY6QzY3MjRFOjEwMjBBQ0U6NkIwNjQxNUMiLCJ2aXNpdG9yX2lkIjoiNTE5MDEwNjQ4NDQ5OTE2OTYyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d0bec2c001fc828beff237e4eab0393829130fbad99509a421f11426ba2ac783 |
| hovercard-subject-tag | issue:6013374775 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/761/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5dc4e038de6bac6e66b36e68219def5a969343531ab79870056949d0f3af89ee/developing-today/code/issues/761 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5dc4e038de6bac6e66b36e68219def5a969343531ab79870056949d0f3af89ee/developing-today/code/issues/761 |
| og:image:alt | Finding Open draft PR #759 ("fix(web): match world surface presenter validation with rust wire rules", head 75a4be64) claims Fixes #724, but its terminal-width measurement in pkgs/id/web/src/world-... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac613d3698d3d8565651455086e1f74da07bf277 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width