Skip to content

v2.3.0

Choose a tag to compare

@tcgbp tcgbp released this 08 Oct 12:59
· 37 commits to master since this release

Internal refactor with nothing different on screen and no preference migration — the settings namespace stays dock-flash.

The mode used to be decided by probing ctx.get('workbench'). That pairing breaks as soon as the two halves can be installed independently: dock-base installed, no dock adapter rendered nothing at all — no sidebar panel, and no ⚡ to fall back on. Ownership is inverted instead.

  • ctx.provide('dockFlashPanel', …) publishes { version: 1, Panel, ErrorBoundary, Header, icon, registry, i18n, host } — a frozen field set checked at startup. A host that finds no service, or one whose version it does not speak, logs the reason and leaves the ⚡ in place rather than drawing half a panel.
  • host.claim() returns a lease bound to the host fiber; a 2 s watchdog undoes an unconfirmed claim, and release() remounts the ⚡. A duplicate apply() returns immediately, keyed on the service (not a module or window flag, which would make a legitimate disable→enable inert).
  • createPanelHeader(registry) seals the seven symbols the dock header used to reach into, and accepts both { wb } and dock-base's own ViewProps { ctx, viewId, … } (dock-base never passes wb).
  • The dock half is now one closed //#region DockAdapter; its dock-hidden ↔ ⚡ sync releases the claim instead of mounting its own trigger.
  • Fixed: the moved mountWorkbench still closed over apply()'s ctx — a ReferenceError: ctx is not defined on the first boot with dock-base.
  • Fixed: the header's close-on-blur toggle had, since 2.2.0, written the preference through the workbench service where a registry was expected, so the header never repainted its own switch.
  • Fixed: the claim was a single lease while dock-base mounts the panel twice — the sidebar pane and the floating window — so the first of the two to unmount pulled the panel out from under the instance still mounted. The lease now carries a holder count, whose one invariant is count non-zero ⇔ lease alive: each mount's disposer releases exactly one holder, and only a dock-hidden or a whole-host teardown releases the lease itself.
  • Fixed: the panel service was read with ctx.get('dockFlashPanel') in the same synchronous tick as the provide that publishes it, and cordis resolves services asynchronously (measured on cordis 4.0.4: undefined in that tick, a value on the next), so the dock half registered nothing at all — the root cause of the report "dock-flash 没有出现在 dock-base 配置里". The adapter now receives the service as an explicit argument rather than looking it up, and a source-level pin asserts the call site passes it.

The adapter did not become a separate file: a client bundle's synchronous require cannot resolve a relative path, so the file boundary arrives in Phase 2, when the two halves are two packages.

check:overlay 272 → 295 assertions, 0 fail (the section drives the whole truth table against a fake workbench: claim, the five registrations, the ⚡ standing down, the dock-hidden round trip, dispose, the watchdog, a late workbench, both refusals, a pin that every dock-base-only API stays inside the region, the multi-mount holder count, and a ctx that cannot resolve the service at all — the production shape).

Full narrative: CHANGELOG.md.