Skip to content

feat(editor): Excel の読み取り専用プレビューを追加 - #1

Merged
Eotel merged 5 commits into
eotel/mainfrom
Eotel/orca-xlsx-preview
Oct 28, 2026
Merged

Eotel merged 5 commits into
eotel/mainfrom
Eotel/orca-xlsx-preview

Conversation

@Eotel

@Eotel Eotel commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 54 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8797 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8794
Prod 65 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8022 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8010

ELI5

Excel(.xlsx・.xlsm)を開くと「Binary file — cannot display」と出ていた箇所に、シートの書式・画像・グラフを含む読み取り専用プレビューを追加します。

同じ preview.xlsx を、1440×1100 の隠した Electron で開きました。before は変更前の base f173998203、after は本 PR の build です。全体と editor 部分を、同じ大きさで撮影しています。

before(base) after
画面全体 before:Excel は binary 表示 after:Excel の書式・画像・グラフを表示
editor 部分 before:editor は Binary file と表示 after:editor に読み取り専用プレビュー

What Changed

  • stablyai/orca#13532 の viewer を現在の fork に移植し、editor/xlsx/ にまとめました。元の作者 Markel Alvarado さんを commit の Co-author に記載しています。
  • ローカルの filesystem-file-content-inspection.ts、runtime の file-reads.ts / file-preview-budget.ts、renderer の分割読み込みと EditorEditFileSurface を接続しました。チャット画像・ターミナル成果物・binary diff への振り分けも確認しています。
  • Excel・LibreOffice・openpyxl の drawing/chart を名前空間 URI で読み、oneCellAnchor の大きさと、セルが空でグラフだけを置くシートを扱います。
  • cache のないグラフは、同じブックの1シート内にある連続した1行・1列のセル参照から値を読みます。cache がある場合は優先し、数式は保存済みの計算結果を使います。
  • en・ja の文言、明暗テーマの token、キーボードによるシート切り替えとサイズ変更を追加しました。20 MiB のファイル上限と part ごとの展開後サイズ上限を保持しています。

Why

agent が openpyxl で作った Excel を、そのまま Orca で確認できるようにするためです。既存の viewer を専用 directory に移し、既存ファイルへの変更を接続部分に絞ることで、fork に上流更新を取り込みやすくしています。新しい依存はありません。

Linked Issue

関連 issue なし。移植元は stablyai#13532 です。Eotel/orca の eotel/main 向けの変更です。

Visual Proof

変更前は binary 表示でした。以下は同じ自作ブックの Orca 表示と LibreOffice の PDF です。日本語、結合タイトル、罫線、塗り、文字色、通貨・日付、画像とグラフを比較しました。グラフの棒の太さ・書体・目盛りは上流 viewer の近似表示です。軸の数値に通貨記号(¥)は付きません。元の印刷範囲は E 列までのため、PDF では F 列まで伸びるグラフの右端が切れています。EMU からの換算は元ファイルどおりです。

Orca の Excel プレビュー

同じブックの LibreOffice PDF

暗いテーマの viewer(component fixture)

狭い幅の viewer(component fixture)

Excel 12・15 で保存した Apache POI の sample でも確認しました。元の sample は commit していません。

Excel 12 保存のグラフ

Excel 15 保存の散布図

Testing

  • ローカルの実画面を操作して確認
  • 回帰テストを追加・更新

ORCA_BACKGROUND_LAUNCH=1 を付け、macOS の隠した Electron を Playwright CDP で操作・撮影しました。自作ブックの表示、シート切り替え、列幅のキー操作、画像・グラフ、窓が非表示のままであることを確認しています。

移植コード・共有定義・読み込みと振り分けのテストは49ファイル・911件で成功しました。openpyxl の実出力、LibreOffice 保存形式、Excel 形式の合成 fixture を含みます。Excel 本体の sample は WithChart、WithThreeCharts、SimpleScatterChart、WithDrawing を開いて確認しました。

結合セル内の格子線・罫線を抑え、タブの下線が切り替わる前に撮影しないよう、選択状態とアニメーションの完了を確認します。zoom 前後で画像・グラフとセルの位置関係も検査しています。

独立 audit に加えて、デザイン評価と実画面の検査を別々の担当に分けて impeccable critique を行いました。P1 の読み取り専用表示、P2 の狭幅でのタブの見切れ、P3 の単数・複数の表示を修正しました。明暗テーマ・en/ja・幅280/360pxの8条件で再確認し、P0・P1 は0件です。英語は「1 row / 1 column」「27 rows / 5 columns」、日本語は「1 行 / 1 列」「27 行 / 5 列」を実画面で確認しています。

列境界の濃い表示はサイズ変更ハンドルのフォーカス表示で、通常時には出ません。自動レビュー対応後に再ビルドした隠し Electron の操作テストは2件成功しました。追加の openpyxl ブックで、A1:D4 の結合見出しと、色が異なる2本の面グラフも確認しています。

ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2 --stepTimeoutMs=14400000 を最後まで実行しました。unit は34,992件成功・6件失敗でした。全体検査は成功していません。

再確認の結果は次のとおりです。

  • PTY の5件は変更前の base f173998203 でも同じテスト名・エラーで再現しました。PTY のソースは変更していません。
  • 残る PTY の scaling テストは単独で再実行して11件すべて成功しました。
  • 終了処理エラーは base でも出る。出る元のファイルが実行ごとに変わり、Excel の変更とは関係しない。
  • 全体検査で出た quality・lint の指摘は修正し、個別再実行で成功しました。format・型検査と commit hook も成功しています。

最新 c278e1c の fork CI は13件成功・10件スキップです。WSL は初回の Ubuntu import が cancelled で終了した後、再実行(attempt 2)で成功しました。static analysis and typecheck は Blacksmith runner 未割り当てのため未実行です(job)。

最新 Code Review は確認中です。Security Review は指摘0件で完了しています。

Windows・Linux と、実 SSH 接続は未確認です。runtime の読み込みと旧 host の binary 応答は回帰テストで確認しています。

AI Disclosure

Codex を実装・検証に使用しました。

Review

最初に既存ファイルの接続部分と spreadsheet-file-extensions.ts、次に xlsx-workbook.ts・xlsx-drawings.ts・xlsx-chart-references.ts を確認してください。元の parser/grid のテストも含めています。

自動レビューは e2a402f で Code Review 6件(P1: 1件、P2: 5件)・Security Review 0件でした。6件とも a4f0904 で修正し、対象外とした指摘はありません。

指摘 対応
P1: 離れたセルで空の長方形を大量確保 行を最も広い列まで埋めず、欠落セルは描画時に空として扱う
P2: 指数書式が不正な表示になる 未対応の指数書式は保存された数値をそのまま表示
P2: 保存セルの外に伸びる結合範囲が縮む 結合範囲の終端をシート寸法に含める
P2: 広い条件付き書式で引数数の上限を超える 展開したセルを1件ずつ追加
P2: 複数グラフの gradient ID が衝突する React useId でグラフごとに分離
P2: 目盛りの増分が進まず停止する 回数を制限し、表現精度より小さい増分では端点を使う

6件の回帰テストを追加し、V8 でも条件付き書式15万セルと浮動小数点の目盛り計算を再確認しました。追加の独立 impeccable audit でも、新しい P0・P1 はありません。

a4f0904 の自動再レビューは Code Review 7件(すべてP2)・Security Review 0件でした。6件を c278e1c で修正し、生成物にない負数の SPARKLINE 列グラフ1件は対象外に記しました。

追加の指摘 対応
条件付き書式の低い優先度が上書きする 高い優先度のプロパティを保持し、別のプロパティは組み合わせる
分数書式が不正な表示になる 未対応の分数書式は保存された数値をそのまま表示
同じ型の複数 plot で系列が欠ける 全 plot を文書順に読む。二軸の厳密な再現は引き続き対象外
s 属性省略時に既定の書式が落ちる 既定の cellXfs[0] を適用
深夜直前の時刻が 24:00:00 になる 秒の丸めで日付を繰り上げる
数値・日付の文字が隣のセルに重なる 描画と同じ左右の寄せ方で、文字を広げる方向を決める
負数の SPARKLINE 列グラフの棒の高さ 今回の生成物・Excel sample にないため対象外

追加の回帰テストと独立 impeccable audit を行い、新しい P0・P1 はありません。c278e1c の自動レビューと CI は確認中です。

Agent skill upstream boundary

  • upstream の skill-installer は移植していません。

Notes

既知の制限

上流版 desktop から fork 版 host(runtime・SSH)に接続すると、host が .xlsx を isImage: true と spreadsheet の MIME で返すため、上流版 client は ImageViewer に渡して壊れた画像を表示します。desktop を fork 版にそろえるまでの移行期間の制限です。上流版 mobile は拡張子で画像と判定した場合だけ readPreview を使うため、この影響はありません。

サイズ変更の取っ手が先に並ぶため、5列・27行の fixture では Tab キーでシートタブへ到達するまで34回必要です。この PR では変更しません。

グラフの軸には通貨記号(¥)が付かず、棒の太さも LibreOffice の PDF と異なります。

指数書式と分数書式は未対応のため、保存された数値をそのまま表示します。

対象外

  • CSV の grid 切り出し、CSV 自体の変更、.xls、Word・PowerPoint、編集・保存、mobile、diff 内の Excel 表示、上流への PR は持ち込んでいません。
  • cache がない名前付き範囲・別ブック参照・式・飛び飛びの範囲は解決せず、その系列を描きません。数式の再計算も行いません。
  • 負数の SPARKLINE 列グラフの高さの修正は対象外です。今回の openpyxl・LibreOffice の生成物と Excel 12・15 の sample に SPARKLINE() の出力はなく、この PR では範囲を広げません(指摘)。
  • absoluteAnchor、未対応のグラフ種類、二軸などの厳密な再現は対象外です。グラフの見た目は Excel と完全には一致しません。
  • 文書内リンクで Orca の窓を遷移させません。.xlsm のマクロは読み込まず、実行しません。

merge は依頼元の受け入れ確認後に判断します。

Checklist

  • Excel preview の移植に範囲を限定
  • 利用者への変更点、接続箇所と採用理由を記載
  • screenshot と比較画像を添付
  • 正しさ・安全性・性能を自己レビュー
  • クロスプラットフォーム・リモート・旧 host への影響を検討
  • 最終検査と fork の CI 結果を記録(専用 runner の1件は未実行)

Session: orca-xlsx-preview(Codex)

Eotel and others added 2 commits October 28, 2026 16:46
Port stablyai#13532 into editor/xlsx with current local/runtime wiring. Preserve CSV, chat, terminal artifacts, and binary diff behavior. Support namespace URIs, one-cell extents, cacheless chart references, and chart-only sheets.

Co-authored-by: Markel Alvarado <[email protected]>
Keep only the perimeter borders of row bands inside a merged range. Verify drawing anchors through zoom changes and wait for selected tab underline transitions before capturing Electron evidence.

Co-authored-by: Markel Alvarado <[email protected]>
@Eotel Eotel self-assigned this Oct 28, 2026
Show a localized read-only status, keep sheet tabs visible in narrow panes, and use the existing i18next plural families for row and column counts.

Co-authored-by: Markel Alvarado <[email protected]>
@Eotel
Eotel marked this pull request as ready for review October 28, 2026 10:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-28T11:11:40.395219Z c278e1c New commits
🔒 Security Review ✅ Completed 2026-10-28T11:18:37.889853Z c278e1c New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2a402f4e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Preserve short rows, include merged extents, avoid argument and tick-loop limits, isolate chart gradients, and fall back to stored numbers for unsupported scientific formats.

Co-authored-by: Markel Alvarado <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4f0904a6f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Keep conditional-format priority, default cell styles, repeated chart plots, rounded dates, and inferred overflow direction. Preserve raw values for unsupported fraction formats.

Co-authored-by: Markel Alvarado <[email protected]>
@Eotel
Eotel merged commit 8f1dcce into eotel/main Oct 28, 2026
28 of 30 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.

1 participant