feature: document and test experimental UI event dump flag#1237
Open
feature: document and test experimental UI event dump flag#1237
Conversation
- Implemented the UI pipeline in `app/upload/ui_pipeline.go` to manage UI events and state updates during asset uploads. - Added a `MemPublisher` for testing purposes to capture and assert UI events in unit tests. - Created a structured event system in `internal/ui/core/messages` to handle various UI events such as asset queuing, uploading, and failure notifications. - Established a modular directory layout for the UI module, including core state management, messaging, and platform-specific implementations for terminal, web, and native shells. - Documented the UI module architecture and development guidelines in `internal/ui/README.md` and `internal/ui/specifications/tui-revamp-plan.md`. - Introduced build tags to manage different UI shell implementations and ensure backward compatibility with existing CLI commands.
…ui-revamp-foundations
- add runner jobs watcher plus JobSummary fields and wire it into the upload UI pipeline with cancellable lifecycle - expose file processor event hooks, batch counters via ticker, and forward processing metadata as structured logs - cover the new plumbing with unit tests (runner jobs, channel publisher, file processor hook)
- fan out the experimental UI event stream so both the legacy tcell UI and future shells can consume the same publisher output without racing - teach the legacy UI to read EventLogLine and EventJobsUpdated payloads, updating the log pane and server jobs sparkline directly from streamed telemetry (with a poller fallback) - add file-processor event hooks, stats batching, and channel fan-out helpers (with unit tests) to support the new wiring
Added user-facing documentation for the hidden --ui-dump-events flag in upload.md Created troubleshooting guide in ui-dump-events-troubleshooting.md for developer use Expanded unit tests in ui_pipeline_test.go to cover job summary event logging Ensured code formatting and test coverage for new flag and helpers
Dependency ReviewThe following issues were found:
OpenSSF ScorecardScorecard details
Scanned Files
|
Removed redundant return statements flagged by staticcheck Updated function signatures and error handling to satisfy unparam/staticcheck Ensured code style and linter compliance in ui_pipeline.go
Details: wrap the UI event logging tests with a mutex-protected buffer so the race detector stops flagging concurrent reads/writes make ChannelPublisher.send return immediately once the context is canceled before attempting to publish, keeping the cancellation test deterministic
✅ Fast Feedback PassedAll code quality checks have passed:
Next Steps: |
Owner
Author
|
/run-e2e |
split the web/native platform layers into ui_web and ui_native build-tag pairs with shared config + error stubs so future shells can opt-in cleanly drop the old monolithic stubs and clarify runner fallback behavior plus the new Phase 0 progress log in README.md
Major architectural improvements for event handling and new Bubble Tea based dashboard: **Event Dispatcher Pattern (Phase 1 & 2)** - Created EventDispatcher with thread-safe multi-sink broadcasting - Added EventSink interface for structured event processing - Implemented SlogSink for file logging with level detection - Created UISink to forward file events to experimental UI - Updated Recorder to dispatch events to all registered sinks - Maintained backwards compatibility with legacy SetLogger() - Added comprehensive test suite (16 tests, all passing) **Experimental TUI Dashboard** - Implemented upload_dashboard.go with Bubble Tea framework - Full-screen layout: header, 4-card stats row, log panel, footer - Responsive design: 3 breakpoints (vertical, 2x2, 4-in-row layouts) - Color-coded logs with chronological display (oldest→newest) - Server URL and user email display in header - Equal-width status cards with vertical separators - Bold+underline card titles for visual hierarchy **Status Cards Implementation** - Discovery: images/videos counts and sizes, filtered assets - Processing: sidecars, albums, stacks, tags (placeholders) - Progress: pending/processed/discarded/errors with totals - Server Jobs: active and waiting job counts **Event Pipeline Integration** - SetupUILogHandler registers UISink with FileProcessor - uiLogWriter captures app-level slog output for UI - Inventory watcher polls server statistics periodically - Jobs watcher updates server operation status - Real-time event stream consumption via Bubble Tea **UI State Management** - RunStats with Stage, ThroughputSamples, InFlight tracking - ServerInventory with Photos/Videos/Total and latency - LogEvent with Level/Message/Timestamp/Details - CloneRunStats for thread-safe payload delivery - maxLogEntries=1000 for historical log storage **Build & Configuration** - Added Bubble Tea and Lipgloss dependencies (go.mod/go.sum) - UI enabled via --ui-experimental flag - Conditional progress output based on experimental flag - Wait for user input before closing experimental UI - Inventory poll interval configurable (default 2s) **Testing** - Created dispatcher_test.go with comprehensive coverage - Added upload_dashboard_test.go for UI model behavior - MockSink pattern for event capture in tests - Concurrency tests (10 goroutines × 100 events) - All existing tests passing **Documentation** - Added doc.go for terminal package overview - Updated tui-revamp-plan.md with specification paths - Created upload-dashboard-wireframe.md for design reference - Removed obsolete web/app_stub.go Backwards compatibility maintained: legacy UI continues working unchanged. Experimental UI activated via --ui-experimental flag without breaking existing workflows. Related PRs: #1237
The method RecordNonAsset was misleading because it's used for: - Non-asset files (sidecars, metadata, banned files) - Informational events about assets (stacking, duplicates) - Error events during file access The new name LogEvent better reflects its purpose: logging file events without asset lifecycle tracking, regardless of whether the file is an asset or not. Changes: - Renamed FileProcessor.RecordNonAsset() to LogEvent() - Updated method documentation to clarify usage - Renamed test function TestRecordNonAsset to TestLogEvent - Updated 35 call sites across adapters and upload modules No functional changes or user-facing impact.
- add console sink for no-UI mode and replace manual ticker handling - stream run stats and log metadata to legacy TUI with incremental counters - enrich log events with event_code_id and size_bytes for UI consumers - remove unused uiPage fileProcessor field and related import - tests: go test ./...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds documentation and troubleshooting guidance for the hidden --ui-dump-events flag used to debug the experimental TUI event pipeline.
This improves developer experience and makes it easier to diagnose issues in the new UI event stream.