SolidOS / SolidOS/pane-registry

Dynamically loading panes

Open
#28 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5
Forks
1
Avg merge
7m
Merged PRs (30d)
1

Description

Responding to the README:

And so we hope we will end up with panes dynamically laoded according to user configuration preferences.

I thought I'd describe what I currently do and what I'm still missing.

A pane needs to be defined and registered using JS, so I have a index.html file that provides a custom pane sitting in my pod. When I navigate to it within solidos, it gets rendered in an IFrame.
Within that file, I call

parent.panes.register(p)

Or so that it becomes the default pane for that session:

parent.panes.list.unshift(p)                                                       
parent.panes["myPaneName"]=p
  1. The latter is a workaround because register always adds panes in order of decreasing preference, so a user-defined pane will never be default
  2. I currently have to specifically navigate to index.html within solidos. Pasting the URL straight into the location bar doesn't load solidos, and navigating to the folder loads solidos but not index.html. https://github.com/SolidOS/solidos/issues/196 would change the latter, i.e. the pane registration code would run automatically when navigating to the folder
  3. In some use cases, I don't need the pane to be always available - it would be ok for it to be registered only when navigating to a folder. For other use cases, it would be useful if the pane was automatically loaded from my preferences file (perhaps lazily the first time the relevant class is encountered). Presumably this would be just JS rather than an index.html, though maybe it could be an entire custom component.
  4. I do see there are security issues with executing arbitrary JS that has access to the entire parent solidos environment. I only have html files I have written in my pod at this time.

Despite the limitations above I find it very useful to be able to change a custom pane on the fly rather than having to recompile and without adding it to the mashlib bundle.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README and the pane registration calls in index.html, especially parent.panes.register(p) and the preference-list workaround. Trace how folder navigation and preference files currently load panes, then define behavior for default ordering, lazy registration, custom components, and arbitrary-JavaScript security before implementing. Done means dynamic panes load from the intended sources without requiring manual navigation or recompilation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.