annotate infinite_canvas/docs/pinning-and-context.md @ 278:8d560f50ed4c

Improve infinite canvas interactions and browser chrome Render Lucide icons directly with Raylib, add searchable icon browsing, robust text editing, entity lifecycle animations, z-order-safe input, semantic themes, and animated editable browser controls. Document rendering, pinning, context, and component extension for future agents. Co-authored-by: Copilot <[email protected]> Copilot-Session: f68442b1-fa8f-46a0-9689-81710613bbd4
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 22:16:14 -0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
278
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
1 # Pinning and Visible Context
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
2
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
3 ## Pinning
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
4
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
5 Pressing `P` toggles the selected entity through
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
6 `Canvas_Scene_Toggle_Selected_Pin()`.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
7
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
8 When pinning starts, `Canvas_Entity_Capture_Pin()` records:
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
9
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
10 - the entity's current screen-space origin;
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
11 - its current screen-space size.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
12
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
13 After camera input, `Canvas_Scene_Sync_Pinned()` clamps that screen rectangle to
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
14 the viewport, converts its origin back into world coordinates, and divides its
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
15 screen size by the current zoom. The entity therefore still participates in the
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
16 world renderer and picking system, but appears fixed in the camera view while
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
17 the camera pans or zooms. Pinned entities are marked with the generated Lucide
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
18 `pin` vector, drawn through the same Raylib icon path as the gallery.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
19
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
20 Dragging or activating a pinned entity recaptures its screen-space state.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
21 Notifications are the exception: they use the dedicated animated stack in
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
22 `Canvas_Scene_Update_Notification_Stack()` and cannot be toggled with `P`.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
23
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
24 ## Visible context
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
25
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
26 `Canvas_Scene_Build_Visible_Context()` treats the camera viewport as the context
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
27 boundary:
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
28
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
29 1. Convert the screen viewport to world bounds.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
30 2. Intersect each entity's semantic bounds with that viewport.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
31 3. Skip dismissed notifications.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
32 4. Append identity, type, position, size, pin state, and type-specific state.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
33 5. Report visible count, bytes written, and truncation.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
34
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
35 Zooming out expands the world-space viewport, so more entities become context.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
36 Panning removes entities that no longer intersect it. The serializer preserves
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
37 scene order and concatenates all visible entries into one provisional text
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
38 snapshot.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
39
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
40 Examples of semantic state include text-area content/editing, dropdown
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
41 selection/open state, switch value, selected calendar date or table row, scroll
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
42 offset, image source, browser URL, and Lucide gallery scroll/renderer metadata.
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
43
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
44 When adding an entity, never leave it on the generic `value=%d` fallback if an
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
45 agent would need richer meaning. Update the serializer and the viewport/context
8d560f50ed4c Improve infinite canvas interactions and browser chrome
MrJuneJune <me@mrjunejune.com>
parents:
diff changeset
46 tests together.