Skip to content

Add multiple named spatial layouts to view presets #3

Description

@TyceHerrman

Problem

ViewPreset saves panel settings, while positions.json stores one global coordinate map and pin set. Presets can therefore change appearance and physics, but they all share the same spatial arrangement.

This prevents maintaining separate layouts for different projects, topics, or presentations.

Proposal

Allow each named user view preset to own its own node coordinates and explicit pins.

  • Saving a preset snapshots its panel state, coordinates, and pins.
  • Applying a preset saves the outgoing layout and restores the selected one.
  • Changes to one layout do not affect another.
  • Renaming preserves the layout; duplication copies it; deletion removes it.
  • New or deleted notes are handled gracefully using note paths, as today.

A possible implementation would:

  • add a stable ID to ViewPreset, backfilled during normalization;
  • evolve positions.json into a versioned map of layouts keyed by preset ID;
  • keep a default layout for sessions not associated with a preset;
  • migrate the current { positions, pins } data into that default without loss.

Existing presets without layout data could retain today’s behavior until saved as user presets.

Acceptance criteria

  • Two presets can retain different coordinates and pin sets.
  • Switching presets and restarting Obsidian restores the correct layout.
  • Editing one layout does not modify another.
  • Rename, duplicate, and delete behave correctly.
  • Existing positions.json data migrates without losing positions or pins.
  • Added or removed notes do not prevent a layout from loading.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions