Skip to content

ImageField Implementation in Right Sidebar #21

@dannysmith

Description

@dannysmith

Problem

Astro's image() fields appear as plain strings in JSON schema. Cannot detect without Zod parsing.

What's Needed

1. Image Detection

  • Run Zod parser in parallel with JSON schema parser
  • Extract image field metadata from Zod
  • Merge into JSON schema results
  • Add isImage: boolean to SchemaField

2. ImageField Component

// src/components/frontmatter/fields/ImageField.tsx
- Image picker/browser UI
- Preview thumbnail
- Drag & drop support
- Path validation
- Integration with Astro assets directory

3. Rust Integration

#[tauri::command]
pub async fn browse_assets_directory(
    project_path: String,
    collection_name: String,
) -> Result<Vec<String>, String>

4. Project Settings

pathOverrides?: {
  assetsDirectory?: string  // Default: "src/assets"
}

Dependencies

  • This task must be complete first
  • Understanding of Astro assets directory structure
  • User testing for optimal UX

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions