PromptSuggestions (sugestões por contexto)

Đang mở
#1,204 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/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

Start in packages/ui/src/lib: read how Chip/ChipRow, Popover, Sheet and the other reusable pieces are written and exported through index.ts, then follow that pattern for a new PromptSuggestions component. One component file plus a test covering the four acceptance boxes: 44px touch target with visible focus, one onpick(prompt) call per click, no click or Tab focus when disabled, and nothing rendered for an empty items. Done when those tests pass and the component is exported from the package index.

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

Mô tả

area:a11y area:components enhancement

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

Conferido com git grep -il "PromptSuggestion\|Suggestion" origin/main -- packages/ui/src/lib (950628f2): só ocorrências não relacionadas (Button.svelte, index.ts, theme/define.ts). Peças reaproveitáveis que existem: MessageBubble, VirtualList, ConversationItem, CodeSnippet (./code), CopyButton, Chip/ChipRow, Popover, Sheet, Spinner, toast.

Referência no AC

Caminhos do repo AC (repo privado, só caminho):

apps/seller/src/components/copilot/chat-suggestions.tsx (BUDGET, HOME, PROPOSALS; suggestionsFor(pathname); SuggestionButton com min-h-9 e disabled quando busy); docked-panel.tsx e home-chat.tsx (só aparece com isFresh).

Defeitos do AC (leitura do código, não executado): - min-h-9 (36 px) abaixo do alvo mínimo de 44 px no toque (ver #1056).

  • Lista fixa por prefixo de rota (startsWith): rota nova cai no HOME.slice(0, 3) sem aviso.

Proposta

<PromptSuggestions items disabled onpick> com items: { label, prompt, icon? }[]. A app passa a lista; o kit cuida do alvo, do foco e do disabled.

Critério de aceite (testável)

  • Alvo de cada chip com 44 px no toque e foco visível.
  • Clicar em um chip dispara onpick(prompt) uma vez.
  • Com disabled, nenhum chip recebe clique nem foco de Tab.
  • Sem itens, o componente não renderiza.

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

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 codeatlasdev/ui

Tất cả issue của codeatlasdev/ui

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.