feat(dateien): Bilder aus der Zwischenablage einfügen (Strg+V)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start with src/LageBuch.App.Shared/Views/FilesView.axaml.cs to understand the existing file-drop handling, then read src/LageBuch.AppLogic/ViewModels/FilesViewModel.cs and src/LageBuch.Domain/Files/IncidentFile.cs for upload paths and file constraints. Implementing clipboard paste and byte-based browser drops also needs desktop clipboard and drag-and-drop investigation; done means both routes accept sanitized, valid images within the existing size limit, with EXIF handling considered alongside #384.
Written by the indexing model from the issue text.
Description
Rückmeldung aus der Praxis
Copy Paste in Dateien von Bildern einer Webseite oder aus der Zwischenablage
Heute
Die Zwischenablage wird nirgends angefasst. grep -riE "clipboard|paste|ctrl\+v" src/ liefert genau einen Treffer, und der ist ein unbeteiligter Kommentar in
Behaviors/IntegerOnly.cs. Kein TopLevel.Clipboard, kein
KeyBinding Gesture="Ctrl+V".
Drag & Drop gibt es — aber nur für Dateien vom Datenträger:
// src/LageBuch.App.Shared/Views/FilesView.axaml.cs
DataContext is FilesViewModel { IsReadOnly: false, IsUploading: false }
&& e.DataTransfer.Contains(DataFormat.File)
und aufgelöst wird über f.TryGetLocalPath(). Zieht man ein Bild direkt aus
dem Browser, liefert der Browser Bytes oder eine URL, keinen lokalen Pfad — der
Drop wird kommentarlos ignoriert. Das ist genau der Fall aus der
Rückmeldung.
Der eigentliche Hinderungsgrund
Der Aufnahmeweg ist durchgehend pfadbasiert:
// src/LageBuch.AppLogic/ViewModels/FilesViewModel.cs:187
public async Task AddFilesAsync(IReadOnlyList<string> paths) // -> File.ReadAllBytesAsync
Es gibt keinen Einstieg, der ein byte[] entgegennimmt. Ein Bild aus der
Zwischenablage hat aber nie einen Pfad.
Vorschlag
- Ein
AddBytesAsync(name, contentType, byte[])nebenAddFilesAsync, auf das
beide neuen Wege einzahlen. - Strg+V im Reiter DATEIEN, und zusätzlich Bild-Bytes beim Drop akzeptieren,
nicht nurDataFormat.File. - Einen Namen erzeugen, da keiner mitkommt — etwa
Zwischenablage-20260920-1432.png. Der muss wie jeder andere durch
IncidentFile.SanitizeFileName.
Die vorhandenen Schranken greifen unverändert: erlaubte Typen sind
jpg/jpeg/png/gif/webp/pdf, die Obergrenze 25 MB
(src/LageBuch.Domain/Files/IncidentFile.cs) — beides passt für
Zwischenablage-Bilder.
Zu bedenken
- Ein Bild von einer Webseite bringt EXIF mit; #384 will das ohnehin
abstreifen. Ein neuer Aufnahmeweg sollte dort gleich mit angeschlossen
werden. - Android hat eine eigene Zwischenablage-Geschichte; das Issue ist erst einmal
für den Desktop gedacht.
Verwandt: #347, #384, #383.
- Dominant language
- C#
- Stars
- 1
- Forks
- 3
- Avg merge
- 4h 34m
- Merged PRs (30d)
- 182
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CodeForFire/lagebuch
-
bug ux
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CodeForFire/lagebuch#714 ·
Maintainers usually reply within 1 day
-
bug ux
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
CodeForFire/lagebuch#713 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CodeForFire/lagebuch#405 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
CodeForFire/lagebuch#349 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
CodeForFire/lagebuch#348 ·
Maintainers usually reply within 1 day
All issues in CodeForFire/lagebuch
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
KnifeLemon/Filee#363 ·
Maintainers usually reply within 1 day
-
[CI] .trgen-ignore required for several grammars.Possibly taken @kaby76 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
antlr/grammars-v4#5073 ·
Maintainers usually reply within 1 day
-
/api/oauth/introspect emits clientId and tokenType instead of RFC 7662's client_id and token_typeOpenbug P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nightscout/nocturne#2317 ·
Maintainers usually reply within 1 day
-
[BUG]: Position intent set on a simple order is dropped when it becomes a bracket, OCO or OTO orderPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
alpacahq/alpaca-trade-api-csharp#903 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
joinrpg/joinrpg-net#5752 ·
Maintainers usually reply within 1 day