- System tray app z NotifyIcon + ContextMenuStrip - Polling API orderPRO (GET /api/print/jobs/pending) - Pobieranie etykiet PDF i druk przez PdfiumViewer - Formularz ustawień: URL API, klucz, drukarka, interwał - Okno logów z historią (ciemny motyw, Consolas) - Self-contained .NET 8 publish (win-x64) - Milestone v0.7 Zdalne drukowanie etykiet — COMPLETE Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5.6 KiB
5.6 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, duration, started, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | duration | started | completed | |||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 20-windows-client | 01 | desktop-app |
|
|
|
|
|
|
|
~2h | 2026-03-22T20:30:00Z | 2026-03-22T22:45:00Z |
Phase 20 Plan 01: Windows Client Summary
Aplikacja C# WinForms w system tray — polling API orderPRO, automatyczne pobieranie i drukowanie etykiet PDF na drukarce termicznej via PdfiumViewer.
Performance
| Metric | Value |
|---|---|
| Duration | ~2h |
| Started | 2026-03-22 |
| Completed | 2026-03-22 |
| Tasks | 3 (2 auto + 1 checkpoint) |
| Files created | 13 |
Acceptance Criteria Results
| Criterion | Status | Notes |
|---|---|---|
| AC-1: Aplikacja w system tray | Pass | NotifyIcon + ContextMenuStrip z Ustawienia, Logi, Wstrzymaj, O programie, Zamknij |
| AC-2: Konfiguracja API | Pass | SettingsForm z URL, klucz, drukarka, interwał + Test połączenia |
| AC-3: Polling i pobieranie | Pass | Timer co N sekund, download label, mark complete |
| AC-4: Drukowanie A6 | Pass | PdfiumViewer CreatePrintDocument z PaperSize A6 (105x148mm) |
| AC-5: Obsługa błędów | Pass | Error icon, tooltip, logi — polling kontynuuje |
Accomplishments
- Standalone .exe (self-contained .NET 8, ~170MB z runtime)
- System tray z menu kontekstowym i dwuklikiem na ustawienia
- Polling z konfigurowalnym interwałem (5-300s)
- PdfiumViewer renderuje PDF i drukuje bez zewnętrznych narzędzi
- Okno logów z historią (ciemny motyw, Consolas, kopiowanie)
- Thread-safe UI updates via SynchronizationContext
- Settings w %APPDATA%/OrderPROPrint/settings.json
Deviations from Plan
Summary
| Type | Count | Impact |
|---|---|---|
| Scope additions | 1 | Okno logów (request użytkownika) |
| Auto-fixed | 3 | JSON deserialization, pdfium.dll, NotifyIcon API |
Total impact: Lepsza diagnostyka dzięki logom, stabilniejszy druk.
Auto-fixed Issues
1. JSON deserialization mismatch
- Issue: API zwraca
{"jobs": [...]}, klient deserializował jakoList<PrintJob> - Fix: Dodano
PendingJobsResponsewrapper, poprawiono property names - Files: Models/PrintJob.cs, Services/PrintApiClient.cs
2. pdfium.dll missing in publish
- Issue:
PublishSingleFilenie dołącza natywnej DLL z NuGet - Fix: Directory publish + MSBuild target
CopyPdfiumNative - Files: OrderPROPrint.csproj
3. NotifyIcon API incompatibility
- Issue:
NotifyIcon.IsDisposedi.Invoke()nie istnieją w .NET 8 - Fix: SynchronizationContext.Post + własny
_isDisposedflag - Files: TrayApplicationContext.cs
Scope Additions
1. Okno logów (LogForm)
- Requested by: użytkownik podczas testów
- Purpose: diagnostyka błędów druku
- Files: Forms/LogForm.cs, Forms/LogForm.Designer.cs
Decisions Made
| Decision | Rationale | Impact |
|---|---|---|
| PdfiumViewer zamiast SumatraPDF | Zero external deps, native rendering | Większy .exe ale prostsze wdrożenie |
| Directory publish zamiast single-file | pdfium.dll native incompatible | Cały folder publish/ do skopiowania |
| Opcja C — jeden klient | Multi-client wymaga zmian backendu | Dla wielu komputerów trzeba dodać api_key_id |
| .NET 8 SDK zainstalowany via winget | Potrzebny do budowania projektu | Nowa zależność dev na maszynie |
SonarQube Scan
Not applicable — sonar-scanner skonfigurowany tylko dla PHP. Projekt C# jest poza zakresem skanowania.
Next Phase Readiness
Ready:
- Milestone v0.7 kompletny — wszystkie 3 fazy zakończone
- Pełny flow: zlecenie z UI → API → Windows Client → drukarka
Concerns:
- Multi-client: wielu klientów drukuje duplikaty (opcja A/B do rozważenia w przyszłości)
- Rozmiar .exe: 170MB (self-contained z runtime .NET)
Blockers:
- None
Phase: 20-windows-client, Plan: 01 Completed: 2026-03-22