docs update

This commit is contained in:
2025-10-13 11:04:46 +03:00
parent caf483abb4
commit 305badf483
2 changed files with 109 additions and 31 deletions

View File

@@ -12,6 +12,7 @@ Astrolabe is a lightweight, browser-based snippet manager for Vega-Lite visualiz
- **Storage**: localStorage (initial), planned migration to IndexedDB for scale
- **Key Dependencies**: Monaco Editor and Vega-Embed loaded via CDN
- **Structure**: Three-panel resizable interface (snippet library, editor, preview)
- **Styling**: Retro Windows 2000 aesthetic with square edges and classic colors
## Development Commands
@@ -20,32 +21,87 @@ This project uses no build tools or package managers. Development is done by:
- Using browser dev tools for debugging
- No npm, yarn, or build commands needed
## Current Features
### ✅ **Core Interface** (Phases 1-4)
- **Three-panel layout**: Resizable snippet library, Monaco editor, live preview
- **Panel controls**: Toggle buttons (📄 ✏️ 👁️) for show/hide with proportional expansion
- **Resize handles**: Drag to adjust panel widths with memory system
- **Monaco Editor**: Full JSON schema validation for Vega-Lite with autocomplete
- **Live preview**: Debounced Vega-Lite rendering with error handling
### ✅ **Data Management** (Phases 5-6)
- **localStorage persistence**: Robust snippet storage with error handling
- **Auto-save system**: Debounced draft saving for both specs and metadata
- **CRUD operations**: Create, read, update, delete with visual feedback
- **Ghost card interface**: "Create New Snippet" card at top of list
- **Smart timestamps**: Auto-generated names using ISO datetime format
### ✅ **Advanced Organization**
- **Multi-field sorting**: Sort by Modified/Created/Name with ascending/descending toggle
- **Visual sort indicators**: Arrow icons (⬇⬆) showing current sort direction
- **Comprehensive search**: Filter by name, comment, and spec content with real-time results
- **Search integration**: Works seamlessly with sorting and maintains selection
- **Settings persistence**: Sort preferences and UI state saved to localStorage
### ✅ **User Experience Enhancements**
- **Metadata panel**: Shaded section with inline name editing, comments, and timestamp info
- **Operation buttons**: Duplicate and Delete buttons in metadata panel
- **Smart state management**: Maintains selection during operations, clears when filtered out
- **Performance optimizations**: Prevents auto-save/render timeouts during snippet switching
- **Intuitive interactions**: Right-click removed in favor of accessible button controls
## Core Data Model
The application centers around two main entities:
- **Snippets**: `{id, name, created, modified, spec, draftSpec, comment, tags[], datasetRefs[], published}`
- **Datasets**: `{id, name, created, modified, data, format, size}`
**Snippets**: `{id, name, created, modified, spec, draftSpec, comment, tags[], datasetRefs[], meta}`
**Settings**: `{sortBy, sortOrder, panelWidths[], panelVisibility[], autoSaveDelay, meta}`
## Development Phases
The project follows a structured 14-phase development plan (see docs/dev-plan.md):
- Phase 0: Storage architecture design
- Phase 1-4: Basic UI layout and editor integration
- Phase 5-7: Data persistence and draft/publish workflow
- Phase 8-12: Polish and advanced features
- Phase 13-14: Future enhancements (search, cloud sync)
**Current Status**: Enhanced Phase 6 - Advanced Snippet Management
**Current Status**: Phase 0 - Storage Architecture Design
**Completed Phases**:
-**Phase 0**: Storage Architecture Design
-**Phase 1**: Static HTML Structure with retro styling
-**Phase 2**: Resizable Panels with memory system
-**Phase 3**: Monaco Editor Integration with Vega-Lite schema
-**Phase 4**: Vega-Lite Rendering with live preview
-**Phase 5**: Data Model + LocalStorage with comprehensive snippet storage
-**Phase 6+**: Enhanced CRUD with sorting, searching, and advanced UX
**Next Phase**: Phase 7 - Draft/Published Workflow
## Key Design Principles
- **Lean**: No frameworks, no build step, minimal dependencies
- **Local-first**: All data stored in browser initially
- **Local-first**: All data stored in browser with robust error handling
- **Developer-friendly**: Full JSON schema support with Monaco Editor
- **Safe experimentation**: Draft/published workflow prevents data loss
- **Safe experimentation**: Auto-save drafts with future draft/publish workflow
- **Performance-focused**: Debounced operations and smart state management
- **Retro aesthetic**: Consistent Windows 2000 styling throughout
## File Structure
Currently minimal:
- `docs/dev-plan.md` - Complete development roadmap
- Future: `index.html`, CSS, and JavaScript files in root
```
/
├── index.html # Main application entry point & initialization
├── src/
│ ├── styles.css # Retro Windows 2000 styling
│ └── js/ # Modular JavaScript organization
│ ├── config.js # Global variables, settings & sample data
│ ├── snippet-manager.js # Snippet storage, CRUD & localStorage wrapper
│ ├── panel-manager.js # Panel resize, toggle & memory system
│ ├── editor.js # Monaco Editor & Vega-Lite rendering
│ └── app.js # Event handlers & coordination
└── docs/
├── dev-plan.md # Complete development roadmap
└── storage-examples.md # Data model specifications
```
## Technical Notes
- **AMD Conflicts**: Resolved between Monaco Editor and Vega libraries using UMD builds
- **State Management**: Global flags prevent unwanted timeouts during programmatic updates
- **Memory System**: Panels remember preferred sizes across hide/show cycles
- **Search Performance**: 300ms debounced input with smart result caching
- **Auto-save Logic**: 1-second debounce for user edits, immediate for snippet switching