GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: テーブル系の挙動を修正(ショートカット統一 / セル paste / 境界カーソル) by ymnao · Pull Request #116 · ymnao/scripta

Conversation

@ymnao

@ymnao ymnao commented Jun 1, 2026

Copy link
Copy Markdown
Owner

概要

テーブルエディタ周辺の bug 3 件(#88 / #89 / #90)を 1 PR でまとめて修正。3 件とも tables.ts / table-decoration.ts の同一領域に関わるため統合。

関連 Issue

  • Closes fix: テーブル挿入ショートカットを Mod-Shift-T に統一(Mac の Cmd+Shift+T バインド漏れ) #88
  • Closes fix: テーブルセル内ペーストの修復(focus セルにテキストが入らない) #89
  • Closes fix: テーブル境界カーソル挙動修正(末尾空行確保 / 右端キャレット回避 / exitTableDown 空行補い) #90

移行 Stage

該当なし(Tauri purge 完了後の bug fix。docs/migration-plan.md の Stage には属さない)

変更内容

#88 テーブル挿入ショートカットを Mod-Shift-T に統一

  • tables.ts の keymap を Alt-Shift-t / mac: Ctrl-Shift-t → Mod-Shift-t に統一(Mac の Cmd+Shift+T バインド漏れを解消、他フォーマット系 Mod-Shift-L/X と統一)
  • context menu(MarkdownEditor.tsx)の表示を ⇧⌘T / Ctrl+Shift+T に修正
  • HelpDialog 書式グループに「テーブルを挿入」を追加

#89 テーブルセル内ペーストを修復

  • フォーカスセルを activeElement / selection から正規化(getFocusedCell)してから挿入し、syncRowFromCell で確実にドキュメントへ反映
  • テーブル独自 context menu に「貼り付け」を追加(stopPropagation で editor menu が出ないため)
  • サニタイズ(| 除去 / 改行→スペース、\r\n 対応)を sanitizePasteText に共通化
  • セルをまたぐ選択時は deleteContents が他セルを巻き込まないよう、対象セル末尾への追記にフォールバック

#90 テーブル境界カーソル挙動を修正

  • insertTable / exitTableDown でテーブル直下に編集可能な行を 1 行確保(idempotent、余分な空行 \n\n は作らない)
  • 末尾境界の巨大キャレットを tableCursorFilter(transactionFilter)で次行先頭へ退避(EOF なら改行を 1 つ補完)
  • 削除 / undo で境界に取り残されるケースを tableBoundaryGuard(ViewPlugin、view.hasFocus 時のみ)で補正。セル編集には介入しない

リファクタ(/simplify 反映)

  • nextLineBlank 判定を isLineBlank(table-utils.ts)に共通化
  • tableCursorFilter に安価な事前フィルタを追加し、hot path での findTableNode(syntaxTree 探索)を回避

動作確認

  • pnpm typecheck / pnpm lint
  • pnpm test(unit 1766 passed、テーブル系 51 件追加・含む)
  • pnpm test:e2e(renderer 136 passed)
  • pnpm test:e2e --config=playwright.electron.config.ts(実 Electron 13 passed)
  • pnpm build / pnpm check:legacy-residue

スクリーンショット

なし(カーソル挙動・ショートカット・ペーストの挙動修正のため、動作は実機で確認)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ymnao @claude
fix: テーブル系の挙動を修正(ショートカット統一 / セル paste / 境界カーソル)
5b516a5
#88 / #89 / #90 を 1 PR でまとめて修正。

- #88: テーブル挿入ショートカットを Mod-Shift-T に統一
  - Mac の Cmd+Shift+T バインド漏れ(Ctrl になっていた)を解消し、他フォーマット系と統一
  - context menu / HelpDialog のショートカット表示も同期
- #89: テーブルセル内ペーストを修復
  - フォーカスセルへ正規化してから挿入し、確実にドキュメントへ反映
  - テーブル独自 context menu に「貼り付け」を追加
  - セルをまたぐ選択時は対象セル末尾への追記にフォールバック
- #90: テーブル境界カーソル挙動を修正
  - insertTable / exitTableDown でテーブル直下に編集可能な行を確保(余分な空行は作らない)
  - 末尾境界の巨大キャレットを transactionFilter で次行へ退避
  - 削除 / undo で境界に取り残されるケースを ViewPlugin で補正

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI review requested due to automatic review settings June 1, 2026 10:36
Copilot AI reviewed Jun 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ymnao
ymnao merged commit 304e187 into main Jun 1, 2026
7 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ymnao
ymnao deleted the fix/table-shortcut-cursor-paste branch June 1, 2026 10:50
@ymnao ymnao mentioned this pull request Jun 2, 2026
fix: テーブル境界カーソル / Cmd+Z / focusout 等の再修正(#89 #90) #120
Merged
13 tasks done
ymnao added a commit that referenced this pull request Jun 2, 2026
@ymnao @claude
fix: テーブル境界カーソル / Cmd+Z / focusout 等の再修正(#89 #90) (#120)
0948b4a
* fix: テーブルセル内 paste を修復(#89)

handleKeydown の Cmd/Ctrl 一括 preventDefault が Cmd+V keydown を潰し、
native paste イベントごと抑止していたためフォーカスセルにテキストが
入らなかった。クリップボード操作(V/C/X)をこのガードから除外して
native の paste/copy/cut を通す。sanitize(| 除去 / 改行→スペース)は
既存の wrapper paste リスナで継続。

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix: テーブル境界カーソル / Cmd+Z 等の再修正(#90)

PR #116 で close した #90 のうち実機で再発していた問題群を、根本原因に
当たって再修正する。HANDOFF.md の繰り越し分。

主な根本原因と修正:

- EditableTableWidget.updateDOM が「フォーカス中セルは更新スキップ」して
  いたため、Cmd+Z で state.doc が戻っても cell DOM が古い内容のまま残り
  「効かない」ように見えていた。focus-skip を撤去し、内容差分があれば必ず
  追従、フォーカス中なら setCellContent 後にキャレットを末尾へ戻す。
- EditableTableWidget.ignoreEvent が InputEvent(historyUndo/Redo) を一律
  ignore=true で返し、CM6 の history() の beforeinput ハンドラが eventBelongsToEditor
  で弾かれていた。historyUndo/Redo は ignore=false で CM に通す。
- focusout で formatTableLines を dispatch する仕様が「保存→焦点移動」だけで
  dirty を再発させていた。focusout 時の自動整形を撤去(formatTableLines /
  cellDisplayWidth も dead code として削除)。
- tableCursorFilter が text-based に table 判定していたため fenced code 内の
  パイプ行で誤発火。tr.state.field(tableDecorationField) で newDoc の実
  decoration を参照する形に変更(削除されたテーブルの stale 末尾も、この
  transaction で新規に作られたテーブルも正しく扱う)。
- syncRowFromCell の dispatch に Transaction.userEvent.of("input.type") を付与し、
  CM history のグループ化が表外編集と混じって崩れる現象を防止。
- insertTable の prefix を 1 つの三項に圧縮し、現在行が空行でも直上が本文
  なら \n を補って lezer に table として認識されるようにする。
- 表入り / 表抜けの Arrow / Backspace ハンドラを `enterTableAt` ヘルパに
  集約、`placeCaretAtEnd` / `trimToLastTableLine` を抽出して重複を解消。
- ArrowUp/ArrowLeft の先頭テーブル左上での挙動を「セルに留まる」に変更
  (余計な doc 改変を避ける)。

Edit メニュー Undo/Redo は OS 標準 role に委ねる:
- 当初 `registerAccelerator: false` で逃がす案を検討したが、Electron 型定義
  が @platform linux,win32 で macOS では信頼できない。
- 続いて custom click + accelerator + IPC 案を試したが、accelerator を OS で
  握ると Settings / Search / Command Palette / Mermaid textarea などフォーカス先の
  input で native undo が壊れる。
- 結果として標準 role に戻し、`undo:` セレクタ → focus 先という OS 既定の
  ルーティングに任せる。表セルでは ignoreEvent + history beforeinput 経由で
  CM history に橋渡しされる。

回帰テスト群(fenced code / 削除されたテーブル / 新規テーブル / typing→undo /
focusout 由来の dirty / Arrow 入退 / Backspace マージ抑止 等)を追加。

別途 issue 起票:
- #119 セルをまたぐ範囲選択(v0.2.0 ブロック外)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
ymnao added a commit that referenced this pull request Jun 5, 2026
@ymnao @claude
docs: CHANGELOG を v0.2.0 リリース内容に更新
0598509
- Fixed にバグ修正クラスタをロールアップ追記 (#116 #117 #120 #124 #130 #131 #132 #134 #135 #136 #137)
- Added に手動アップデートチェック (#98 → #138) を追記
- Dependencies を Phase α 反映の実バージョンに更新
  (electron 42.3.3 / biome 2.4.16 / zustand 5.0.14 / js-yaml 4.2.0 /
   dompurify 3.4.8 / marked 18.0.4 / lucide-react 1.17.0 /
   @codemirror/view 6.43.0 / vite 8.0.14 / vitest 4.1.7)
- リリース日を _(unreleased)_ に、旧リポ表記を scripta-tauri (private) に、
  footer URL を ymnao/scripta に修正

Co-Authored-By: Claude Opus 4.8 <[email protected]>
ymnao added a commit that referenced this pull request Jun 5, 2026
@ymnao @claude
release: v0.2.0 (Electron 版初回リリース) (#61)
be27030
* release: v0.2.0

- package.json:version 0.0.0 → 0.2.0
- CHANGELOG.md 新設(旧 Tauri 版から Electron への完全書き直し版として
  Added / Changed / Fixed / Dependencies / Security / 既知の制限 を記載)

closes #27

* docs: v0.2.0 リリース運用注釈と README の表現を release-ready に更新

レビュー指摘反映:
- README.md: "v0.2.0 を予定" / "リリース後 ... 取得できる予定" を
  リリース後にも valid な表現へ書き換え(merge → tag push 後に
  Releases ページが publish される前提)
- docs/parity-checklist.md § 12: 「必須 4 項目は tag push 前に
  手動検証で pass させ、検証ログを Release Notes に追記する」
  というリリース運用を冒頭に明示

* docs: CHANGELOG リリース日と parity-checklist リリース運用を実態に合わせる

レビュー指摘反映:
- CHANGELOG.md: リリース日を 2026-05-13 → 2026-05-14 (publish/tag 日に揃える)
- docs/parity-checklist.md § 12: release.yml が tag push 後に
  draft Release を `--generate-notes` で自動生成する流れに合わせ、
  「Release Notes 追記 → tag push」を「tag push → draft 自動生成
  → 生成された draft に検証ログ追記 → publish」の正しい順序へ修正

* docs: CHANGELOG を v0.2.0 リリース内容に更新

- Fixed にバグ修正クラスタをロールアップ追記 (#116 #117 #120 #124 #130 #131 #132 #134 #135 #136 #137)
- Added に手動アップデートチェック (#98 → #138) を追記
- Dependencies を Phase α 反映の実バージョンに更新
  (electron 42.3.3 / biome 2.4.16 / zustand 5.0.14 / js-yaml 4.2.0 /
   dompurify 3.4.8 / marked 18.0.4 / lucide-react 1.17.0 /
   @codemirror/view 6.43.0 / vite 8.0.14 / vitest 4.1.7)
- リリース日を _(unreleased)_ に、旧リポ表記を scripta-tauri (private) に、
  footer URL を ymnao/scripta に修正

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

fix: テーブル境界カーソル挙動修正(末尾空行確保 / 右端キャレット回避 / exitTableDown 空行補い) fix: テーブルセル内ペーストの修復(focus セルにテキストが入らない) fix: テーブル挿入ショートカットを Mod-Shift-T に統一(Mac の Cmd+Shift+T バインド漏れ)

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ymnao
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.