Autosave e salvar ao sair: estado visível, Esc reverte, erro preserva texto
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 62/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ệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Begin with the existing EditableRow and useForm (dirty, reset) code to see how the saved value and reset are tracked, then add an autosave prop taking onsave(value): Promise<boolean> plus an idle|saving|saved|error state to TextField, Select and Switch, triggered on blur/Enter with optional debounce. The four acceptance criteria are the test list: one call per commit, role=alert with preserved text on false, Esc restoring without calling onsave, cancelling a superseded save. Done when those component tests pass and the status is exposed via role=status.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Versão: @codeatlasdev/ui 4.6.0 · código lido em main (950628f2) · classe: lacuna (migração do AC)
Problema
O AC depende deste comportamento hoje e a lib não o oferece. Sem ele, a migração perde qualidade no desktop, no mobile ou no PWA.
O que a lib já oferece (para não duplicar) e o que falta
EditableRow (linha); useForm (dirty, reset). Sem autosave, sem estado "salvando/salvo/erro".
Referência no AC
Caminhos do repo AC (repo privado, só caminho):
apps/web/src/components/access/org/org-sheet.tsx:45-48,94 (save em blur, sem reversão); apps/web/src/components/content-admin/fields.tsx:111 (onBlur={commit}); apps/web/src/components/finances/bank/balance-display.tsx (Enter/Esc/blur); apps/web/src/components/admin/price-table-autosave-indicator.tsx (indicador de autosave por célula).
Defeitos do AC (verificados por leitura do código): (leitura) org-sheet.tsx MemberLine: Esc não reverte; mutate sem tratamento de erro na linha; o rascunho não volta ao valor salvo se a mutação falhar. (leitura) fields.tsx TagInput: commit sempre limpa o texto, mesmo quando o valor é recusado em silêncio (duplicado, curto ou acima do limite).
Proposta
autosave em TextField/Select/Switch: onsave(value): Promise<boolean>, estado (idle|saving|saved|error) com role=status, Esc reverte ao último salvo, falha mantém o texto e mostra erro com "Tentar de novo". Gatilho: blur ou Enter, com debounce opcional.
Critério de aceite (testável)
- Digitar "abc" e sair chama
onsave("abc")uma vez; enquanto pendente, o estado ésaving. -
onsaveresolvendofalsedeixa o texto digitado e mostra erro comrole=alert. - Esc com o campo sujo restaura o último valor salvo sem chamar
onsave. - Dois saves seguidos não chegam fora de ordem (cancela o anterior).
Mãe: #1089
- Ngôn ngữ chính
- TypeScript
- Star
- 6
- Fork
- 3
- Merge trung bình
- 5 giờ 21 phút
- Pull request đã merge (30 ngày)
- 378
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codeatlasdev/ui
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
codeatlasdev/ui#1340 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:a11y area:components bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
codeatlasdev/ui#1336 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
codeatlasdev/ui#1329 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
codeatlasdev/ui#1292 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:components enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
codeatlasdev/ui#1198 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codeatlasdev/ui
Issue tương tự
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
sandbox-quantum/switch#2163 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
automated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/dashboard kind/bug QA/dev-automation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug pydanty:is-working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pydantic/pydantic-ai#13939 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
self-host
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
funmusicplace/mirlo#2625 ·
Maintainer thường phản hồi trong vòng 1 ngày