logs.gokuls.in

1 pull request merged across 1 repo

bahdotsh/wrkflw

Follow-up to #116, which routed most app-generated TUI log messages through add_timestamped_log but missed four bare self.logs.push(...) sites. Those lines lack the [HH:MM:SS] prefix the log renderer parses, so they still displayed ??:??:?? in the Execution/Logs tabs.

Changes

  • Convert the four remaining sites in crates/ui/src/app/state.rs to add_timestamped_log:
  • cycle_diff_filter_event — "Diff filter event: {} -> {}"
  • trigger_tab_copy_curl — "curl: ..." recipe lines
  • trigger_dispatch — "Dispatching {} to {:?} (branch: {})"
  • drain_trigger_outcomes — "Dispatched ..." / "Dispatch ... failed: ..."
  • Remove the three trim_logs_to_cap() calls (and the drained counter gating one of them) that only existed because the bare pushes bypassed add_log's built-in trim.
  • Widen LogProcessor::process_log_entry to pub(crate) so state tests can assert end-to-end behavior.

Testing

Three new tests call the real methods and run the actual appended log lines through the real parser, asserting the extracted timestamp is not ??:??:??. The trigger_dispatch site is not exercised end-to-end (it tokio::spawns a real dispatch) and is covered by pattern parity with the tested sites.

cargo test -p wrkflw-ui: 57 passed. cargo clippy -p wrkflw-ui --all-targets: clean.