Repository navigation
Closed
Description
Create TextNode component that extends enhanced BaseNode with text-specific functionality and inline editing capabilities.
Dependencies
Related Issues
Requirements
- Component structure:
TextNode.svelteextends BaseNode with text-specific props - Inline editing: Click-to-edit functionality with save/cancel states
- Content props:
content: string,editable?: boolean,markdown?: boolean,placeholder?: string - Editing states: Visual feedback for edit mode vs display mode
- Keyboard shortcuts: Ctrl+Enter to save, Esc to cancel editing
- Auto-resize: Text area expands with content during editing
- Mock service: Create
mockTextService.tsfor simulated CRUD operations and auto-save - Basic markdown: Simple rendering support for headers, bold, italic
- Content preservation: Maintain formatting between edit and display modes
Technical Implementation
- File Location: Create
src/lib/components/TextNode.svelte - Base Extension: Use enhanced BaseNode as wrapper component
- State Management: Local Svelte stores for edit state, content, save status
- Mock Service: Create
src/lib/services/mockTextService.tsfollowing development process patterns - Markdown Library: Use simple markdown parser or basic regex for headers/bold/italic
- Reference: Follow existing component patterns and development process examples
Component Structure
<script lang="ts">
import BaseNode from '$lib/design/components/BaseNode.svelte';
export let content: string = '';
export let editable: boolean = true;
export let nodeId: string;
export let title: string = '';
let isEditing = false;
let editContent = content;
// State management and editing logic
</script>
<BaseNode
{nodeId}
{title}
nodeType="text"
hasChildren={false}
on:click={handleClick}
>
<div slot="content">
{#if isEditing}
<\!-- Inline editor -->
{:else}
<\!-- Display content with markdown -->
{/if}
</div>
</BaseNode>Mock Service Pattern
- Follow development process mock service examples
- Simulate network delays and auto-save behavior
- Provide CRUD operations: save, load, delete
- Return promises for async operations
Acceptance Criteria
- TextNode renders with proper text icon in circle indicator
- Click-to-edit works smoothly with visual state transitions
- Keyboard shortcuts function correctly (Ctrl+Enter save, Esc cancel)
- Content persists through edit/cancel operations
- Basic markdown renders in display mode (headers, bold, italic)
- Component works in different panel contexts (sidebar, main content)
- Auto-save simulation works with mock service
- Text area auto-resizes during editing
Metadata
Metadata
Assignees
Labels
No labels
Activity
Implement TextNode with inline editing functionality (addresses #18)
Implement TextNode with inline editing functionality (addresses #18)
Complete Issue #4: Enhanced BaseNode and TextNode Implementation (#29)
Complete Issue #4: Enhanced BaseNode and TextNode Implementation (#29)
Complete Issue #4: Enhanced BaseNode and TextNode Implementation (#29)