Skip to content

Auto-target for read-only slideshow sources #71

@mateicanavra

Description

@mateicanavra

TL;DR

When saving a slideshow with no writable targetId (e.g., pasted/imported content), auto-generate a writable file in the default data directory instead of blocking.

Context

Depends on PER-38 (basic save infrastructure + provenance). This is Phase 3 of the persistence feature.

Scope

  • Slug generation utility (slideshow title → my-slideshow.json)
  • Server auto-creates file when targetId is null
  • Collision avoidance (suffix if file exists)
  • Response includes resolved targetId so client can update provenance

Implementation

// In FS adapter save()
if (!targetId) {
  const slug = slugify(slideshow.title || 'untitled');
  const targetPath = await findAvailablePath(dataDir, slug);
  // ... save to targetPath
  // Return resolved targetId in response
}

Acceptance Criteria

  • Pasted/imported slideshows can be saved without manual target selection
  • Generated filename is human-readable (slugified title)
  • Collisions handled gracefully (e.g., my-deck-1.json, my-deck-2.json)
  • Client provenance updated with resolved targetId after save
  • Subsequent saves go to the same file

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions