Skip to content

Conversation

@bourgeoa
Copy link
Contributor

@bourgeoa bourgeoa commented Feb 10, 2026

Pull Request Summary

Summary

Consolidated dokieli and HTML rendering in humanReadablePane, removed blob URL usage, and implemented dynamic async icon detection for panes.

Changes

Solid Panes - humanReadablePane.js

  • ✅ Replaced blob URL creation with direct subject.uri for iframe src
  • ✅ Implemented dynamic icon function returning:
    • markdown.svg for markdown files (detected by extension)
    • dokieli-logo.png for dokieli documents (detected by content)
    • Default icon for other HTML/media files
  • ✅ Added async icon detection with Promise support for unfetched content
  • ✅ Consolidated dokieli rendering logic (previously duplicated in dokieliPane)
  • ✅ Dynamic height calculation based on content: dokieli files get -10 lines adjustment
  • ✅ Added allow-forms to iframe sandbox permissions for dokieli form submission

Solid Panes - dokieliPane.js

  • ✅ Removed render function (consolidated into humanReadablePane)
  • ✅ Set label() to return null (no viewing, only creation)
  • ⚠️ Kept mintNew and mintClass for dokieli document creation

Solid Panes - manager.js

  • ✅ Added async icon function support with Promise detection
  • ✅ Icon updates dynamically when Promise resolves

Technical Details

Icon Detection Hierarchy:

  1. Markdown files: Synchronous detection by file extension
  2. Cached results: Fast synchronous lookup from dokieliCache Map
  3. Already-fetched content: Synchronous check of fetcher cache
  4. Unfetched HTML: Async Promise that fetches content and detects dokieli

Sandbox Permissions: allow-scripts allow-same-origin allow-forms

Benefits

  • 🔄 Eliminated code duplication between dokieliPane and humanReadablePane
  • 🎯 Proper icon display for markdown and dokieli documents
  • 🚀 Performance: Synchronous detection when content is cached
  • 🔒 Maintained security with CSP-compliant direct URI loading

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove duplicate panes for text/html rendering : dokieli-pane and human pane

1 participant