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 — feat: #98 Settings に「今すぐアップデートを確認」ボタンを追加 by ymnao · Pull Request #138 · ymnao/scripta

Conversation

@ymnao

@ymnao ymnao commented Jun 5, 2026

Copy link
Copy Markdown
Owner

概要

Settings ダイアログの「このアプリについて」セクションに 「今すぐアップデートを確認」 ボタンを追加し、起動時 24h interval の自動チェックに加えてユーザが任意のタイミングで手動チェックできるようにする。

関連 Issue

Closes #98

移行 Stage

  • Stage 5: OGP / PDF / アップデート

変更内容

コア実装

  • useUpdateCheck に triggerManualCheck() / manualCheckInProgress を追加
    • 更新あり: 既存 AppLayout のダイアログを開く(リリースページへの動線を共有)
    • 最新: success toast「お使いのバージョンは最新です (vX.Y.Z)」
    • 失敗: error toast「アップデートの確認に失敗しました」
    • `inProgressRef` で多重起動防止(StrictMode の race を含む)
    • `triggerManualCheck` は `enabled` (autoUpdateCheck トグル) をバイパスする(ユーザ明示操作なので auto 設定をオーバーライド、24h timer も bump)
  • description 文字列構築を `formatUpdateDescription(info)` ヘルパに集約、dialog state 更新を `applyUpdateInfo(info)` で auto/manual の single entry point に統一
  • `SettingsDialog` に `RefreshCw` アイコン付きボタンを追加(実行中は spin animation + 「確認中...」 + disabled)
  • `AppLayout` から `onCheckForUpdate` / `updateCheckInProgress` で配線

テスト

  • `useUpdateCheck.test.ts`: triggerManualCheck の 7 経路(更新あり/最新/失敗/in-progress 状態/多重起動防止/openReleasePage/StrictMode 回帰)
  • `SettingsDialog.test.tsx`: ボタンクリックで onCheckForUpdate 発火、updateCheckInProgress=true で disabled + 「確認中...」表示
  • `beforeEach` で `saveLastUpdateCheck` mock を `mockReset().mockResolvedValue(undefined)` に戻し test 独立性を担保

経緯(commit 単位)

commit 内容
`a26a72c` feat 初期実装(unmountedRef ガード版)
`1bdd7a7` fix StrictMode 下で `unmountedRef` が永続 true になり「確認中...」が解除されない バグ修正。React 19 では unmount 後 setState 警告が撤廃されているため unmountedRef 自体を削除
`e117a1e` refactor /simplify レビュー 6 件適用(ヘルパ抽出 / コメント修正 / JSDoc / useCallback 削除 / optional → required / test 重複削除)
`542c3dc` test P3 レビュー(test 独立性 + SettingsDialog UI テスト追加)

動作確認

  • 失敗: 実 GitHub API(v0.1.0 release 未登録のため 404)→ error toast
  • 最新: `commands.ts` 一時 stub → success toast「お使いのバージョンは最新です (v0.0.0)」
  • 更新あり: `commands.ts` 一時 stub → ダイアログ表示 + 「ダウンロードページを開く」で外部ブラウザが開く
  • StrictMode 下でボタンが「確認中...」のまま固定されない
  • verify chain green: typecheck / lint / format / unit 1975 passed / e2e renderer 160 passed / build / legacy-residue

関連メモ

  • 残課題は chore: v0.1.0 を GitHub Releases に登録してアップデート検証を bootstrap #99(v0.1.0 GitHub Releases 登録、user 操作必須)のみ。本 PR とセット運用で「手動チェックが常に最新を返さない」状態を解消する
  • `saveLastUpdateCheck` は manual 経路でも bump する(直近で手動確認した直後の次回起動時 auto-check を抑止する意図)

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

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

All reactions
ymnao and others added 4 commits June 5, 2026 02:49
@ymnao @claude
feat: #98 Settings に「今すぐアップデートを確認」ボタンを追加
a26a72c
- useUpdateCheck に triggerManualCheck / manualCheckInProgress を追加
  - 更新あり: 既存の AppLayout のダイアログを開く
  - 最新: success toast「お使いのバージョンは最新です (vX.Y.Z)」
  - エラー: error toast「アップデートの確認に失敗しました」
  - inProgressRef で多重起動を防ぎ、unmountedRef で hook unmount 後の setState を抑止
  - lastCheck タイムスタンプは更新する(24h auto check との bootstrap 共有)
- SettingsDialog の「このアプリについて」セクションに RefreshCw アイコン付きボタンを追加
  - 実行中は spin animation + 「確認中...」表示 + disabled
- AppLayout から prop (onCheckForUpdate / updateCheckInProgress) で配線
- ユニットテスト 6 件追加(更新あり/最新/失敗/in-progress 状態/多重起動防止/openReleasePage)

Closes #98

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@ymnao @claude
fix: triggerManualCheck が StrictMode で永遠に「確認中...」のまま固定される
1bdd7a7
useUpdateCheck の unmountedRef は cleanup で true にセットされるが、
remount 時に false にリセットされない。StrictMode の mount→unmount→remount
サイクルで初回 cleanup 後に true 固定となり、その後の triggerManualCheck は
最初の await 直後で early return、finally の setManualCheckInProgress(false)
も unmountedRef ガードで skip されてスピナーが解除されない。

React 19 では unmount 後 setState の警告が撤廃されているため unmountedRef
自体が不要。削除して常に finally で state を解除するよう簡略化。

回帰テストとして StrictMode wrapper で triggerManualCheck を実行し、
manualCheckInProgress が false に戻ることを確認するケースを追加。

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@ymnao @claude
refactor: useUpdateCheck と SettingsDialog の細かい整理
e117a1e
/simplify レビューで指摘された 6 件の cleanup を適用。

- description 文字列の重複を formatUpdateDescription ヘルパに集約 (auto/manual
  両経路で同じ文言を構築していた重複を解消)
- dialog state 更新を applyUpdateInfo ヘルパに統一 (auto/manual の single entry
  point。useCallback でメモ化して useExhaustiveDependencies を満たす)
- inProgressRef のコメントが「state ではなく ref」と書いていたが実際は両方使う
  実装になっていたため「state は UI 用、ref は race guard」に修正
- triggerManualCheck に JSDoc を追加 (enabled トグルをバイパスする意図、24h
  timer を bump する意図を明示)
- triggerManualCheck の useCallback を削除 (button onClick への直渡しなので
  参照安定性は不要)
- SettingsDialog の onCheckForUpdate / updateCheckInProgress を required に変更
  (call site は AppLayout のみで常に渡しているため optional は dead defensive。
  SettingsDialog.test.tsx の defaultProps にも追加)
- useUpdateCheck.test.ts の afterEach での useToastStore リセットを削除
  (beforeEach 側で次 it の頭で必ずリセットされるため重複)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@ymnao @claude
test: P3 指摘の test 独立性と SettingsDialog ボタン UI 担保
542c3dc
- useUpdateCheck.test.ts の beforeEach で saveLastUpdateCheck mock を
  mockReset().mockResolvedValue(undefined) で default 実装に戻す
  vi.clearAllMocks() は call history のみ clear するため、cleanup 関連テストで
  mockReturnValue(pending Promise) を差し替えた状態が後続テストへ leak していた
  (現状は fire-and-forget のため hang はしないが test 独立性の弱さを解消)

- SettingsDialog.test.tsx に新ボタン「今すぐアップデートを確認」の UI テストを
  2 件追加:
  - クリックで onCheckForUpdate prop が 1 回呼ばれる
  - updateCheckInProgress=true で disabled かつ「確認中...」ラベル表示、
    disabled 状態のクリックは onCheckForUpdate を発火させない

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings June 5, 2026 01:33
Copilot AI reviewed Jun 5, 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 137823f into main Jun 5, 2026
7 checks passed

Uh oh!

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

@ymnao
ymnao deleted the feature/manual-update-check branch June 5, 2026 01:42
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.

feat: Settings に「今すぐアップデートをチェック」ボタンを追加

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.