Skip to content

feat: QoL improvements: shortcutkeys++, version made visible, completion time to include date and TZ#60

Open
yfarjoun wants to merge 4 commits intofg-labs:mainfrom
yfarjoun:yf_qol-improvements
Open

feat: QoL improvements: shortcutkeys++, version made visible, completion time to include date and TZ#60
yfarjoun wants to merge 4 commits intofg-labs:mainfrom
yfarjoun:yf_qol-improvements

Conversation

@yfarjoun
Copy link
Copy Markdown
Contributor

@yfarjoun yfarjoun commented Apr 4, 2026

Summary

  • Show resolved absolute path in header (e.g., /home/user/workflow instead of .)
  • Show snakesee version in help panel (?) subtitle
  • Show date in ETA completion time when it crosses midnight, and always include timezone
  • Make toggle keys (p, e, w, a, r, Ctrl+r) work in table navigation and log viewing modes

Test plan

  • All 1084 tests pass
  • ruff format/lint clean
  • mypy clean
  • Manual: run snakesee watch . and verify header shows full path
  • Manual: press ? and verify version in subtitle
  • Manual: verify toggle keys work after pressing Enter (table mode)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Toggle and refresh keys (including Ctrl+R) now work consistently inside nested table-navigation and log-viewing modes
  • Improvements

    • Help overlay subtitle displays the installed snakesee version
    • ETA uses timezone-aware calculations with clearer date/time formatting and timezone label
    • Workflow header shows resolved absolute path and truncates to fit the terminal
  • Tests

    • Added tests verifying toggle/refresh key behavior in selection and log-viewing modes

- 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>
@yfarjoun yfarjoun requested a review from nh13 as a code owner April 4, 2026 22:27
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 96a60e70-7eef-4f76-96b0-1f9f61b16dc4

📥 Commits

Reviewing files that changed from the base of the PR and between 4ba5147 and dd7f7a9.

📒 Files selected for processing (2)
  • snakesee/tui/monitor.py
  • tests/test_tui.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • snakesee/tui/monitor.py

📝 Walkthrough

Walkthrough

Delegate toggle/refresh keys to a shared handler in nested table-navigation and log-viewing modes; show installed snakesee version in help subtitle; display resolved workflow path with width-based truncation; compute ETA with timezone-aware datetime, conditional same-day vs cross-day formatting, and append timezone abbreviation.

Changes

Cohort / File(s) Summary
TUI monitor
snakesee/tui/monitor.py
Route toggle/refresh keys (?, p, e, w, a, r, Ctrl+r) through _handle_toggle_key() before mode-specific handling in table/log modes; include snakesee.__version__ in help subtitle; use workflow_dir.resolve() and truncate long paths in header; compute ETA with datetime.now().astimezone() + timedelta(...), format time vs date+time based on day boundary, and append timezone abbrev (or local).
Tests
tests/test_tui.py
Add tests verifying toggle and refresh keys operate while in job-selection/table-navigation and in log-viewing modes: assert "p", "e", "w", "a" toggle respective flags and preserve mode state; assert "r" and "\x12" set _force_refresh=True without exiting modes.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰
Keys that hopped and hid in nested rows, now found,
Help hums my version softly from the ground,
Clocks and zones align to show the day,
Paths tuck their tails to fit the way,
I nibble bytes and bound with joy unbound.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: quality-of-life improvements including enhanced shortcuts, visible version, and improved completion time display with timezone.
Description check ✅ Passed The description covers all key changes, provides a clear test plan with completed checkmarks, and includes summary notes. Though not matching the template structure exactly, it contains sufficient detail for review.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 False

Apply the same change in both WorkflowMonitorTUI._handle_table_navigation_key() and WorkflowMonitorTUI._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 r and Ctrl+r in nested modes, but neither test asserts them. test_toggle_keys_work_in_log_viewing_mode() also skips e and a, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 453d660 and 28a698f.

📒 Files selected for processing (2)
  • snakesee/tui/monitor.py
  • tests/test_tui.py

yfarjoun and others added 2 commits April 4, 2026 18:36
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>
@yfarjoun yfarjoun changed the title feat: TUI quality-of-life improvements feat: QoL improvements: shortcutkeys++, version made visible, completion time to include date and TZ Apr 5, 2026
# 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:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

@nh13 nh13 left a comment

Choose a reason for hiding this comment

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

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>
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