Skip to content

Phase 1: 基盤の刷新と不具合修正 - #1

Merged
mioupa merged 37 commits into
mainfrom
phase1-foundation
Oct 7, 2026
Merged

mioupa merged 37 commits into
mainfrom
phase1-foundation

Conversation

@mioupa

@mioupa mioupa commented Oct 7, 2026

Copy link
Copy Markdown
Owner

docs/REQUIREMENTS.md 9章の Phase 1(F1–F6、A1–A7、A9–A11、B5–B7)を実装しました。A8 と Phase 2 以降には手を付けていません。

基盤(F1–F6)

  • F1: PyScript を 2024.11.1 から 2026.7.3(Pyodide 314 / Python 3.14、pandas 3.0.2、matplotlib 3.10.8)に更新し、<script type="py"> と pyscript.toml に移行しました。
  • F2: index.html を要件 4.1 の構成(css/、js/、py/main.py、py/mplgui/)に分割しました。Jekyll は _ で始まるファイルを配信しないので、__init__.py を _config.yml の include に加えています。
  • F3: 画面の状態を JS の設定オブジェクト(version: 1)に集約しました。Python は DOM を読まず、JSON を受け取って JSON を返します。settings、loader、plotting、runner などは純粋なモジュールです。plotting.py は Phase 2 で codegen に置き換える前提の暫定実装です。
  • F4: 単体テスト(pytest、264件)と E2E テスト(pytest-playwright、26本)を追加しました。テストデータはすべて合成データです。
  • F5: GitHub Actions を追加しました。push のたびに単体テストを、PR のたびに E2E を実行します。E2E は Jekyll でビルドした _site を /matplotlib_gui/ 配下で配信して行います。
  • F6: 変更前と変更後の計測値を docs/PERFORMANCE.md に記録しました。

不具合の修正

  • A1: データ確認に行番号を表示し、除外行をグレーにしました。
  • A2: 同じファイルを選び直すと再読込されます。
  • A3: 描画要求に世代番号を付け、同時に実行する描画を1件にまとめました。
  • A4: 起動中に選んだファイルと設定を保持し、準備完了後に反映します。
  • A5: 文字コードを UTF-8(BOM 付きを含む)、CP932、EUC-JP の順に判定し、判定結果を表示します。
  • A6: フォントの取得元をバージョン固定にし、Cache Storage に保存し、通信停止を検出します。
  • A7: 数値に変換できず除外した件数を、系列ごとに警告します。
  • A9: parentNode 抑制処理を削除しました(承認済み。原因は旧 matplotlib_pyodide バックエンド)。
  • A10: 警告フィルタを、pyarrow 由来の DeprecationWarning と、フォントにグリフがないときの UserWarning に限定しました。
  • A11: README と AGENTS.md を更新しました。
  • B5: 起動の段階と描画中の状態を表示します。
  • B6: ARIA 属性とラベルの関連付けを追加しました。
  • B7: 既定色の重複と点サイズの自動切替を直し、エラーメッセージをすべて日本語にしました。

その他

  • CDN の URL はすべてバージョンを固定しました。固定されていない URL を検出する単体テストがあります。
  • openpyxl は xlsx を初めて開いたときに、固定した wheel から取得します。
  • 起動時間は変更前より、コールドで +7%、ウォームで +20% 長くなりました。PyScript 2026.7.3 の実行環境自体のコストとして許容し、新しい基準値にしました(要件 8 章に注記)。

確認方法

  • uv run pytest
  • uv run pytest tests/e2e
  • Pages と同じサブパスで確かめる場合: E2E_BASE_PATH=/matplotlib_gui/ uv run pytest tests/e2e

🤖 Generated with Claude Code

mioupa and others added 30 commits October 7, 2026 17:22
docs/REQUIREMENTS.md: requirements for the refactor and feature work.
_config.yml: exclude development docs from GitHub Pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use <script type="py" config="./pyscript.toml"> and pinned core.js/core.css.
openpyxl 3.1.5 and et_xmlfile 2.0.0 are installed from PyPI via micropip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Python 3.14, pandas 3.0.2, matplotlib 3.10.8, numpy 2.4.3, openpyxl 3.1.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Suppression is unchanged. Each suppression point (JS error/unhandledrejection/
console.error handlers and the Python except blocks) now emits
console.warn("[mplgui] suppressed parentNode error:", where, message).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
index.html is now markup only. JS becomes ES modules under js/ (functions the
Python side calls are exposed on window), Python moves to py/main.py plus a
DOM-free mplgui package (loader, runner, fonts) mapped via pyscript.toml [files].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
__init__.py is listed under include (Jekyll skips underscore files); dev-only
files are excluded. pytest runs tests/unit by default with py/ on pythonpath.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Delete the JS window error/unhandledrejection/console.error handlers, the
success fallback in notify, and the Python parentNode branches. Unexpected
errors now always surface as an error status with details.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JS: defaults.js, state.js (single source of truth), bridge.js (JSON calls,
debounced scheduling), ui/* bind inputs to the state and render payloads.
Python: errors, settings (schema v1, Japanese validation), plotting
(transitional create_figure), api (JSON in/out); loader/runner/fonts are
pure. py/main.py only registers window.mplgui. Unit tests added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…an test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, show file name and encoding

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lure

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ings chosen during startup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decide the encoding on raw bytes, then parse decoded text. Japanese
errors for parser/empty/xlsx/delimiter failures. Add euc_jp.csv fixture
and make multi_sheet.xlsx generation deterministic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h UserWarning only)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…overy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Abort the font download when no headers or no new bytes arrive for
FONT_STALL_MS (counts as a failure: one warning, no retry). The first
render waits at most FONT_FIRST_RENDER_WAIT_MS for the font, then renders
with fallback fonts and re-renders once when the font becomes ready.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the PlaceHolderLayoutEngine left by tight_layout() before savefig; real
engines are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
packages_cache=passthrough with only Pyodide-bundled packages; openpyxl and
et_xmlfile are installed from version-pinned wheel URLs via loadPackage the
first time an .xlsx is loaded, with a progress message and a Japanese error
on failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erving

E2E server gains E2E_BASE_PATH so the app is served under /matplotlib_gui/
like GitHub Pages; the E2E job builds the site with jekyll-build-pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add onerror handlers on the module script tags (js/main.js, PyScript core.js) that
show a Japanese error in #status and #progress instead of staying on "loading".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mioupa and others added 7 commits October 7, 2026 20:22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
REQUIREMENTS 2.1/A9: suppression removed in Phase 1 with the owner's approval.
REQUIREMENTS 8 and PERFORMANCE.md: Phase 1 measurements are the new baseline;
the remaining warm-start gap is accepted as runtime cost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mioupa
mioupa merged commit 3c82827 into main Oct 7, 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.

1 participant