- Selection { map<kind, set<uid>> uids; Handle focus; } (src/selection.*, core)
replaces Document::reference, the frames/items/animation Storages,
groupReferences, and the timeline's selection snapshot/lock/focus state.
- Because selection is by uid it follows elements through edits by itself;
after an edit or undo, selection_follow only drops removed uids and moves a
removed focus to its nearest survivor. The Stage 2 handle capture/re-resolve,
frames_reference_normalize_for, frames_selection_sync_for and the index-based
frame validity repair are gone.
- Document keeps a UidIndex (rebuilt on every change) and exposes
reference_get/reference_set, selected_get/selected_set(kind),
frame_references_get/set and animations_selected_get/set.
- UidIndex records each uid's element type.
- The animations list keeps its ImGui multi-select Storage as a per-frame mirror
of the Selection; content windows are unchanged until Stage 8.
- tests/selection.cpp and tests/undo.cpp cover selection through inserts,
reverses, deletes, item and animation removal, regrouping and undo.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- src/edit/ (in anm2ed_core): frame, track, animation, region, grid and
change-all edits as plain functions of the model. Each returns the uids of what
it created for the UI to select; copies get fresh uids.
- Document::edit_apply snapshots, runs an operation and commits; edit_begin
starts drag edits. window_edit, edit_command_push, snapshot_command_push,
SnapshotKind and the tracks/frames/regions/textures snapshot kinds are gone;
Snapshots has a single push(message, isTextures).
- Timeline, animations, regions, shaders, items, wizards, taskbar and file merge
call the edit layer; they keep only selection, scrolling and toasts.
- Snapshots, Storage, Playback and ImGui core build into anm2ed_core, so undo is
testable: tests/undo.cpp runs a seeded random walk of edits per fixture and
checks every undo/redo state by hash, plus selection follow through undo.
- types::edit renamed types::edit_state (clashed with the edit namespace).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Element::uid: runtime-only, unique per document (uids_repair on load and after
every edit gives copies and new elements fresh uids; never serialized or hashed)
- Handle {animation, item, frame} uids and UidIndex (one walk: uid -> Reference)
- Snapshots capture the selection's handles when an edit starts and re-resolve the
fields the edit left untouched on commit, undo and redo; replaces
restored_snapshot_sanitize. Covers the main reference, frame/item/group
references, timeline frame selection and the animation list selection.
- tests/selection.cpp: references survive inserts, copies, deletes, animation
removal/reordering and regrouping
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- resource::Image (pixels, size, uid) replaces Texture in documents, undo and
wizards; it lives in anm2ed_core with no GL. uid changes with the pixels.
- resource::texture::id_get uploads lazily and evicts textures not drawn in a frame
- resource::AudioData (bytes, uid) replaces Audio; resource::audio::play/stop/
track_detach/is_playing cache decoded audio and tracks per uid
- Resources::icon_id_get shortens the icon call sites
- tests/assets.cpp covers Image png round trip, uid tracking, merge_append
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Duplicate ids in any content list (spritesheets, shaders, layers, nulls, events,
sounds, regions) are repaired at load: the first holder keeps the id, so tracks
stay bound to the item they referenced (previously remapped to the wrong layer)
- Unknown attributes and element text survive save; retired BakeCount/OriginalDelay
are still dropped. Private corpus (1,251 files) output unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- anm2ed_core static library (anm2 + non-UI util + log) shared by app and tests
- Logger is inert until session_open, so the core has no SDL dependency
- doctest suite: golden round-trips of 12 synthetic fixtures across every
serialization preset, format and merge type; save/reload invariants
(fixed point, hash stability, game view equals re-baked game view);
operation goldens; env-gated private corpus run (ANM2ED_CORPUS)
- ANM2ED_UPDATE_GOLDEN=1 regenerates goldens; tests/MANUAL.md UI checklist
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CanvasView base holds checker pan sync, zoom step, grid panel, view buttons and view context menu
- frame_parent_model_get replaces five root/group transform compositions
- Canvas builds VAOs through one helper, unifies uniform setters and frees the texture VAO/VBO/EBO (leak fix)
- Settings load/save loop over component suffix tables; unused settings Type enum removed
- Manager shares one path-list load/save for recent and autosave files
- Anonymous namespaces removed per project style
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FRAME_CHANGE_SCALARS generates FrameChange fields, the frames_change apply step and change-all population
- Change-all draws component rows from tables instead of five widget lambdas and 46 aliases
- Frame properties uses one edit path (edit::COMPLETE), a vec2 field table and an X/Y flip loop
- Shared INTERPOLATION_LABELS and Document::layer_regions_get
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TimelineState base carries persistent state; TimelineContext no longer copies 50 references
- 111 per-frame std::function lambdas become member functions
- Delete wrappers that re-implemented anm2 helpers
- One snapshot/edit push path, one theme color lookup, shared frame grouping/refocus/trigger filters
- Row building and bake targets loop over TRACK_CONTAINERS
- Split commands.cpp into selection.cpp, edit.cpp and menus.cpp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- WINDOW_FLAGS table builds every context menu, footer and shortcut set
- Shared list-row and card-row renderers replace per-window copies
- Layers/nulls/events share one properties popup; Manager keeps one item popup API
- Regions, spritesheets and sounds drop hand-built menus, footers and shortcut blocks
- Animation remove and cut share one erase path that also clears group ids
- Index-mapped multi-select fixes shift-range over non-contiguous ids
- Fix Remove Unused tooltip showing the Add shortcut and the missing break in item properties
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Region generate/scan move to anm2/regions.cpp; both generators number from 1
- file_merge moves to anm2/merge.cpp and is table-driven
- MaxRects packer moves to util/pack
- Uniform config apply/trim/save move to resource/shader
- Snapshots push from their owned state; Document snapshot wrappers removed
- DocumentData base replaces the hand-written move constructor
- toast_log replaces 55 duplicated toast + English log pairs
- Apply repo .clang-format to touched files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Collapse const/non-const pairs into templates; Anm2::element_get uses deducing this
- Drive container/track/item mappings from ANM2_ELEMENT_TYPES, ANM2_ITEM_TYPES and TRACK_CONTAINERS
- One sink-based emitter feeds both XML writing and hashing
- frame_mix and frame_bake_split replace five copies of the bake/lerp loop
- item_add replaces layer_animation_add/null_animation_add
- Fix timeline split ignoring shear
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>