Conversation
Introduce a ManualHistoryWidget for viewing manual script runs and logs (new src/manual_history_ui.py) and integrate it into the detail panel in src/gui.py. - Add a tab switcher (_switch_detail_tab) and stacked widget to show Details vs History, adjust detail panel margins, and wire ManualHistoryWidget into the main UI - Update manual run execution flow in _run_script_row to create and append a history entry, initialize a log file, run scripts using the captured runner, spawn a background poller thread to follow the log, and store the history id on the run row; also update history entry status on exceptions. In src/scheduler_ui.py, filter history loads to separate scheduled runs (keep only runs with schedule_id)
Set top-left alignment for script, time, and status labels in the manual history widget to improve vertical alignment in the grid. Also remove the special-case that set a "Terminated manually" sub-text for runs with status "killed", letting the existing error/subtext logic handle that case consistently.
| import os | ||
| from datetime import datetime | ||
|
|
||
| from PySide6.QtCore import Qt, QStringListModel |
Check notice
Code scanning / CodeQL
Unused import Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix an unused import, the safest and simplest approach is to remove just the unused symbol from the import statement, leaving the used ones intact. This avoids changing any existing behavior while cleaning up the dependency and the code readability.
In this case, we should modify src/manual_history_ui.py at the top of the file where PySide6.QtCore is imported. Specifically, we will edit line 4 from from PySide6.QtCore import Qt, QStringListModel to import only Qt. No additional methods, definitions, or other imports are needed. The rest of the file remains unchanged.
| @@ -1,7 +1,7 @@ | ||
| import os | ||
| from datetime import datetime | ||
|
|
||
| from PySide6.QtCore import Qt, QStringListModel | ||
| from PySide6.QtCore import Qt | ||
| from PySide6.QtGui import QFont | ||
| from PySide6.QtWidgets import ( | ||
| QComboBox, |
| from PySide6.QtWidgets import ( | ||
| QComboBox, | ||
| QCompleter, | ||
| QFrame, | ||
| QGridLayout, | ||
| QHBoxLayout, | ||
| QLabel, | ||
| QLineEdit, | ||
| QPlainTextEdit, | ||
| QPushButton, | ||
| QScrollArea, | ||
| QSizePolicy, | ||
| QSplitter, | ||
| QVBoxLayout, | ||
| QWidget, | ||
| ) |
Check notice
Code scanning / CodeQL
Unused import Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix this, we should remove the unused names (QCompleter, QLineEdit, QSizePolicy) from the from PySide6.QtWidgets import (...) line while keeping all the other, used widgets intact. This preserves existing behavior and only cleans up the unused imports.
Concretely, in src/manual_history_ui.py, edit the PySide6.QtWidgets import block at the top of the file: delete QCompleter,, QLineEdit,, and QSizePolicy, from the parenthesized import list, leaving the rest unchanged. No other code changes, methods, or definitions are needed.
| @@ -5,16 +5,13 @@ | ||
| from PySide6.QtGui import QFont | ||
| from PySide6.QtWidgets import ( | ||
| QComboBox, | ||
| QCompleter, | ||
| QFrame, | ||
| QGridLayout, | ||
| QHBoxLayout, | ||
| QLabel, | ||
| QLineEdit, | ||
| QPlainTextEdit, | ||
| QPushButton, | ||
| QScrollArea, | ||
| QSizePolicy, | ||
| QSplitter, | ||
| QVBoxLayout, | ||
| QWidget, |
Summary
Extends the script automation functionality to include active tracking and logging of manually executed scripts. To avoid cluttering the automated Scheduler tab, manual run logs have been completely decoupled and assigned their own global, dedicated "History" view conveniently toggled within the Home page's script detail panel.
Changes
run_script_in_gitbash_captured, automatically logging theirteeredirected stderrs/stdouts incrementally.manual_history_ui.py): Added a new, self-containedManualHistoryWidgetdesigned exclusively for browsing manually run scripts with built-in statuses, timestamps, log viewers, and script filters.Details / Historysub-navigation tab to the top of the Home page's right-hand panel, letting users seamlessly swap between script inspection and the global manual history views.schedule_id, guaranteeing its log lists remain purely automated events.Notes