Skip to content

Conversation

@simulot
Copy link
Owner

@simulot simulot commented Nov 29, 2025

This PR adds documentation and troubleshooting guidance for the hidden --ui-dump-events flag used to debug the experimental TUI event pipeline.

  • Documents the flag in docs/commands/upload.md
  • Adds a developer-focused troubleshooting guide in internal/ui/specifications/ui-dump-events-troubleshooting.md
  • Expands unit tests in app/upload/ui_pipeline_test.go to cover job summary event logging
  • Ensures code formatting and test coverage for new flag and helpers

This improves developer experience and makes it easier to diagnose issues in the new UI event stream.

- 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.
- 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
@github-actions
Copy link

github-actions bot commented Nov 29, 2025

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ✅ 0 package(s) with unknown licenses.
  • ⚠️ 1 packages with OpenSSF Scorecard issues.
See the Details below.

OpenSSF Scorecard

Scorecard details
PackageVersionScoreDetails
gomod/github.com/aymanbagabas/go-osc52/v2 2.0.1 🟢 3.4
Details
CheckScoreReason
Code-Review⚠️ 0Found 0/28 approved changesets -- score normalized to 0
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Security-Policy⚠️ 0security policy file not detected
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/charmbracelet/bubbletea 1.3.10 🟢 5.5
Details
CheckScoreReason
Maintained🟢 1017 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 5Found 9/17 approved changesets -- score normalized to 5
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Security-Policy🟢 10security policy file detected
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/charmbracelet/colorprofile 0.3.3 UnknownUnknown
gomod/github.com/charmbracelet/lipgloss 1.1.0 🟢 4.9
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Code-Review🟢 7Found 12/16 approved changesets -- score normalized to 7
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 54 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 5
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 10security policy file detected
Vulnerabilities🟢 73 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/charmbracelet/x/ansi 0.11.2 🟢 6.3
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 4Found 5/11 approved changesets -- score normalized to 4
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Fuzzing🟢 10project is fuzzed
License🟢 10license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ -1no releases found
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/charmbracelet/x/cellbuf 0.0.14 🟢 6.3
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 4Found 5/11 approved changesets -- score normalized to 4
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Fuzzing🟢 10project is fuzzed
License🟢 10license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ -1no releases found
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/charmbracelet/x/term 0.2.2 🟢 6.3
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 4Found 5/11 approved changesets -- score normalized to 4
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Fuzzing🟢 10project is fuzzed
License🟢 10license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ -1no releases found
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/clipperhouse/displaywidth 0.6.0 UnknownUnknown
gomod/github.com/clipperhouse/stringish 0.1.1 UnknownUnknown
gomod/github.com/clipperhouse/uax29/v2 2.3.0 🟢 5
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review⚠️ 0Found 0/30 approved changesets -- score normalized to 0
Maintained🟢 1019 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
Packaging⚠️ -1packaging workflow not detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
License🟢 10license file detected
Fuzzing🟢 10project is fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/erikgeiser/coninput 0.0.0-20211004153227-1c3628e74d0f ⚠️ 2.9
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies⚠️ -1no dependencies found
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Token-Permissions⚠️ -1No tokens found
Binary-Artifacts🟢 10no binaries found in the repo
Code-Review⚠️ 0Found 0/10 approved changesets -- score normalized to 0
SAST⚠️ 0no SAST tool detected
Dangerous-Workflow⚠️ -1no workflows found
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Security-Policy⚠️ 0security policy file not detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 91 existing vulnerabilities detected
gomod/github.com/mattn/go-isatty 0.0.20 🟢 4.2
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Packaging⚠️ -1packaging workflow not detected
Code-Review🟢 8Found 14/16 approved changesets -- score normalized to 8
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Security-Policy⚠️ 0security policy file not detected
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/mattn/go-localereader 0.0.1 🟢 3.3
Details
CheckScoreReason
Dangerous-Workflow⚠️ -1no workflows found
Token-Permissions⚠️ -1No tokens found
Code-Review⚠️ 2Found 1/5 approved changesets -- score normalized to 2
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Pinned-Dependencies⚠️ -1no dependencies found
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Vulnerabilities🟢 100 existing vulnerabilities detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Security-Policy⚠️ 0security policy file not detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/mattn/go-runewidth 0.0.19 🟢 4.9
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Code-Review🟢 6Found 6/10 approved changesets -- score normalized to 6
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 1012 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Security-Policy⚠️ 0security policy file not detected
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/muesli/ansi 0.0.0-20230316100256-276c6243b2f6 🟢 3.4
Details
CheckScoreReason
Code-Review⚠️ 0Found 0/8 approved changesets -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities🟢 100 existing vulnerabilities detected
gomod/github.com/muesli/cancelreader 0.2.2 🟢 3.7
Details
CheckScoreReason
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Code-Review🟢 4Found 4/10 approved changesets -- score normalized to 4
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 91 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/muesli/reflow 0.3.0 🟢 4.1
Details
CheckScoreReason
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Code-Review🟢 7Found 19/24 approved changesets -- score normalized to 7
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/muesli/termenv 0.16.0 🟢 3.9
Details
CheckScoreReason
Code-Review🟢 8Found 13/16 approved changesets -- score normalized to 8
Packaging⚠️ -1packaging workflow not detected
Maintained⚠️ 01 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 73 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
gomod/github.com/xo/terminfo 0.0.0-20220910002029-abceb7e1c41e 🟢 3
Details
CheckScoreReason
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Dangerous-Workflow⚠️ -1no workflows found
Packaging⚠️ -1packaging workflow not detected
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Token-Permissions⚠️ -1No tokens found
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ -1no dependencies found
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • go.mod

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
@github-actions
Copy link

✅ Fast Feedback Passed

All code quality checks have passed:

  • ✅ Linting
  • ✅ Unit Tests (Linux)
  • ✅ Security Scanning
  • ✅ Build Verification (Linux, Windows, macOS)

Next Steps:
🚀 E2E tests will run automatically if code paths changed.

Copy link
Owner Author

@simulot simulot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/run-e2e

@simulot
Copy link
Owner Author

simulot commented Nov 29, 2025

/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants