Skip to content

feat: touch to start (one touch home asset per playlist) - #3540

Merged
vpetersson-bot merged 2 commits into
masterfrom
feat/touch-home-asset
Dec 1, 2026
Merged

vpetersson-bot merged 2 commits into
masterfrom
feat/touch-home-asset

Conversation

@vpetersson-bot

@vpetersson-bot vpetersson-bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Issues Fixed

Follow-up to PR 3533 (interactive touch assets), internal tracker SIRI-2498. Stacked on that PR: the base is feat/interactive-touch-assets, so the diff shows only this feature. Merge 3533 first.

Description

Touch to start. Without this, a touch on an image, a video or an ordinary page is ignored, and a visitor has to wait for the kiosk page to come round. With one interactive asset marked Start here on touch, any touch jumps straight to it.

  • Model: Asset.touch_home boolean with a partial unique constraint (single_touch_home_asset), so the database allows only one. Migration 0013.
    • Writes go through set_touch_home(), which clears the previous home in the same transaction. It only accepts interactive web assets.
    • An asset that stops being interactive loses the role (API and edit form).
  • UI: a "Start here on touch" switch in the edit dialog under the touch settings, and a "Touch home" chip in the asset list.
  • API: touch_home on /api/v2/assets (additive). A 400 if the asset isn't an interactive web page. Setting it on one asset moves it from the other.
  • Controller mode: it's a property of the asset, so the mirror publishes it to managed screens like the other touch settings. The first version used a per-screen device setting, which a managed screen couldn't receive; that's now gone.
  • Webview: the closed input gate already swallows every press. It now also counts them (blockedTapCount), and the wake tap never reaches the page.
  • Viewer: the waits for non-interactive assets poll that count every 0.5 s while a home asset is in the active playlist, and on an increase jump via the existing navigate_to_asset path.
    • The jump doesn't happen when the home asset is inactive or already on screen.
    • The playlist resumes after the interrupted asset, skipping the home asset's turn if it was next.
    • With an older webview, the wait is exactly the plain skip_event.wait.

Usage statistics

On top of the touch telemetry in the base PR:

  • device_active adds touch_home_set;
  • touch_activity adds touch_home_wakes (a touch on another asset that jumped to the touch home page) and touch_ignored_taps (touches dropped because no interactive page was on screen).

Ignored taps show how often people try to touch a screen that has nothing to touch. The webview's blocked-press counter is read around each non-interactive wait. When there's no touch home page and usage statistics are opted out, it isn't read at all.

Testing

  • pytest -m "not integration": 3446 passed. tests/test_touch_home.py covers:
    • the DB constraint itself (an IntegrityError on a second home);
    • set_touch_home moving the role and checking eligibility;
    • the API (patch, create, 400s, losing the role when no longer interactive);
    • the edit form, the mirror, the viewer target and the wait/wake logic.
  • x86 rig, real SQLite:
    • migration 0013 applied and created UNIQUE INDEX single_touch_home_asset … WHERE touch_home;
    • a raw SQL update setting a second home was refused (UNIQUE constraint failed);
    • creating a kiosk with touch_home moved the role from the other kiosk;
    • a non-interactive asset was refused (400);
    • reverse migration to 0012 was clean.
  • x86 with the real touch panel: a tap during an ordinary page jumped to the home kiosk within a second, and the wake tap was not delivered to the page. When the kiosk's slot ended, the playlist returned to the ordinary page.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

🤖 Generated with Claude Code

@vpetersson-bot
vpetersson-bot requested a review from a team as a code owner November 30, 2026 21:05
@vpetersson-bot vpetersson-bot self-assigned this Nov 30, 2026
Copilot AI lite review requested due to automatic review settings November 30, 2026 21:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

Copilot AI lite review requested due to automatic review settings November 30, 2026 21:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

@vpetersson-bot vpetersson-bot changed the title feat: touch to start (touch home asset) feat: touch to start (one touch home asset per playlist) Nov 30, 2026
Copilot AI lite review requested due to automatic review settings December 1, 2026 02:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The admin form can bypass the required helper and violate the partial unique constraint, while the new Qt event-filter behavior also lacks regression coverage.

2 open issues

Review effort: Lite

Comment thread src/anthias_server/app/models.py Resolved
Comment thread src/anthias_webview/src/view.cpp Resolved
Copilot AI lite review requested due to automatic review settings December 1, 2026 03:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The cross-stack Qt input, D-Bus, viewer-wake, and managed-screen changes lack Raspberry Pi end-to-end validation, leaving real touch delivery, wake-tap swallowing, and rotated-display behavior unverified.

No open issues 🎉

2 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 1, 2026 10:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two moderate active issues remain: admin edits can leave an ineligible asset marked as the touch home, and scheduler state is not refreshed before detecting a newly selected home during a waiting slot.

2 open issues

Review effort: Lite

Comment thread src/anthias_server/app/admin.py Resolved
Comment thread src/anthias_viewer/__init__.py Resolved
Copilot AI lite review requested due to automatic review settings December 1, 2026 10:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Approval is blocked by two critical correctness issues involving concurrent role moves and webview capability handling, plus a moderate touch-event double-counting bug that causes inaccurate telemetry.

5 open issues

Review effort: Lite

Comment thread src/anthias_server/app/models.py Resolved
Comment thread src/anthias_viewer/__init__.py Resolved
Comment thread src/anthias_webview/src/view.cpp Resolved
vpetersson
vpetersson previously approved these changes Dec 1, 2026
Copilot AI lite review requested due to automatic review settings December 1, 2026 10:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A critical active finding remains because the new touch regression test uses the Qt 6-only QPointingDevice type and therefore fails to compile for the supported Qt 5 target.

1 open issue
5 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 1, 2026 10:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because critical hidden issues remain in stale touch_home persistence and the Qt 5 test build.

No open issues 🎉

1 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 1, 2026 11:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A moderate active issue remains because target selection can queue missing or unreachable assets before the normal displayability guard, interrupting playback with an unplayable page.

1 open issue

Review effort: Lite

Comment thread src/anthias_viewer/__init__.py Resolved
Copilot AI lite review requested due to automatic review settings December 1, 2026 11:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human approval is warranted because the cross-layer Qt5/Qt6, D-Bus, viewer scheduling, and mirroring changes were validated only on x86, leaving Raspberry Pi touchscreen delivery and playlist-resume behavior unverified.

1 open issue

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 1, 2026 11:25
@vpetersson-bot
vpetersson-bot force-pushed the feat/interactive-touch-assets branch from c9626a4 to 27d76c6 Compare December 1, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The cross-stack Qt input, viewer wake, capability fallback, and controller changes still require end-to-end Raspberry Pi touchscreen validation to verify event ordering and behavior across linuxfb, eglfs, and Wayland.

No open issues 🎉

1 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 1, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The change spans Qt5/Qt6 input handling, D-Bus, viewer scheduling, and SQLite migration, but lacks Raspberry Pi end-to-end validation for hardware-specific touch delivery and wake behavior.

No open issues 🎉

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 1, 2026 11:34
@vpetersson-bot
vpetersson-bot changed the base branch from feat/interactive-touch-assets to master December 1, 2026 11:34
@vpetersson-bot
vpetersson-bot dismissed vpetersson’s stale review December 1, 2026 11:34

The base branch was changed.

One interactive asset can be marked "Start here on touch": a touch on
any other asset jumps to it, with the first touch only waking the
screen. The database allows only one such asset. Adds the touch to
start telemetry counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A critical active finding remains: the queued wake target can be displayed after its asset is disabled or its schedule ends, bypassing the documented scheduling rule.

1 open issue

Review effort: Lite

Comment thread src/anthias_viewer/__init__.py Resolved
Copilot AI lite review requested due to automatic review settings December 1, 2026 11:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Approval should be deferred because the cross-stack Qt5/Qt6, D-Bus, scheduling, and touchscreen changes lack Raspberry Pi end-to-end validation on the target display stacks.

1 open issue

Review effort: Lite

Copilot AI lite review requested due to automatic review settings December 1, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because the event-waiting logic has a moderate edge-case that can lose taps during the final polling interval.

No open issues 🎉

1 resolved since last review

Review effort: Lite

The wake path checks the home asset before queuing it, but the scheduler
consumed extra_asset without checking the schedule. A home disabled or
out of schedule in between would still play. Touch jumps are now queued
with from_playlist=True: get_next_asset rebuilds the active playlist and
only plays the asset if it is still in it. Operator jumps keep their
unconditional meaning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

@vpetersson-bot
vpetersson-bot merged commit 6d90c91 into master Dec 1, 2026
10 checks passed
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.

3 participants