Skip to content

enhance(client): エラーダイアログから診断情報をコピーできるように - #94

Open
mattyatea wants to merge 2 commits into
developfrom
codex/copy-error-info
Open

mattyatea wants to merge 2 commits into
developfrom
codex/copy-error-info

Conversation

@mattyatea

@mattyatea mattyatea commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What

共通の os.alert({ type: 'error' }) に「エラー情報をコピー」を追加します。コピーしてもダイアログは閉じません。

error を渡した場合はエラー名・メッセージ・スタック・APIのコード/ID/エンドポイント・サーバーエラー識別情報を含めます。日時・アプリバージョン・ブラウザ情報・表示文言も記録します。通話の参加・作成などのエラーにも接続し、apiWithDialog の内部エラー専用コピー処理を共通化しました。

Why

「問題が発生しました」だけでは利用者から調査に必要な情報を受け取れず、開発者ツールの操作を依頼するのも難しいため。

Additional info (optional)

エラーオブジェクトは診断用フィールドのみ抽出します。コンソール全体・リクエスト本文・認証トークンなどの任意プロパティは収集しません。エラー本体を渡さない既存の呼び出し元では、表示文言と実行環境のみコピーします。

  • PASS: 関連unit test 5ファイル・57件(コピー後に閉じないこと、既存のOK操作、診断情報の抽出、GET/POSTのAPI識別、通話の既存動作)。
  • PASS: node scripts/check-shipping.mjs --base origin/develop(変更ソースのlint、SPDX、locale safety)、追加テスト3ファイルのESLint、git diff --check。
  • BASELINE: vue-tsc --noEmit は既存の生成型・localeなどのエラーで失敗。同じ依存環境で変更前の origin/develop も検査し、パスと行番号を除いた診断内容が一致しました。
  • BASELINE: 既存の calls-join-confirmation.test.ts には今回触れていない2箇所の prefer-arrow-callback 違反があります。
  • PASS: Chromiumのコンポーネントプレビューで表示・コピー内容の一致・コピー後のダイアログ維持・「わかった」で閉じる操作を確認。
  • SKIPPED: バックエンドを含むアプリ全体のE2E、全体ビルド。ErrorWithCopy のStorybook storyも追加しています。
  • 通話に参加できない根本原因を修正するPRではなく、次回発生時に利用者が情報を渡せるようにする変更です。
  • 関連Issue: 該当する既存Issueは見つかりませんでした。
  • CHANGELOG候補: Enhance: エラーダイアログから診断情報をコピーできるように

モバイル幅の表示例です。PRの MkDialog / MkModal / MkButton / MkToast と既定のMi Lightテーマを使用したコンポーネントプレビューで、サンプルのエラーを渡しています。利用者の障害を再現した画像ではありません。

エラー表示時:

問題が発生しましたの下にエラー情報をコピーを表示

コピー後(ダイアログを維持し、完了通知を表示):

コピー完了通知と開いたままのエラーダイアログ

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

Copilot AI balanced review requested due to automatic review settings October 24, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 insufficient remaining quota.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 63a3f7e and 3a8952b.

Files selected for processing: 12
  • packages/frontend/src/components/MkCallsCreateDialog.vue
  • packages/frontend/src/components/MkCallsRoomWindow.vue
  • packages/frontend/src/components/MkDialog.stories.impl.ts
  • packages/frontend/src/components/MkDialog.vue
  • packages/frontend/src/os.ts
  • packages/frontend/src/utility/calls-window.ts
  • packages/frontend/src/utility/error-info.ts
  • packages/frontend/src/utility/misskey-api.ts
  • packages/frontend/test/unit/api-error-info.test.ts
  • packages/frontend/test/unit/calls-join-confirmation.test.ts
  • packages/frontend/test/unit/dialog-error-info.test.ts
  • packages/frontend/test/unit/error-info.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

APIエラーにエンドポイント情報を追加し、エラー情報を整形してエラーダイアログに表示・コピーできるようにしました。通話操作で失敗した場合も、捕捉したエラーをアラートへ渡します。

Changes: エラー診断情報

Layer / File(s) Summary
エラー情報の収集と整形
packages/frontend/src/utility/error-info.ts, packages/frontend/src/utility/misskey-api.ts, packages/frontend/test/unit/api-error-info.test.ts, packages/frontend/test/unit/error-info.test.ts
API失敗時にエンドポイントを含めて拒否するよう変更しました。formatErrorInfoは環境情報、コンテキスト、エラー詳細をJSON文字列に整形します。関連する出力内容をテストします。
診断情報のダイアログ表示とコピー
packages/frontend/src/os.ts, packages/frontend/src/components/MkDialog.vue, packages/frontend/src/components/MkDialog.stories.impl.ts, packages/frontend/test/unit/dialog-error-info.test.ts
alertとpromiseDialogからエラー情報をダイアログへ渡します。診断情報があるエラーダイアログにコピー操作を追加し、表示と操作をテストします。
通話操作のエラー伝達
packages/frontend/src/components/MkCallsCreateDialog.vue, packages/frontend/src/components/MkCallsRoomWindow.vue, packages/frontend/src/utility/calls-window.ts, packages/frontend/test/unit/calls-join-confirmation.test.ts
通話ルームの作成や各種操作が失敗した場合に、捕捉したエラーをアラートへ渡します。関連するアラートの期待値を更新します。

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant misskeyApi
  participant apiWithDialog
  participant alert
  participant MkDialog
  misskeyApi->>apiWithDialog: エラーとendpointを含むreject
  apiWithDialog->>alert: errorとendpointを渡す
  alert->>MkDialog: 整形したerrorInfoを渡す
Loading

Suggested labels: packages/frontend

Merge Risk: Minimal · up to 3a895

This change adds a copy action for error diagnostics to the error dialog and passes captured errors from the call features into it. No concrete merge-blocking risk remains. Real-browser clipboard behavior was not tested, but that is normal verification uncertainty and not a defect.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 9 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed PRタイトルは「エラーダイアログから診断情報をコピーできるように」で、変更の主目的(共通エラーダイアログへの診断情報コピー機能追加)と一致しています。『enhance(client)』の形式も妥当で、変更内容を具体的に示しています。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed PRの説明はテンプレートの必須項目である「What」「Why」「Additional info」「Checklist」を含み、変更内容、目的、テスト結果、既知の制約、未実施項目を具体的に説明しています。
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 9 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

エラーの形を整えます
環境と情報を記録します
ダイアログにそっと渡します
必要なときにはコピーできます
通話の失敗も伝わります

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🖥 Frontend Diagnostics Report

(No significant changes)

View details

Requests by resource type
Type Requests Encoded bytes
Base Head Δ Base Head Δ
Document 2 2 0 34 KB 34 KB 0 B
Script 152 152 0 2.4 MB 2.4 MB $\color{orange}{\text{+1.3 KB}}$
Stylesheet 63 63 0 320 KB 320 KB 0 B
Fetch 28 28 0 47 KB 47 KB 0 B
Image 9 9 0 238 KB 238 KB 0 B
Font 2 2 0 129 KB 129 KB 0 B
Other 9 9 0 421 KB 421 KB $\color{green}{\text{-5 B}}$
V8 heap snapshot statistics
Metric @ Base @ Head Δ MAD
$\color{gray}{\rule{8pt}{8pt}}$ Total 12 MB
± 7 KB
12 MB
± 9 KB
$\text{+1.9 KB}$
$\text{+0\%}$
11 KB
$\color{orange}{\rule{8pt}{8pt}}$ Code 3 MB 3 MB $\text{+5.8 KB}$ 2 KB
$\color{red}{\rule{8pt}{8pt}}$ Strings 1.3 MB 1.3 MB $\text{+844 B}$ 292 B
$\color{cyan}{\rule{8pt}{8pt}}$ JS arrays 122 KB 122 KB $\text{+12 B}$ 0 B
$\color{green}{\rule{8pt}{8pt}}$ Typed arrays 0 B 0 B 0 B 0 B
$\color{yellow}{\rule{8pt}{8pt}}$ System objects 0 B 0 B 0 B 0 B
$\color{violet}{\rule{8pt}{8pt}}$ Other JS objs 2.2 MB 2.2 MB $\text{+1.1 KB}$ 287 B
$\color{pink}{\rule{8pt}{8pt}}$ Other non-JS objs 5.5 MB 5.5 MB $\text{+521 B}$ 3.9 KB

Download representative heap snapshot: base / head

📦 Bundle Stats

Chunk size diff (2 updated, 0 added, 0 removed)
Chunk Base Head Δ Δ (%)
(total) 6.1 MB 6.1 MB $\text{+771 B}$ $\text{+0\%}$
src/components/MkCallsRoomWindow.vue ja-JP/4j7lSfsgi-Cps4ySwC.js → ja-JP/4j7lSfsgi-BTUGZJqp.js
24 KB 25 KB $\text{+91 B}$ $\color{orange}{\text{+0.4\%}}$
src/components/MkCallsCreateDialog.vue ja-JP/4j7lSfsgi-BvHbPtRs.js → ja-JP/4j7lSfsgi-3nE9Ezx9.js
1.9 KB 1.9 KB $\text{+8 B}$ $\color{orange}{\text{+0.4\%}}$
(other generated chunks) 2.3 MB 2.3 MB $\text{+672 B}$ $\text{+0\%}$
Startup chunk size (0 updated, 0 added, 0 removed)
Chunk Base Head Δ Δ (%)
(total) 958 KB 959 KB $\text{+672 B}$ $\text{+0.1\%}$
(other generated chunks) 884 KB 885 KB $\text{+672 B}$ $\text{+0.1\%}$
(other) 74 KB 74 KB 0 B 0%

Startup chunks are the Vite entry for src/_boot_.ts and its static imports.

Bundles Modules Entries Imports Size
Static Dynamic Rendered Gzip Brotli
Base 509 3,031 22 11,274 366 11 MB 3 MB 2.6 MB
Head 509 3,032 22 11,277 366 11 MB 3 MB 2.6 MB
Δ 0 $\color{orange}{\text{+1}}$ 0 $\color{orange}{\text{+3}}$ 0 $\color{orange}{\text{+1.6 KB}}$ $\text{+446 B}$ $\text{+433 B}$
Δ (%) 0% $\text{+0\%}$ 0% $\text{+0\%}$ 0% $\text{+0\%}$ $\text{+0\%}$ $\text{+0\%}$

Open treemap HTML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants