Status: design agreed 2026-11-30; official Backpack integration implemented, browser acceptance pending. Python file workflow remains planned.
Reuse should not require users to define new Blockly block types. Start with two independent mechanisms: editor-side block snippets and native Python source files. They may complement each other later, but neither requires the other. Preserve the program-first workflow and existing Python generation semantics.
Use the official Blockly workspace-backpack plugin instead of a custom Snippets category. The pinned plugin release 13.4.0 matches Blockly 13.4.0. Native drag-to-backpack, right-click copy/remove, flyout drag-out and empty operations remain unchanged. A saved item is an ordinary block stack with its nested inputs and following connected blocks, not a new callable block or a runtime dependency. No naming dialog, categories, search, custom slot definitions or management page in this version.
Keep the plugin's native contents format and save one snapshot in a separate IndexedDB database (pyblocks-backpack, store backpack, key global). Use skipSerializerRegistration: true to keep it out of project serialization, import/export, duplication and deletion. Load it when opening an editor and persist on backpack_change. Storage failure must not overwrite unreadable saved contents. The first version shares persisted contents across projects in the same browser origin; concurrently open editors do not live-sync and the last saved snapshot wins.
The official plugin supplies serialization and flyout behavior. Browser acceptance must verify drag/copy, nested stacks, variables and procedure definitions/calls across distinct projects, same-name collisions, reload and project import, language/theme changes, and clearing. Missing definitions or external dependencies are not automatically collected. Do not promise automatic dependency resolution or class support.
The agreed near-term workflow is three import sources: a PyBlocks curated static Registry, a user-provided cross-origin-accessible URL, and a local .py upload. All produce project-owned source snapshots, preserving relative package directory paths and checking collisions before adding the complete file set. Deploy them with the entry program by extending the existing library upload path. The Registry is a curated file-set importer, not a dependency resolver. No in-browser library editing or file creation in this scope. Generating additional Python files from blocks is a separate future design question, not a requirement for dependency imports.
See Project Python dependencies for the implementation handoff.
Custom blocks are explicitly deferred. Their shape, typed inputs and outputs, statement connections, exposed sockets, parameter binding, scoping, code generation and reusable implementation (blocks or Python source) are not settled. Do not expose a user-defined block registration/code-generation facility now. Do not treat snippets as the first version of such a facility.
Class definition blocks are also deferred until reuse and source organization are clearer. Native Python object construction, attribute access and method calls remain available. Continue reference display-driver examples using ordinary functions and FrameBuffer composition; a working function-based driver does not establish class-inheritance parity. There is no requirement to introduce classes merely to complete the next screen example.
- Adopt the official Blockly Backpack and persist its contents independently from Python files; validate browser interactions.
- Implement curated Registry, URL import and local upload through the existing project library path; retain native imports.
- Revisit classes and custom blocks separately only once concrete reusable workflows justify them.
No implementation date or promise for the deferred features is implied.