Skip to content

🎨 Palette: アップロードボタンの非同期処理に一貫したローディングスピナーを適用#877

Open
is0692vs wants to merge 2 commits into
stagingfrom
palette/upload-spinner-ux-2547667791071906187
Open

🎨 Palette: アップロードボタンの非同期処理に一貫したローディングスピナーを適用#877
is0692vs wants to merge 2 commits into
stagingfrom
palette/upload-spinner-ux-2547667791071906187

Conversation

@is0692vs
Copy link
Copy Markdown
Contributor

@is0692vs is0692vs commented May 21, 2026

概要
アップロード画面 (apps/web/src/app/upload/page.tsx) における非同期処理中(アップロード中)のローディングスピナーが、インラインの生のHTML要素(<span className="animate-spin ...">)で実装されていました。これを、アプリケーションの他画面で使用されている共通の <Spinner /> コンポーネントに置き換えることで、視覚的な一貫性と保守性を向上させました。

変更内容

  • apps/web/src/app/upload/page.tsxSpinner コンポーネントをインポートしました。
  • インラインのスピナーHTMLを <Spinner className="h-4 w-4" /> に置換しました。
  • .Jules/palette.md に今回の UX/UI の一貫性に関する学び(日本語)を追記しました。

検証

  • vitesteslint を実行し、既存機能に問題がないことを確認済みです。

PR created automatically by Jules for task 2547667791071906187 started by @is0692vs

Greptile Summary

アップロード画面のインラインスピナーを共通の <Spinner /> コンポーネントに置き換え、UI の一貫性と保守性を向上させた小規模なリファクタリングです。

  • apps/web/src/app/upload/page.tsx: ハードコードされた <span className=\"animate-spin ...\"><Spinner className=\"h-4 w-4\" /> に置き換え。なお Spinner コンポーネントは内部で h-4 w-4 を既定クラスとして持つため、渡している className は冗長です。
  • .Jules/palette.md: 今回の変更から得られた学習をドキュメントに追記。新エントリの年が 2024 になっており誤字と思われます。

Confidence Score: 4/5

変更は局所的で安全にマージできます。

スピナーコンポーネントへの置き換えは正しく機能し、motion-safe:animate-spin によりアクセシビリティも改善されています。className="h-4 w-4" の冗長な指定と palette.md の年号誤字の2点が残っています。

.Jules/palette.md の日付誤字と upload/page.tsx の冗長な className を確認してください。

Important Files Changed

Filename Overview
apps/web/src/app/upload/page.tsx インラインスピナーを共通の <Spinner /> コンポーネントに置き換え。className="h-4 w-4" が冗長。
.Jules/palette.md 学習ログ追記。新エントリ日付が 2024-05-21 となっており誤字あり。

Sequence Diagram

sequenceDiagram
    actor User as ユーザー
    participant Button as アップロードボタン
    participant Spinner as Spinner コンポーネント
    participant API as apiFetch

    User->>Button: クリック(送信)
    Button->>API: アップロードリクエスト
    Button->>Spinner: "uploading=true でスピナー表示"
    Note over Spinner: motion-safe:animate-spin / aria-hidden=true
    API-->>Button: レスポンス返却
    Button->>Spinner: "uploading=false でスピナー非表示"
    Button-->>User: 完了
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
.Jules/palette.md:26
ドキュメント内の日付が `2024-05-21` になっていますが、直前のエントリ(2026-05-21)と矛盾しています。`2026-05-21` の誤りと思われます。

```suggestion
## 2026-05-21 - Consistent Loading Spinners for Async Actions
```

### Issue 2 of 2
apps/web/src/app/upload/page.tsx:565
`Spinner` コンポーネントは内部で既に `h-4 w-4` をデフォルトクラスとして持っています(`spinner.tsx` の6行目参照)。そのため `className="h-4 w-4"` を渡すと同じクラスが二重に出力されます。機能的な問題はありませんが、冗長な記述です。

```suggestion
                <Spinner />
```

Reviews (1): Last reviewed commit: "UX/🎨: アップロード画面のローディング状態を共有のSpinnerコンポーネ..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

is0692vs and others added 2 commits May 21, 2026 16:48
Release: staging -> main (2026-05-21 07:43)
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
open-shelf Ignored Ignored May 21, 2026 3:18pm

@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@dosubot dosubot Bot added the enhancement New feature or request label May 21, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Warning

Rate limit exceeded

@is0692vs has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 57 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3b2a84fd-872b-4568-a6fa-d9fd273da0aa

📥 Commits

Reviewing files that changed from the base of the PR and between d429569 and d373b8f.

📒 Files selected for processing (2)
  • .Jules/palette.md
  • apps/web/src/app/upload/page.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/upload-spinner-ux-2547667791071906187

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 and usage tips.

@github-actions github-actions Bot changed the base branch from main to staging May 21, 2026 15:18
@github-actions
Copy link
Copy Markdown

このリポジトリでは staging 先行フローを採用しています。PR のターゲットを staging に変更しました。staging で動作確認後、stagingmain の PR を作成してください。

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request standardizes the use of the component by replacing an inline SVG spinner in the upload page and updating the project's documentation to reflect this best practice. A review comment suggests removing redundant CSS classes from the Spinner component and improving accessibility for screen readers by adding sr-only text.

{uploading ? (
<span className="flex items-center gap-2">
<span className="h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" />
<Spinner className="h-4 w-4" />
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.

medium

Spinner コンポーネントは内部で既に h-4 w-4 クラスをデフォルトとして持っているため、冗長なプロパティを削除できます。また、リポジトリのアクセシビリティ方針に基づき、ボタンのテキストをスピナーに置き換える際は、スクリーンリーダーが状態を識別できるように sr-only テキストなどでアクセシブルな名前を維持してください。

Suggested change
<Spinner className="h-4 w-4" />
<Spinner />
<span className="sr-only">読み込み中...</span>
References
  1. ボタンのテキストをスピナーに置き換える際は、スクリーンリーダーがボタンの目的や状態を識別できるよう、sr-only テキストなどを用いてアクセシブルな名前を維持する必要があります。

Comment thread .Jules/palette.md
**Learning:** 非同期のアクション(招待の承認・拒否など)において、ボタンを押した後にレスポンスが返るまでの間、処理中であることを明示するために `<Spinner />` を表示しボタンを非活性(disabled)にすることが UX/アクセシビリティ観点で重要です。また、成功時・失敗時それぞれに `toast.success` と `toast.error` を用いて明確な結果のフィードバックを行うことで、ユーザー体験が大きく向上します。
**Action:** 今後リスト内の各アイテムに対して非同期アクションを実行する際は、該当する `id` と `action` の種類を状態として保持し、ローディングとフィードバックの UX パターンを適用します。

## 2024-05-21 - Consistent Loading Spinners for Async Actions
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.

P2 ドキュメント内の日付が 2024-05-21 になっていますが、直前のエントリ(2026-05-21)と矛盾しています。2026-05-21 の誤りと思われます。

Suggested change
## 2024-05-21 - Consistent Loading Spinners for Async Actions
## 2026-05-21 - Consistent Loading Spinners for Async Actions
Prompt To Fix With AI
This is a comment left during a code review.
Path: .Jules/palette.md
Line: 26

Comment:
ドキュメント内の日付が `2024-05-21` になっていますが、直前のエントリ(2026-05-21)と矛盾しています。`2026-05-21` の誤りと思われます。

```suggestion
## 2026-05-21 - Consistent Loading Spinners for Async Actions
```

How can I resolve this? If you propose a fix, please make it concise.

{uploading ? (
<span className="flex items-center gap-2">
<span className="h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" />
<Spinner className="h-4 w-4" />
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.

P2 Spinner コンポーネントは内部で既に h-4 w-4 をデフォルトクラスとして持っています(spinner.tsx の6行目参照)。そのため className="h-4 w-4" を渡すと同じクラスが二重に出力されます。機能的な問題はありませんが、冗長な記述です。

Suggested change
<Spinner className="h-4 w-4" />
<Spinner />
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/src/app/upload/page.tsx
Line: 565

Comment:
`Spinner` コンポーネントは内部で既に `h-4 w-4` をデフォルトクラスとして持っています(`spinner.tsx` の6行目参照)。そのため `className="h-4 w-4"` を渡すと同じクラスが二重に出力されます。機能的な問題はありませんが、冗長な記述です。

```suggestion
                <Spinner />
```

How can I resolve this? If you propose a fix, please make it concise.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

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

Labels

enhancement New feature or request size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant