Skip to content

Commit 77458ad

Browse files
zzhenyaowenshao
andauthored
feat(input): move physical cursor to visual cursor for IME input (QwenLM#4652)
* feat(input): add useCursor hook for IME physical cursor tracking * refactor(input): optimize cursor positioning effect * feat(input): move setCursorPosition to render phase for immediate cursor positioning * fix(input): calculate absolute cursor position by walking yoga tree * fix(input): use addLayoutListener instead of useCursor for zero-jitter cursor positioning * perf(input): stable addLayoutListener subscription and skip redundant cursor updates * fix(input): revert lastPos dedup that broke cursorDirty one-shot flag * feat(input): use patch-package to expose Ink internals for IME cursor positioning * fix(input): address review feedback — prefixWidth, remove useBoxMetrics, pin ink version Co-authored-by: Shaojin Wen <[email protected]> --------- Co-authored-by: Shaojin Wen <[email protected]>
1 parent 7ee3727 commit 77458ad

7 files changed

Lines changed: 335 additions & 9 deletions

File tree

package-lock.json

Lines changed: 195 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"build:sdk:python": "python3 -m build packages/sdk-python",
6565
"check-i18n": "npm run check-i18n --workspace=packages/cli",
6666
"preflight": "npm run clean && npm ci && npm run format && npm run lint:ci && npm run build && npm run typecheck && npm run test:ci",
67+
"postinstall": "patch-package",
6768
"prepare": "husky && npm run build && npm run bundle",
6869
"prepare:package": "node scripts/prepare-package.js",
6970
"package:hosted-installation": "node scripts/build-hosted-installation-assets.js",
@@ -126,6 +127,7 @@
126127
"mock-fs": "^5.5.0",
127128
"msw": "^2.10.4",
128129
"npm-run-all": "^4.1.5",
130+
"patch-package": "^8.0.1",
129131
"prettier": "^3.5.3",
130132
"react-devtools-core": "^6.1.5",
131133
"semver": "^7.7.2",

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"fzf": "^0.5.2",
6363
"glob": "^10.5.0",
6464
"highlight.js": "^11.11.1",
65-
"ink": "^7.0.3",
65+
"ink": "7.0.3",
6666
"ink-gradient": "^3.0.0",
6767
"ink-link": "^4.1.0",
6868
"ink-spinner": "^5.0.0",

0 commit comments

Comments
 (0)