You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- When `restore_tool_state` is enabled (default), the last-used tool settings (including arrow head placement) override config defaults on startup. Disable it in the Session tab or clear the session to force config values.
808
-
-`--session-file` uses exactly the selected file, implies persistence for that overlay run, and does not create missing parent directories. A running daemon can launch a hidden overlay with a named target; if the overlay is already visible, hide it before switching to a different named session.
809
-
- The configurator Session tab can manage recent named sessions: rename catalog labels, reveal files, and forget metadata. When no overlay/background service is active, it can duplicate a session by copying its primary file, move inactive session files, and clear saved data.
813
+
-`--session-file` uses exactly the selected file, implies persistence for that overlay run, rejects directories/symlinks/special files, and does not create missing parent directories. A running daemon can launch a hidden overlay with a named target; if the overlay is already visible, hide it before switching to a different named session.
814
+
- The overlay Session panel lives in the side toolbar's Settings drawer. It can open an existing named session, save the current overlay as another named session, show session info, clear the active session, reopen recent named sessions, and jump to the configurator. The Open/Save As dialogs use `zenity` or `kdialog`; Save As appends `.wayscriber-session` when no extension is supplied and asks before replacing existing session artifacts.
815
+
- The configurator Session tab manages recent named sessions recorded when named-session targets are opened or saved from the CLI, daemon, or overlay. It can rename catalog labels, reveal files, and forget metadata without touching files. Duplicate, Move, and Clear are disabled while an overlay, manually started daemon, or background service is active.
816
+
- See [Session manager examples](examples/session-manager.md) for complete CLI, overlay, and configurator workflows.
810
817
811
818
### Tablet/Stylus Support
812
819
@@ -922,7 +929,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, project structure,
Copy file name to clipboardExpand all lines: configurator/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ The window loads the current config, lets you tweak values across the tabbed sec
32
32
-**Drawing, Arrow, Performance, UI, Board, Capture** – numeric fields with inline validation, toggles, and color editors (RGBA/RGB components).
33
33
-**Default color** – toggle between named colors and custom RGB triples.
34
34
-**Keybindings** – per-action comma-separated shortcut lists that map to `KeybindingsConfig`.
35
-
-**Session** – persistence settings plus named-session catalog management: rename display labels, reveal files, forget metadata, and clear saved data when no overlay/background service is active.
35
+
-**Session** – persistence settings plus named-session catalog management. Rename display labels, reveal files, and forget metadata without touching files. Duplicate, Move, and Clear are disabled while an overlay, manually started daemon, or background service is active.
36
36
- Live dirty-state indicator plus status banner for success/error details.
Copy file name to clipboardExpand all lines: docs/CONFIG.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -892,17 +892,29 @@ Use the CLI helpers for quick maintenance:
892
892
-`wayscriber --daemon --session-file ~/Documents/lecture-04.wayscriber-session` starts a daemon whose overlay activations use that named session target.
893
893
-`wayscriber --daemon-toggle --session-file ~/Documents/meeting.wayscriber-session` asks the running daemon to launch a hidden overlay with that named session target. If the overlay is already visible with a different target, hide it before switching.
894
894
-`wayscriber --session-info --session-file <path>` and `wayscriber --clear-session --session-file <path>` inspect or remove only that named file and its sidecars.
895
-
- The configurator Session tab also shows recent named sessions from the catalog. It can rename catalog display labels, reveal file locations, and forget catalog metadata without touching files. When no overlay/background service is active, it can duplicate a session by copying its primary file to a new target, move inactive session files and their non-lock sidecars to a new path, and clear saved data.
895
+
896
+
The overlay Session panel lives in the side toolbar's Settings drawer:
897
+
898
+
-`Open` loads an existing named session, saves dirty current data first when needed, and records the target in the recent catalog.
899
+
-`Save As` writes the current overlay to another named session and switches the active target. It appends `.wayscriber-session` when no extension is supplied and asks before replacing existing session artifacts.
900
+
-`Info` reports the active session file size, board shape counts, and history status.
901
+
-`Clear` writes a durable empty session boundary for the active target.
902
+
- Recent session rows reopen other named sessions. If a recent target is missing, Wayscriber removes that stale catalog entry after the failed open.
903
+
-`Manager` opens the configurator. Overlay Open/Save As dialogs use `zenity` or `kdialog`.
904
+
905
+
The configurator Session tab also shows recent named sessions from the catalog, recorded when named-session targets are opened or saved from the CLI, daemon, or overlay. It can rename catalog display labels, reveal file locations, and forget catalog metadata without touching files. Duplicate, Move, and Clear are disabled while an overlay, manually started daemon, or background service is active.
896
906
897
907
Session overrides and recovery:
898
908
899
909
- CLI flags: `--resume-session` forces persistence on, `--no-resume-session` forces it off for the current run. The environment variable `WAYSCRIBER_RESUME_SESSION=1/0` does the same.
900
-
-`--session-file` implies session persistence for that overlay run and conflicts with `--no-resume-session`. Named sessions use the exact selected file path; Wayscriber does not create missing parent directories or fall back to configured storage.
910
+
-`--session-file` implies session persistence for that overlay run and conflicts with `--no-resume-session`. Named sessions use the exact selected file path; Wayscriber does not create missing parent directories or fall back to configured storage. Foreground/open targets reject directories, symlinks, and special files.
901
911
- Size fallback: if visible drawings fit but persisted undo/redo history would exceed save or restore safety limits, autosave saves the drawings and warns once per run that history was trimmed or omitted.
902
912
- Image paste guard: when a pasted image would push visible session data over `max_file_size_mb`, Wayscriber blocks the paste and points you to `[session] max_file_size_mb`; when only undo history is at risk, the paste is allowed with a warning.
903
913
- Load safety: compressed session files are checked against an internal expanded-size cap while saving and loading. If an existing file expands beyond that cap, wayscriber refuses to load it, leaves the primary session file unchanged, and avoids overwriting it until session data changes.
904
914
- Recovery: if a session file is corrupt or cannot be parsed/decompressed, wayscriber logs a warning, writes a `.bak` copy of the bad file, removes the corrupt file, and continues with defaults. Overrides above still apply after recovery.
905
915
916
+
For end-to-end CLI, overlay, and configurator flows, see [`examples/session-manager.md`](../examples/session-manager.md).
917
+
906
918
### `[keybindings]` - Custom Keybindings
907
919
908
920
Customize keyboard shortcuts for all actions. Each action can have multiple keybindings.
-`src/backend/wayland/session/`: runtime Open, Save As, and Clear transactions for the active overlay.
142
+
-`src/backend/wayland/state/toolbar/events/session.rs`: overlay Session panel routing for Open, Save As, Info, Clear, recent sessions, and configurator launch.
143
+
-`src/daemon/`: accepts daemon-toggle requests that carry an optional named session target.
144
+
145
+
**Flow:**
146
+
1. CLI `--session-file` creates a named target instead of using configured storage. Named targets force persistence for that run, reject `--no-resume-session`, require an existing parent directory for foreground/open flows, and reject directories, symlinks, and special files.
147
+
2. Backend startup builds `SessionOptions` from config plus any named target, then session loading restores boards/history/tool state before rendering begins.
148
+
3. Runtime Open first saves dirty current data when needed, loads the candidate named session without mutating it, replaces board state only after a valid load, and records the open in the named-session catalog.
149
+
4. Runtime Save As validates the target, prompts before replacing existing artifacts, writes the snapshot, switches the active target, and records the save in the catalog.
150
+
5. Runtime Clear writes a durable empty-session boundary so older backup or recovery artifacts do not restore stale drawings.
151
+
6. The configurator reads the same catalog for inactive-session management: rename/reveal/forget metadata, duplicate primary files, move non-lock sidecars, and clear saved data when daemon/overlay locks are absent.
152
+
153
+
---
154
+
155
+
## 8. Utility Modules
137
156
138
157
-**`src/draw/`**: Shape definitions, Cairo helpers, arrow geometry, fonts, and the `CanvasSet` abstraction (with undo/history per board mode).
139
158
-**`src/ui.rs`**: Composes the status bar and help overlay using Cairo.
@@ -143,7 +162,7 @@ Notifications are sent via `notification::send_notification_async`, keeping all
143
162
144
163
---
145
164
146
-
## 8. Directory Map (excluding configurator)
165
+
## 9. Directory Map (excluding configurator)
147
166
148
167
| Path | Role |
149
168
|------|------|
@@ -155,19 +174,21 @@ Notifications are sent via `notification::send_notification_async`, keeping all
|`src/session/`| Configured and named session persistence, snapshots, sidecars, locks, and catalog metadata. |
158
178
|`src/notification.rs`| Desktop notifications for capture results. |
159
179
|`src/util.rs`| Shared math/color utilities. |
160
180
|`tests/`| CLI + rendering integration tests. |
161
181
162
182
---
163
183
164
-
## 9. Putting It Together
184
+
## 10. Putting It Together
165
185
166
186
1.**Launch** via CLI → choose daemon vs active.
167
187
2.**Daemon** provides lifecycle management, tray integration, and toggles the backend on demand.
168
188
3.**Backend** sets up Wayland surfaces and loops, forwarding input to `InputState`.
169
189
4.**InputState + draw/ui** update the overlay contents and request renders.
170
190
5.**Capture** subsystem handles screenshot actions asynchronously and notifies the user.
171
-
6.**Config** module ensures user preferences are honored everywhere.
191
+
6.**Session** loads and saves configured or named session state, including runtime Open/Save As/Clear transactions.
192
+
7.**Config** module ensures user preferences are honored everywhere.
172
193
173
194
Use this document to trace any feature: locate the entry point (CLI, tray, keybinding), follow it through the backend/input/capture stacks, and consult the relevant modules listed above for details.
0 commit comments