3 Commits

Author SHA1 Message Date
31f0b430fb Wait for startup update restoration in the Windows regression 2026-11-26 20:47:35 -06:00
44fef12e75 Release hover version and window placement fixes 2026-11-26 20:46:00 -06:00
d40be62478 Persist expanded window geometry
Show the installed version in the compact monitor and keep the expanded window within the available screen area. Save and restore expanded-window geometry across launches, with recovery for oversized or off-screen placements.
2026-11-26 20:39:20 -06:00
9 changed files with 242 additions and 6 deletions

View File

@@ -1,5 +1,10 @@
# Changelog
## v0.6.2.3_beta — 2026-11-26
- Show the installed version at the upper right of the hover monitor above its controls.
- Restore the last size and position of the main monitor and its reusable dialogs. Keep restored windows within the current work area where their content fits.
## v0.6.2.2_beta — 2026-11-26
- Promote Adaptive Resource Monitor to Beta after verifying the production self-update, restoration of local and remote monitoring, and signed same-number Beta discovery.

View File

@@ -1,5 +1,100 @@
# Adaptive Resource Monitor implementation report
## v0.6.2.3_beta — Hover monitor version and window placement
Production v0.6.2.2_beta was built from `5e8ea74be3fd94156bdc7a0810cfcc8eaac739f0`.
The earlier hover label and expanded-window geometry corrections were
committed afterward in `d40be62478eb45f572a1555ce22491e4a2cc5eb8`. The
published Beta and its installed executable therefore lacked both changes.
This Bug-Fix increments only the last numerical counter. The hover monitor
reads VERSION.md through the shared version module and renders it above the
selectors and Pin and Details controls. A shared geometry handler preserves
the existing main-window state file and remembers Settings, Remote Targets,
Remote Machine and Application Details placement. The About layout remains
the same as the previous release.
The 34 regressions passed. Native Windows checks exercised individual and
All Systems, pinned and unpinned, and a popup anchored to a separate machine
icon. Both themes were checked at effective 100% and 150% scaling using
Qt's per-process scale factor on private Windows desktops. A native geometry
check confirmed exact positioning on reopening and recovery of an off-screen
About window on the current display.
## v0.6.2.2_beta — Beta promotion
Alpha production acceptance and the signed same-number compatibility
check passed before the Beta build. The promotion kept the four numerical
counters at `0.6.2.2`. All 34 regression tests and the isolated native
Windows verification passed. Build and Archive #10 used commit
`5e8ea74be3fd94156bdc7a0810cfcc8eaac739f0`. Publish Release #10 published
its artifacts as a separate Gitea prerelease. The earlier Alpha releases
remain public.
[Build #10](https://phantom.zapto.org:8080/jenkins/job/Adaptive-Resource-Monitor/job/Build-and-Archive/10/)
[Publication #10](https://phantom.zapto.org:8080/jenkins/job/Adaptive-Resource-Monitor/job/Publish-Release/10/)
[Public Beta](https://phantom.zapto.org/gitea/sonja/Adaptive_Resource_Monitor/releases/tag/v0.6.2.2_beta)
All seven Beta attachments matched anonymously by size and SHA-256. The
Ed25519 signature, version, x64 PE metadata, portable package and build
receipt verified. The installed corrective Alpha client verified this
public Beta as eligible.
| Windows x64 package | Bytes | SHA-256 |
| --- | ---: | --- |
| Installer | 60,165,231 | `305cd316547245eaf0d77703f1b4be93404f7762fa4839b4b4a693c13d3bd78f` |
| Portable ZIP | 74,682,861 | `e1ee75e4218594feb7c1735cf1853739f18e5560df37666e25b186216077657a` |
### Production Beta acceptance
The installed corrective Alpha displayed the signed Beta as available, then
ready to install after the package download. ARM recorded one availability
notification for the Beta. Install Later kept the same verified bytes and
timestamp. Installation began through the installed application's controls.
Transaction `04ef6d0d8a3745bd8629d8945a6f2349` recorded the old process
acknowledging shutdown and exiting at 8:34:40.683 PM CST with exit code 0.
The installer log was created at 8:34:41.896 PM. The independent progress
window was visible during installation. The same Windows user, session and
non-elevated privilege level were retained. The automatic restart reported
v0.6.2.2_beta, persisted its completion receipt and displayed the success
confirmation. Windows registration and About reported Beta. The 298
installed payload files matched build #10. The restarted process remained
the sole ARM instance and the maintenance launcher exited.
The production settings and SSH host key files matched their pre-update
hashes. All credential references remained accessible, and startup,
Windows notification and automatic update-check preferences were preserved.
Persistent recording was off before both updates. All Systems displayed
four independent histories with fresh Local Machine, Rain, Phantom and
LAMP samples and distinct network IN and OUT readings. All four sample
timestamps advanced during a 20-second observation. Explorer returned a
live tray icon with six distinct rendered frames. The installed About
check verified Beta as current. The acceptance checks covered 169 seconds
after the automatic Beta restart.
Both production self-updates passed. Adaptive Resource Monitor is publicly
released and running in production as v0.6.2.2_beta. The production
screenshots, shutdown acknowledgement, installer log and completion
receipts are retained locally under `evidence/v0.6.2.2_alpha-production`
and `evidence/v0.6.2.2_beta-production`.
### Separate window changes and cleanup
The local hover monitor shows the installed version on the status row below
the controls. The expanded window keeps the existing About layout, fits
inside the monitor's work area, and restores its saved size and position.
Private native Windows checks verified the hover label at 300 and 500 pixels
and verified exact geometry restoration, oversized window handling, and
off-screen placement recovery. These are separate source changes after
the pinned Beta commit.
Anonymous Beta readback removed 134,850,358 bytes of duplicate downloads.
The two isolated window checks removed 6,220 bytes of temporary data.
A final isolated GUI regression passed and removed 55,800 bytes of test
data. A 719-byte incomplete capture was discarded. Jenkins cleared its build
and publication workspaces. The verified local release archives, selected
production screenshots and actual updater logs were retained.
## v0.6.2.2_alpha — Update channel correction
Windows Program Compatibility Assistant recorded the archived

View File

@@ -1 +1 @@
v0.6.2.2_beta
v0.6.2.3_beta

View File

@@ -21,6 +21,7 @@ from .branding import (
)
from .version import NAME, VERSION
from .update_ui import UpdatePanel
from .window_geometry import WindowGeometry
LOG = logging.getLogger(__name__)
DOCS = {
@@ -232,4 +233,5 @@ class AboutPage(QWidget):
buttons.rejected.connect(dialog.reject)
layout.addWidget(buttons)
dialog.resize(620, dialog.sizeHint().height())
dialog.window_geometry = WindowGeometry(dialog, self.data_root / "application-details-window.bin")
dialog.exec()

View File

@@ -29,6 +29,7 @@ from .tray import HoverMonitor
from .tray_menu import TrayMenu
from .version import NAME, VERSION
from .views import METRIC_NAMES, Monitor
from .window_geometry import WindowGeometry, fit_work_area
LOG = logging.getLogger(__name__)
RUN_KEY = r"Software\Microsoft\Windows\CurrentVersion\Run"
@@ -91,6 +92,7 @@ class Application(QObject):
self.expanded = Monitor(self.dashboard, True, self.request_archive, self.open_expanded,
self.set_pin, self.about_page)
self.expanded.setWindowIcon(self.brand_icon)
self.window_geometry = WindowGeometry(self.expanded, self.root / "monitor-window.bin")
self.popup = Monitor(self.dashboard, False, self.request_archive, self.open_expanded, self.set_pin)
for view in (self.popup, self.expanded):
view.add_update_banner(self.open_update)
@@ -121,6 +123,8 @@ class Application(QObject):
self.brand_colors = DARK if scheme == Qt.ColorScheme.Dark else LIGHT
self.about_page.theme(self.brand_colors)
self.expanded.brand_tabs(self.brand_colors)
self.popup.header.setStyleSheet(f"color: {self.brand_colors.text}")
self.popup.version_label.setStyleSheet(f"color: {self.brand_colors.muted}")
for view in (self.popup, self.expanded):
view.update_banner.theme(self.brand_colors)
for menu in self.menus.values():
@@ -608,12 +612,13 @@ def main():
state = presentation(transaction) if transaction else {}
if state.get("expanded", not controller.settings.minimized):
controller.open_expanded()
if geometry := state.get("geometry"):
if not controller.window_geometry.saved and (geometry := state.get("geometry")):
rect = QRect(*geometry)
if any(screen.availableGeometry().intersects(rect) for screen in app.screens()):
controller.expanded.setGeometry(rect)
if state.get("about"):
controller.expanded.tabs.setCurrentWidget(controller.about_page)
fit_work_area(controller.expanded)
if transaction:
controller.about_page.updates.follow_restart(transaction)
signal_ready(root)

View File

@@ -13,6 +13,7 @@ from PySide6.QtWidgets import (
from .config import TRAY_MODES
from .model import DISK_MODES, LOCAL, NETWORK, RANGES, RESOURCES, Connection
from .views import fill, interval_choices, machine_choices, plain
from .window_geometry import WindowGeometry
def checkbox(value):
@@ -122,6 +123,7 @@ class SettingsDialog(QDialog):
self.timer.timeout.connect(self.update_diagnostics)
self.timer.start()
self.update_diagnostics()
self.window_geometry = WindowGeometry(self, app.root / "settings-window.bin")
def section(self, title):
page = QWidget()
@@ -331,6 +333,7 @@ class TargetDialog(QDialog):
self.os.currentIndexChanged.connect(update)
self.auth.currentIndexChanged.connect(update)
update()
self.window_geometry = WindowGeometry(self, app.root / "remote-machine-window.bin")
def save(self):
host, name, user = (field.text().strip() for field in (self.host, self.name, self.username))
@@ -398,6 +401,7 @@ class ConnectionsDialog(QDialog):
app.collectors.changed.connect(self.sync)
app.collectors.test_finished.connect(self.test_finished)
self.sync()
self.window_geometry = WindowGeometry(self, app.root / "remote-targets-window.bin")
def selected(self):
row = self.table.currentRow()

View File

@@ -9,6 +9,8 @@ from PySide6.QtWidgets import (
from .graphs import Plot, resource_series, selected_resource
from .model import ALL, LOCAL, NETWORK, TOTAL, Connection, INTERVALS, RANGES, RESOURCES, format_value
from .version import VERSION
from .window_geometry import fit_work_area
METRIC_NAMES = {
"cpu.util": "CPU utilization", "cpu.frequency": "Frequency", "cpu.temperature": "CPU temperature",
@@ -233,6 +235,14 @@ class Monitor(QWidget):
layout = QVBoxLayout(self.resource_page if expanded else self)
layout.setContentsMargins(8, 7, 8, 7)
layout.setSpacing(4)
if not expanded:
version = QLabel(VERSION, textFormat=Qt.TextFormat.PlainText)
version.setAccessibleName(f"Installed version {VERSION}")
font = version.font()
font.setPointSize(8)
version.setFont(font)
layout.addWidget(version, alignment=Qt.AlignmentFlag.AlignRight)
self.version_label = version
layout.addLayout(top)
layout.addWidget(self.header)
self.single = QWidget()
@@ -274,7 +284,10 @@ class Monitor(QWidget):
def show_page(self, about=False):
self.tabs.setCurrentWidget(self.about_page if about else self.resource_page)
self.ensurePolished()
self.layout().activate()
self.show()
fit_work_area(self)
self.raise_()
self.activateWindow()
@@ -305,18 +318,19 @@ class Monitor(QWidget):
def popup_size(self):
cfg = self.dashboard.settings
banner = self.update_banner.sizeHint().height() + self.layout().spacing() if (
extra = self.version_label.sizeHint().height() + self.layout().spacing()
extra += self.update_banner.sizeHint().height() + self.layout().spacing() if (
hasattr(self, "update_banner") and not self.update_banner.isHidden()) else 0
if self.selected_machine != ALL:
return QSize(cfg.popup_width, cfg.popup_height + banner)
return QSize(cfg.popup_width, cfg.popup_height + extra)
# Cap in HoverMonitor against the work area. The scroll area keeps
# six columns together even on a narrow monitor.
rows_height = sum(max(138, section.sizeHint().height()) for section in self.sections.values())
return QSize(max(cfg.popup_width, 875), max(cfg.popup_height, rows_height + 72) + banner)
return QSize(max(cfg.popup_width, 875), max(cfg.popup_height, rows_height + 72) + extra)
def add_update_banner(self, open_update):
self.update_banner = UpdateBanner(open_update)
self.layout().insertWidget(0 if self.expanded else 2, self.update_banner)
self.layout().insertWidget(0 if self.expanded else self.layout().indexOf(self.header) + 1, self.update_banner)
def sync_devices(self):
if not self.expanded:

69
arm/window_geometry.py Normal file
View File

@@ -0,0 +1,69 @@
"""Keep user-facing windows within the work area and remember their placement."""
import logging
from PySide6.QtCore import QByteArray, QEvent, QObject, QTimer
from PySide6.QtGui import QGuiApplication
from .update_client import write_atomic
LOG = logging.getLogger(__name__)
def fit_work_area(window):
if window.isMinimized() or window.isMaximized() or window.isFullScreen():
return
frame = window.frameGeometry()
screen = QGuiApplication.screenAt(frame.center()) or window.screen()
if screen is None:
return
area = screen.availableGeometry()
if frame.width() > area.width() or frame.height() > area.height():
window.resize(window.width() - max(0, frame.width() - area.width()),
window.height() - max(0, frame.height() - area.height()))
frame = window.frameGeometry()
x = max(area.left(), min(frame.left(), area.right() - frame.width() + 1))
y = max(area.top(), min(frame.top(), area.bottom() - frame.height() + 1))
if (x, y) != (frame.left(), frame.top()):
window.move(x, y)
class WindowGeometry(QObject):
def __init__(self, window, path):
super().__init__(window)
self.window, self.path = window, path
self.saved = None
try:
geometry = path.read_bytes()
if window.restoreGeometry(QByteArray(geometry)):
self.saved = geometry
except FileNotFoundError:
pass
except OSError as exc:
LOG.warning("Could not read %s: %s", path.name, exc)
self.timer = QTimer(self, singleShot=True, interval=350)
self.timer.timeout.connect(self.save)
window.installEventFilter(self)
def eventFilter(self, watched, event):
if event.type() == QEvent.Type.Show:
fit_work_area(watched)
if event.type() == QEvent.Type.Hide:
self.timer.stop()
self.save()
elif watched.isVisible() and event.type() in (QEvent.Type.Show, QEvent.Type.Move, QEvent.Type.Resize,
QEvent.Type.WindowStateChange):
self.timer.start()
return super().eventFilter(watched, event)
def save(self):
if self.window.isMinimized():
return
if self.window.isVisible():
fit_work_area(self.window)
geometry = bytes(self.window.saveGeometry())
if geometry != self.saved:
try:
write_atomic(self.path, geometry)
self.saved = geometry
except OSError as exc:
LOG.warning("Could not save %s: %s", self.path.name, exc)

View File

@@ -511,6 +511,46 @@ def verify_update_notices(session, wait_for, results, captures):
results["verified_shared_update_notices"] = "Verified, ready, rejected, deferred and duplicate notification states"
def verify_hover_version(session, remote, results, captures):
from arm.model import ALL, LOCAL
from arm.version import VERSION
original = session.settings
hover = session.popup
scale = round(hover.devicePixelRatioF() * 100)
modes = (
("individual-unpinned", LOCAL, LOCAL, False),
("individual-pinned", remote, remote, True),
("all-systems-unpinned", ALL, LOCAL, False),
("all-systems-pinned", ALL, remote, True),
)
try:
for theme in ("Light", "Dark"):
session.apply(replace(original, theme=theme))
for name, selection, anchor, pinned in modes:
session.hover.pin(False)
session.select_machine(selection, anchor)
session.hover.pin(pinned, anchor)
session.qt.processEvents()
label = hover.version_label
rect = label.geometry()
assert hover.isVisible() and hover.pinned == pinned
assert hover.selected_machine == selection and session.hover.anchor == anchor
assert label.isVisible() and label.text() == VERSION
assert rect.bottom() < hover.machine.geometry().top()
assert rect.right() == hover.width() - hover.layout().contentsMargins().right() - 1
assert label.fontMetrics().horizontalAdvance(VERSION) <= rect.width()
assert hover.rect().contains(rect)
if captures and theme == ("Light" if scale > 100 else "Dark"):
capture_native_window(int(hover.winId()), captures / f"hover-{name}-{scale}.png")
finally:
session.hover.pin(False)
hover.hide()
session.apply(original)
results["hover_version"] = {"version": VERSION, "scale_percent": scale,
"themes": ["Light", "Dark"], "views": [row[0] for row in modes]}
def evaluate_app(work, results, short=False, captures=None):
import psutil
from PySide6.QtCore import QEventLoop, QTimer
@@ -605,6 +645,7 @@ def evaluate_app(work, results, short=False, captures=None):
assert release_check.wait(10)
return Check(None, None, ())
wait_for(lambda: update.job is None)
with patch.object(update.client, "check", side_effect=slow_check):
try:
sample = session.collectors.last[LOCAL]
@@ -730,6 +771,7 @@ def evaluate_app(work, results, short=False, captures=None):
session.popup.hide()
session.apply(replace(session.settings, separate_tray_icons=True, persistent=True))
assert set(session.icons) == {LOCAL, *(target.identifier for target in targets)}
verify_hover_version(session, primary, results, captures)
with patch("arm.application.tray_icon", wraps=tray_icon) as draw:
session.render()
assert {call.args[1] for call in draw.call_args_list} == {LOCAL, primary, other}