Skip to content

feat: manual run history (#3)#14

Merged
leobrqz merged 2 commits intomainfrom
feat/manual-run-history
Mar 27, 2026
Merged

feat: manual run history (#3)#14
leobrqz merged 2 commits intomainfrom
feat/manual-run-history

Conversation

@leobrqz
Copy link
Copy Markdown
Owner

@leobrqz leobrqz commented Mar 27, 2026

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

  • Manual Logging: Manually triggered scripts now leverage run_script_in_gitbash_captured, automatically logging their tee redirected stderrs/stdouts incrementally.
  • Dedicated History UI (manual_history_ui.py): Added a new, self-contained ManualHistoryWidget designed exclusively for browsing manually run scripts with built-in statuses, timestamps, log viewers, and script filters.
  • Home Panel Sub-navigation: Added a clean Details / History sub-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.
  • Decoupled Main Scheduler: The primary Scheduler tab history now silently ignores entries that lack an active schedule_id, guaranteeing its log lists remain purely automated events.

Notes

leobrqz added 2 commits March 26, 2026 21:20
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.
@leobrqz leobrqz self-assigned this Mar 27, 2026
@leobrqz leobrqz linked an issue Mar 27, 2026 that may be closed by this pull request
Comment thread src/manual_history_ui.py
import os
from datetime import datetime

from PySide6.QtCore import Qt, QStringListModel

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'QStringListModel' is not used.

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.

Suggested changeset 1
src/manual_history_ui.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/manual_history_ui.py b/src/manual_history_ui.py
--- a/src/manual_history_ui.py
+++ b/src/manual_history_ui.py
@@ -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,
EOF
@@ -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,
Copilot is powered by AI and may make mistakes. Always verify output.
Comment thread src/manual_history_ui.py
Comment on lines +6 to +21
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

Import of 'QCompleter' is not used.
Import of 'QLineEdit' is not used.
Import of 'QSizePolicy' is not used.

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.

Suggested changeset 1
src/manual_history_ui.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/manual_history_ui.py b/src/manual_history_ui.py
--- a/src/manual_history_ui.py
+++ b/src/manual_history_ui.py
@@ -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,
EOF
@@ -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,
Copilot is powered by AI and may make mistakes. Always verify output.
@leobrqz leobrqz merged commit 99615e5 into main Mar 27, 2026
4 checks passed
@leobrqz leobrqz deleted the feat/manual-run-history branch March 27, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: Manual run history

2 participants