# TrashQueue 1.1

A browser-local event queue from TrashApps. No accounts, build step, backend, third-party scripts, remote fonts or network services.

## Run / deploy

Open `TrashQueue.html` for the self-contained offline edition, or open `index.html` with its neighbouring assets. Both editions have the same functionality. `node build-single.cjs` recreates the single-file edition after source changes.

For hosting at **trashqueue.omays.co.uk**, upload `index.html`, `app.js`, `core.js`, `style.css` and `raccoon.svg` together into the domain's public directory. Also upload this README if you want the operating-notes link to work. Alternatively upload `TrashQueue.html` as `index.html`; this embeds all scripts, styles and artwork. Use HTTPS. There is no server-side configuration or dependency installation.

An optional local server is included: with Node installed, run `node serve.cjs` in this folder, then visit `http://127.0.0.1:4173`. The server is only for local preview and binds to this computer.

## Run a show

1. Enter a Name and optional Detail. Enter in either field adds the entry and returns focus to Name.
2. Leave Insert at position blank to append. Enter a number to insert into the full controller list; it advances automatically for successive additions.
3. The first waiting entry is Up Next. On Deck shows the following waiting entries (the count excludes Up Next). The ticker contains every waiting entry, once per sequence, with a prefix and a separate trailing gap before each repeat.
4. Next completes the first waiting entry. Tick/Untick toggles completion. Hold/Release and Skip/Restore temporarily exclude entries from the audience queue while preserving their position. Arrow buttons reorder the full list. Edit or double-click a name/detail; Enter saves, Escape cancels.
5. Open audience display, allow the popup, move it to your second screen, then select Fullscreen. Escape exits fullscreen. The audience display is read-only. Open it from the controller for the strongest offline sync compatibility.
6. Speed (pixels/second), banner size/height, gap, Up Next size, prefixes, fonts and colours update immediately. Pause freezes only the ticker. The preview uses a smaller proportional view; the popup is the full-size composition. Banner height has a minimum sufficient for the text; a large font may exceed the selected height.
7. Under Layout & visibility, choose ticker Top (before the title), Middle (between Up Next and On Deck), or Bottom. The title, Up Next, On Deck, ticker and entry details have independent switches. Hiding a component never deletes queue entries. These choices save and sync like other display settings.
8. Presets & backups offers three JSON files: **Whole event** saves queue, statuses, setup and history to resume later; **Queue list** saves names/details/order/statuses and loads without changing your setup; **Display setup** saves layout, visibility, event text, fonts, sizes and colours and loads without changing your list. Import replaces the chosen scope. Wrong file types are rejected. For a fresh run of an old list, choose Reset all statuses after loading.
9. **Export event log** downloads a spreadsheet-friendly CSV of entry changes and a current snapshot. Undo restores the previous queue/setup after import, clear, reset, presets and other queue actions (40 snapshots, current controller session only). Continuous slider/text adjustments are not individual Undo steps. Undo appends history rather than erasing the record of what happened.

## Event history

Logging starts in this version. It records entry additions, edits, status changes, reorder positions, removals, clears, resets, list imports and Undo with UTC timestamps. Removed entries remain in history. Importing an entire event restores that event's saved history; importing only a queue retains the current event's history. The CSV includes names/details/statuses/positions for each recorded change and a final snapshot of the current list. Entries displaced by a reorder or insertion may each have a position-change record.

Older v1.0 backups load through Load event and start with an import snapshot; past actions that were never recorded cannot be reconstructed. The pre-TrashQueue generator's unknown format remains unsupported. Settings-only adjustments are saved in setup/event files, not audited as entry actions. CSV is for viewing/archiving, not re-import; use JSON to restore an event. Formula-like text is prefixed with an apostrophe in CSV for safe spreadsheet viewing. JSON retains the original text.

## Saving and displays

Changes save to `localStorage` automatically. BroadcastChannel, storage events and direct popup messages provide same-browser cross-window sync. A heartbeat recovers late-opened/reloaded displays and shows a disconnected notice if the controller stops responding. Displays retain their last received queue if disconnected. Keep the controller open and foreground it periodically if your browser throttles background windows.

Use one controller as the operator. Other controller tabs accept newer updates and clear their old Undo history. Simultaneous edits use the latest revision; this is not multi-user collaboration. Sync is limited to the same browser profile and origin, not other devices or computers. A changed domain, protocol or port has separate storage. Export/import to move your queue. Direct-file storage behaviour varies by browser; direct popup messages also support offline use where browser storage or BroadcastChannel is unavailable.

Private browsing, site-data clearing and storage restrictions can remove or prevent persistence. If saving fails, an on-page message asks you to export a backup. Back up before a show and before moving the app. Queues are limited to 5,000 entries; imports to 20 MB. Event history grows as you operate the queue; if browser storage fills, export the whole event before closing the page. History is never silently trimmed. Version 1.0 TrashQueue browser data and full-event JSON files remain compatible.

The Crew, Daylight and Big stage presets affect display appearance and preserve event text and queue. All fonts are local system choices; a fallback is used if a font is not installed. Queue text is rendered literally, never as HTML.

## Validation

`node --test tests/core.test.cjs` runs dependency-free queue and backup tests. `tests/browser.cjs` runs browser regression tests with Playwright available on `NODE_PATH`; optionally set `CHROME_PATH` to your installed Chrome executable and `BASE_URL` to a running HTTP preview. With no BASE_URL it tests opening the app directly from disk. Test screenshots are generated beside the app.

See `TEST-RESULTS.md` for the delivered version's validation and limitations.
