Recorte de imagem com ponto focal (moldura proporcional, arrastar, teclado, saída 2x)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 38/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- html, tailwindcss, typescript
- Bereich
- accessibility, frontend
Rechercherichtung
Start from index.ts exports and Image.svelte to match existing API conventions, then add a pure cropPlan module under ./utils/crop and an ImageCrop component. Verify against the acceptance criteria: 3000×1500 at 16:9 exports 3840×2160 within 1e-2, drag clamps within source bounds, arrow steps of 0.02 update aria-valuetext, and canvas.toBlob honors the requested MIME type. The private AC paths are reference only, so rely on the proposed API and write component tests for the geometry helpers plus the 390 px layout.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
(leitura de origin/main: index.ts exports e Image.svelte lido via raw) Image tem ratio e fit (cover/contain) para exibir, mas não recorta nem exporta arquivo. FileUpload tem capture e drop. Não há cropper nem ponto focal.
Referência no AC
Caminhos do repo AC (repo privado, só caminho):
apps/web/src/components/videowall-banners/crop-dialog.tsx (CropDialog, renderCrop, moldura role="slider", setas de 0,02, "Cortar e enviar" e "Manter e usar ponto focal"); banners.helpers.ts:273-296 (cropPlan com retinaScale 2, focalFromCrop); components/creative/art-uploader.tsx:40, 93-98, 149-183 ("Ajustar recorte" abre o diálogo com slot e orientation).
Defeitos do AC (verificados por leitura do código): (leitura) nenhum visível. Ponto focal sem alternativa de toque fora do arrastar: as setas cobrem teclado.
Proposta
<ImageCrop bind:focal src mime={image/jpeg|image/png} aspect={{w,h}} retina={2} onconfirm={(blob) => {}} onkeepfocal={(f) => {}} />, com cropPlan puro exportado (./forms ou ./utils/crop), saída via canvas.toBlob e :focus-visible nas setas. Sem crossorigin a saída falha: documentar.
Critério de aceite (testável)
- Imagem 3000×1500 com aspecto 16:9 gera saída 3840×2160 (retina 2x) e o blob respeita a proporção com erro ≤ 1e-2.
- Arrastar a moldura até a borda mantém
crop.left >= 0ecrop.left + crop.width <= src.width. - Setas movem o foco em passos de 0,02 e o
aria-valuetextmostra "Ponto focal X% x, Y% y". - Com
mime="image/png"o blob temtypeimage/png; com JPEG,image/jpeg. - Em 390 px, o diálogo ocupa a folha inferior e a moldura cabe em
max-h-[55vh]sem rolagem horizontal.
Mãe: #1089
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6
- Forks
- 3
- Ø Merge
- 5 Std. 21 Min.
- Gemergte PRs (30 T.)
- 378
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus codeatlasdev/ui
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
codeatlasdev/ui#1340 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:a11y area:components bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
codeatlasdev/ui#1336 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
codeatlasdev/ui#1329 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
codeatlasdev/ui#1292 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:components enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
codeatlasdev/ui#1198 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in codeatlasdev/ui
Ähnliche Issues
-
bug frontend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
CivicTechWR/accessible-housing-portal#578 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
nekko-labs/nekko-agent#2998 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
sandbox-quantum/switch#2163 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement ux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
lolimmlost/aidj#433 ·
Maintainer antworten meist innerhalb von 1 Tag
-
test: ipcShownDialogKeys.test.tsx can fail the unit run with 'window is not defined' after it endsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag