fix(loader-website): the progress bar ignores the first download

Đang mở Phù hợp với người mới
#141 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bun, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Đọc apps/website/src/window.ts ở phần quanh setLoadingStatus và apps/website/src/cache/cache.ts ở phần quanh vòng lặp tải xuống. Kiểm tra tiến trình được cập nhật như thế nào cho chỉ mục 0 và thời điểm mỗi lượt tải xuống hoàn tất. Hoàn tất khi thanh tiến trình phản ánh các lượt tải xuống đã hoàn tất, bao gồm tệp đầu tiên và trường hợp chỉ có một tệp đã lỗi thời.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

app:website bug good first issue
Which app is this bug report for?

website

Issue description

setLoadingStatus checks index && totalFiles > 0, so index 0 is treated as false. The cache calls it with n starting at 0 (cache.ts#L77-L82).

  • The bar doesn't move for the first file, and stays empty when only one file is outdated (the usual case in watch mode).
  • The bar is set to (n + 1) / total before that file is downloaded.

Expected: the bar reflects the downloads actually done.

Suggested fix: check index != null (or typeof index === "number"), and update the bar after each download completes.

Found during a read-only audit of main @ 044c766 (2026-11-11).

Code sample
if (loadingBarFill && index && totalFiles > 0) { // index 0 is falsy
  const progress = ((index + 1) / totalFiles) * 100;
  loadingBarFill.style.width = `${progress}%`;
}
Versions
  • @nanoforge-dev/loader-client / @nanoforge-dev/loader-server / @nanoforge-dev/loader-website 1.7.0 (main @ 044c766)
  • Bun 1.3.14
  • Linux x86_64
Issue priority

Low (slightly annoying)

I have tested this issue on a development release

044c766

Ngôn ngữ chính
TypeScript
Star
1
Fork
0
Merge trung bình
17 giờ 25 phút
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NanoForge-dev/Loader

Tất cả issue của NanoForge-dev/Loader

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.