[FEAT]: Show an error with Try again when a chat's history fails to load

オープン 初心者向け
#183 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
dart, flutter
領域
mobile

調査の方向性

まず mobile/lib/controllers/chat/active_chat_controller.dart から始め、openChat、loadMoreMessages、hasMoreMessages を追ってください。次に mobile/lib/pages/chat/chat_page.dart と mobile/lib/widgets/ui/components.dart の EmptyState を読みます。チャットを開いた状態でローカルサーバーを停止するか、GET /api/messages が 500 を返すようにして再現します。最初のページと過去ページの読み込みに失敗したときに「Couldn't load messages」と Try again ボタンが表示され、再試行でページネーションがリセットされ、キャッシュ済みのメッセージが表示されたままになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

area: mobile enhancement good first issue

Context

If loading a chat's history fails (server error, offline), the chat currently shows only cached messages and a spinner, or nothing, with no explanation. #174 stopped it from retrying in a loop. Now it just stops quietly.

What to do

  • When the first page or an older page fails, show a short message in the chat ("Couldn't load messages") with a Try again button.
  • Try again resets paging and loads again.
  • Keep cached messages visible while showing the error.

Where to look

mobile/lib/controllers/chat/active_chat_controller.dart (openChat, loadMoreMessages, hasMoreMessages), mobile/lib/pages/chat/chat_page.dart, and EmptyState in mobile/lib/widgets/ui/components.dart for styling.

Good to know

To reproduce, point the app at a local server and stop the server while a chat is open, or make GET /api/messages return 500.

主要言語
Dart
スター
9
フォーク
5
平均マージ
49分
マージ済み PR(30日)
34

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CommandLineCoding/Elephant のほかの issue

CommandLineCoding/Elephant の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。