feat: QoL improvements: shortcutkeys++, version made visible, completion time to include date and TZ#60
feat: QoL improvements: shortcutkeys++, version made visible, completion time to include date and TZ#60yfarjoun wants to merge 4 commits intofg-labs:mainfrom
Conversation
- Show resolved absolute path in header instead of raw CLI argument - Show version in help panel subtitle - Show date in completion time when ETA crosses midnight, include timezone - Make toggle keys (p, e, w, a, r, Ctrl+r) work in table and log modes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughDelegate toggle/refresh keys to a shared handler in nested table-navigation and log-viewing modes; show installed Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
snakesee/tui/monitor.py (1)
1250-1257: Let nested modes reuse the shared toggle handler.These branches duplicate the toggle allowlist that
WorkflowMonitorTUI._handle_toggle_key()already owns. Calling the shared handler directly keeps normal, table, and log modes from drifting again the next time a toggle is added.♻️ Suggested simplification
- # Help and toggle keys work in table mode - if key == "?": - self._show_help = True - self._force_refresh = True - return False - if key.lower() in ("p", "e", "w", "a", "r") or key == "\x12": - self._handle_toggle_key(key) + # Help and toggle keys work in nested modes too + if self._handle_toggle_key(key): return FalseApply the same change in both
WorkflowMonitorTUI._handle_table_navigation_key()andWorkflowMonitorTUI._handle_log_viewing_key().Also applies to: 1454-1461
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@snakesee/tui/monitor.py` around lines 1250 - 1257, The table and log-mode key handlers duplicate the toggle allowlist; remove the duplicated checks in WorkflowMonitorTUI._handle_table_navigation_key and WorkflowMonitorTUI._handle_log_viewing_key and instead delegate to the shared handler: call self._handle_toggle_key(key) for any key that might be a toggle (preserving the existing behavior of the "?" help branch), then return False when the toggle handler was invoked; this ensures all toggle keys are handled centrally by WorkflowMonitorTUI._handle_toggle_key and avoids drift when toggles are added.tests/test_tui.py (1)
1642-1690: The new nested-mode tests still miss several keys.The production change adds
randCtrl+rin nested modes, but neither test asserts them.test_toggle_keys_work_in_log_viewing_mode()also skipseanda, so part of the new key path is still unprotected.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/test_tui.py` around lines 1642 - 1690, The tests test_toggle_keys_work_in_table_mode and test_toggle_keys_work_in_log_viewing_mode fail to cover newly added nested-mode keys r and Ctrl+r (and test_toggle_keys_work_in_log_viewing_mode also omitted e and a); update these tests to call tui._handle_key("r") and tui._handle_key("\x12") (Ctrl+R) in both nested modes and assert the expected state changes for the same attributes already checked (e.g., _paused, use_estimation, _use_wildcard_conditioning, _accessibility_config compared to ACCESSIBLE_CONFIG/DEFAULT_CONFIG) while ensuring _job_selection_mode/_log_viewing_mode remain True so the new key paths are exercised.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@snakesee/tui/monitor.py`:
- Line 1668: WorkflowMonitorTUI._make_header currently appends the full resolved
workflow_dir via header_text.append(str(self.workflow_dir.resolve()), ...) which
can push other status fields off the single header line; modify this by
abbreviating/truncating the resolved path (e.g., elide middle components or
limit to a max character width) before appending, or move the path to its own
header row so Status/Elapsed/PAUSED remain visible—update the code that calls
header_text.append with the truncated string (derived from
self.workflow_dir.resolve()) or add a new header_text.append call on a separate
line to render the path on its own row.
---
Nitpick comments:
In `@snakesee/tui/monitor.py`:
- Around line 1250-1257: The table and log-mode key handlers duplicate the
toggle allowlist; remove the duplicated checks in
WorkflowMonitorTUI._handle_table_navigation_key and
WorkflowMonitorTUI._handle_log_viewing_key and instead delegate to the shared
handler: call self._handle_toggle_key(key) for any key that might be a toggle
(preserving the existing behavior of the "?" help branch), then return False
when the toggle handler was invoked; this ensures all toggle keys are handled
centrally by WorkflowMonitorTUI._handle_toggle_key and avoids drift when toggles
are added.
In `@tests/test_tui.py`:
- Around line 1642-1690: The tests test_toggle_keys_work_in_table_mode and
test_toggle_keys_work_in_log_viewing_mode fail to cover newly added nested-mode
keys r and Ctrl+r (and test_toggle_keys_work_in_log_viewing_mode also omitted e
and a); update these tests to call tui._handle_key("r") and
tui._handle_key("\x12") (Ctrl+R) in both nested modes and assert the expected
state changes for the same attributes already checked (e.g., _paused,
use_estimation, _use_wildcard_conditioning, _accessibility_config compared to
ACCESSIBLE_CONFIG/DEFAULT_CONFIG) while ensuring
_job_selection_mode/_log_viewing_mode remain True so the new key paths are
exercised.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 98147bad-3bfb-470f-9dd8-28984bdc3fdb
📒 Files selected for processing (2)
snakesee/tui/monitor.pytests/test_tui.py
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Simplify toggle key dispatch in table/log modes by delegating to _handle_toggle_key() directly instead of duplicating the key list - Truncate long resolved paths in header to prevent crowding status fields - Add 'r' key test coverage for log viewing mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| # Truncate long paths to avoid crowding out status fields | ||
| resolved = str(self.workflow_dir.resolve()) | ||
| max_path_len = max(20, (self.console.width or 80) - 80) | ||
| if len(resolved) > max_path_len: |
There was a problem hiding this comment.
Nit: self.workflow_dir.resolve() does filesystem I/O (resolving symlinks) and is called on every render cycle via _make_header. Consider resolving once at construction time (e.g. in __init__ or run()) and caching the result, so the per-frame cost is just a string truncation.
nh13
left a comment
There was a problem hiding this comment.
Please make sure coderabbitai comments are also addressed :)
- Cache workflow_dir.resolve() at construction time instead of calling it every render cycle in _make_header - Add missing test coverage for 'r' and Ctrl+r toggle keys in table navigation mode, and 'e', 'a', Ctrl+r in log viewing mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
/home/user/workflowinstead of.)?) subtitlep,e,w,a,r,Ctrl+r) work in table navigation and log viewing modesTest plan
snakesee watch .and verify header shows full path?and verify version in subtitleEnter(table mode)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Improvements
Tests