Thiết kế màn hình
Tải bản gốc ↓Thiết kế màn hình CRM-142
Chỉ wireframe văn bản; không ảnh runtime hay tính năng đã triển khai.
Contacts [Import contacts]
Keep your customer contacts in one place.
┌ Import contacts ────────────────────────────────────┐
│ CSV stays in this browser. │
│ Maximum 100 KB (100,000 bytes), 500 nonblank records.│
│ Required columns: name, email. Optional: company. │
│ CSV file [Choose file] customer-contacts.csv │
│ [Review CSV] [Back to contacts] │
│ Review: Ready 3 · Invalid 1 · Duplicate 2 │
│ Record 1 · Jordan Lee · jordan@example.test │
│ Company: Fieldwork, Inc. · Ready │
│ …all six records, each with outcome/reason… │
│ [ ] Fail next save │
│ [Import ready contacts] [Cancel import] │
└────────────────────────────────────────────────────┘
Search contacts [Name, email or company]
[Live status]
[Existing contact cards]
▸ Add contact
Import contacts mở bảng và đặt tiêu điểm vào CSV file. Review CSV bị tắt khi chưa chọn tệp hoặc đang đọc. Dùng accept=".csv,text/csv" như gợi ý bộ chọn, không phải xác minh. Chọn tệp đặt lại lỗi/số lượng/xem trước và cho chọn lại cùng tệp. Xem xét là đọc cục bộ rõ ràng, không ghi gì. Hiện trạng thái đang đọc rồi đặt tiêu điểm vào tiêu đề xem xét (tabindex="-1") và thông báo số lượng qua vùng hiện có #status. Kết quả đọc cũ không được thay lựa chọn mới hay mở lại bảng đã hủy.
Với samples/customer-contacts.csv đối chiếu initialContacts từ src/contacts.js:
| Bản ghi | Tên | Kết quả / lý do hiển thị |
|---|---|---|
| 1 | Jordan Lee | Ready |
| 2 | Alex Duplicate | Duplicate: Email already in Contacts. |
| 3 | Missing Email | Invalid: Enter a valid email. |
| 4 | Casey "CJ" Kim | Ready |
| 5 | Jordan Again | Duplicate: Email repeats earlier valid record 1. |
| 6 | <img src=x onerror=alert(1)> | Ready; display literal text |
Hiện name, email và company đã bỏ khoảng trắng của từng bản ghi; thiếu company hiển thị “: ”. Lý do còn gồm “Name is required.” và lỗi kết hợp thiếu tên/email không hợp lệ. Xuống dòng trong ngoặc kép dễ đọc bằng pre-wrap. Không sửa hàng trong ứng dụng: “Fix invalid rows in your CSV and choose the file again.” Lỗi cấu trúc hiển thị ví dụ “Unclosed quote in record 2. Nothing imported.” và tắt xác nhận. Giới hạn cùng tiêu đề thiếu/trùng có thông báo cụ thể tương tự.
Lời xác nhận: “Import 3 ready contacts; skip 3 invalid or duplicate records.” Tên truy cập được của nút giữ là Import ready contacts; tắt nếu Ready bằng không hoặc đang lưu. Không modal xác nhận thêm. Khi lưu hiện “Saving contacts…” và ngăn đổi tệp/xem/hủy/thêm. Nếu thất bại giữ toàn bộ dữ liệu, đặt tiêu điểm xác nhận và báo “Could not save contacts. Try again.” Giữ nhãn xác nhận để thử lại. Fail next save chuẩn bị một lần lưu thực (Add hoặc Import), đặt lại khi được dùng và truyền tùy chọn fail của bộ điều hợp; không xóa liên hệ.
Sau khi nhập mẫu thành công trong trình duyệt mới: “Added 3 contacts; skipped 3 records.” Đóng bảng, xóa tìm kiếm để lộ liên hệ đã nhập, kết xuất tổng năm liên hệ và đặt tiêu điểm Import contacts. Số thực có thể khác sau xác minh lại. Cancel/Back đặt tiêu điểm Import contacts và báo “Import cancelled. Contacts unchanged.” Không xóa tìm kiếm.
Mọi điều khiển có nhãn, ngữ nghĩa nút/checkbox gốc và thứ tự Tab DOM logic; Enter kích hoạt nút, Space chuyển checkbox demo. Giữ vòng tiêu điểm nhìn thấy. Không bẫy tiêu điểm. Ở 320px dùng một cột, hành động xuống dòng, giới hạn ô tệp và ngắt email/văn bản dài; thẻ giữ nhãn trường và kết quả nhìn thấy, không chỉ màu. Desktop giữ nội dung rộng 1050px và trường thẻ rộng hơn. Không cuộn ngang trang. Kiểm tra bàn phím,320px và desktop là dự kiến, chưa chạy.
Tệp gốc và chi tiết nguồn
output/docs/screen-design.md.txt · SHA-256 c2b1dc590b78cce4048445b09ac398e19d11c1bef1b9b255b3a71aeb91e48cd0
# CRM-142 screen design
Text wireframe only; no runtime screenshot or implemented feature.
```text
Contacts [Import contacts]
Keep your customer contacts in one place.
┌ Import contacts ────────────────────────────────────┐
│ CSV stays in this browser. │
│ Maximum 100 KB (100,000 bytes), 500 nonblank records.│
│ Required columns: name, email. Optional: company. │
│ CSV file [Choose file] customer-contacts.csv │
│ [Review CSV] [Back to contacts] │
│ Review: Ready 3 · Invalid 1 · Duplicate 2 │
│ Record 1 · Jordan Lee · jordan@example.test │
│ Company: Fieldwork, Inc. · Ready │
│ …all six records, each with outcome/reason… │
│ [ ] Fail next save │
│ [Import ready contacts] [Cancel import] │
└────────────────────────────────────────────────────┘
Search contacts [Name, email or company]
[Live status]
[Existing contact cards]
▸ Add contact
```
`Import contacts` opens the panel and focuses `CSV file`. `Review CSV` is disabled without a selected file and while reading. Use `accept=".csv,text/csv"` as a chooser hint, not validation. File selection resets errors/counts/preview and permits reselecting the same file. Review is an explicit local read; it writes nothing. Show reading status, then focus the review heading (`tabindex="-1"`) and announce counts through existing `#status`. A stale read result must not replace a newer selection or reopen a cancelled panel.
For `samples/customer-contacts.csv` against `initialContacts` from `src/contacts.js`:
| Record | Name | Outcome / visible reason |
| --- | --- | --- |
| 1 | Jordan Lee | Ready |
| 2 | Alex Duplicate | Duplicate — Email already in Contacts. |
| 3 | Missing Email | Invalid — Enter a valid email. |
| 4 | Casey "CJ" Kim | Ready |
| 5 | Jordan Again | Duplicate — Email repeats earlier valid record 1. |
| 6 | `<img src=x onerror=alert(1)>` | Ready; display literal text |
Display every record's trimmed name, email and company; absent company shows “—”. Reasons also cover “Name is required.” and combined missing-name/invalid-email errors. Quoted embedded newlines remain readable with pre-wrap. No in-app row editing: “Fix invalid rows in your CSV and choose the file again.” Structural errors show e.g. “Unclosed quote in record 2. Nothing imported.” and disable confirmation. Limits and missing/duplicate headers have similarly specific messages.
Confirmation copy: “Import 3 ready contacts; skip 3 invalid or duplicate records.” Button accessible name stays `Import ready contacts`; disable when Ready is zero or saving. No additional confirmation modal. While saving show “Saving contacts…” and prevent file/review/cancel/add mutations. On failure keep all preview data, focus confirmation and announce “Could not save contacts. Try again.” Keep the confirmation label for retry. `Fail next save` arms one actual save attempt (Add or Import), resets when consumed, and passes the adapter's fail option; it does not clear contacts.
After successful sample import in a fresh browser: “Added 3 contacts; skipped 3 records.” Close panel, clear search to expose imported contacts, render five total contacts, focus Import contacts. Actual counts may differ after revalidation. Cancel/Back focus Import contacts and announce “Import cancelled. Contacts unchanged.” They do not clear the search.
All controls have labels, native buttons/checkbox semantics and logical DOM tab order; Enter activates buttons, Space toggles the demo checkbox. Retain the existing visible focus ring. No focus trap. At 320px use a single column, wrap actions, constrain file input, and break long emails/text; cards retain visible field labels and outcome text (never color alone). At desktop keep the existing 1050px content width and use wider card fields. No horizontal page scroll. Keyboard, 320px and desktop checks are planned, not executed.