feat: more time ranges on the Location tab (30m, 6h, 12h, 3d)

Đang mở Phù hợp với người mới
#252 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 2 ngày

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

Đánh giá

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

Hướng nghiên cứu

Các khoảng thời gian nằm trong LOCATION_RANGES trong web/src/pages/deviceDetailFormat.ts, và rangePhrase trong cùng tệp cần thêm một trường hợp mới cho khoảng dưới một giờ (“the last 30 minutes”). Hãy đọc trước locationSince và bài kiểm thử khoảng thời gian hiện có trong deviceDetailFormat.test.ts. Công việc hoàn thành khi bộ chọn hiển thị 30m, 1h, 6h, 12h, 24h, 3d, 7d và All, và vitest chạy đạt với bài kiểm thử khoảng thời gian đã cập nhật.

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

Mô tả

enhancement
Area

Admin console (web)

The problem

The Location tab’s time range (from #139, thanks for porting it) offers 1h, 24h, 7d and All. On a phone in Accurate mode that reports
often, the jumps are large:
1h is often too long to see only the last trip, and 24h already mixes several trips;
between 24h and 7d there is nothing, so “the last few days” means scrolling through a whole week.
When I proposed #139 I used 30 min, 1 h, 6 h, 12 h, 24 h, 3 days, 7 days and All, and the in-between steps are the ones I use most.

Proposed solution

Add four entries to LOCATION_RANGES (web/src/pages/deviceDetailFormat.ts): 30m, 6h, 12h and 3d, so the picker reads
30m · 1h · 6h · 12h · 24h · 3d · 7d · All.
locationSince needs no change. rangePhrase needs one more case for under an hour (“the last 30 minutes”); 6h, 12h and
3d already read well (“the last 6 hours”, “the last 3 days”).
All stays the default, so the rail keeps the device’s latest fix.
The Segmented control fits on one line next to the title at 1440 px, and wraps under it at 1024 px (screenshot below).
I have this running locally on 0.5.1, with the range test in deviceDetailFormat.test.ts updated; vitest passes. Happy to open
a PR against the right branch if you’d like it.

location-ranges-1024 location-ranges-1440
Alternatives considered

Keep 4 ranges and add a custom from/to picker: more flexible, but more UI and code than a few presets.
Keep it as a local patch: works, but every update means carrying it again.

Before submitting
  • I searched existing issues and discussions for the same idea.
Ngôn ngữ chính
Java
Star
44
Fork
25
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
80

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 MDMesh-app/MDMesh

Tất cả issue của MDMesh-app/MDMesh

Issue tương tự

Thêm issue về Java

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.