@vestra-player/sdk 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.6.2
4
+
5
+ **Who must change: nobody, but check `TestHost` tests of a full sidebar or of `keepsRunning` with a background tab.** No change to the TypeScript API or the wire, `apiVersion` stays `vestra/1`, no new capability, no player version needed. `TestHost` follows player 0.7.3: it no longer refuses a ninth sidebar tab, and `keepsRunning` lists a sidebar panel only while its tab is the current tab, as `"its sidebar tab is the current tab"`. A test that expected `conflict` for a ninth tab, or `"a mounted panel"` for a sidebar panel, now fails.
6
+
7
+ - **Sidebar tabs without a limit** (player 0.7.3; the player's [sidebar tabs design](https://github.com/vestrasys/vestra-player/blob/main/doc/architecture/sidebar-tabs.md)). The sidebar takes any number of tabs: the strip shows the tabs that fit and a `»` menu at its end lists all of them, the current one checked. Players 0.4.x to 0.7.2 refused a ninth tab with `conflict` (「侧栏最多 8 个页签」); player 0.7.3 never refuses a sidebar mount for that. `Panel.ready`, [Windows, panels, settings pages, dialogs and the OSD](docs/explanation/ui.md#shared-space) and `TestHost` say so. The SDK's copy of the player's Chinese texts (`HOST_ZH_HANS`) drops "The sidebar holds at most {} tabs", which the player no longer has.
8
+ - **A background tab does not keep its plugin running** (player 0.7.3). The current tab keeps its plugin running as busy work; a sidebar panel never makes a plugin resident. A plugin whose sidebar panel is in a background tab, and that holds nothing else that keeps it running, goes to standby after the idle time like any idle plugin (stop reason `idle`); the player keeps its tab, with its title, in the strip and the `»` menu. Showing the tab starts the plugin again: `activate` runs and mounts the same panel (same file and component), which takes the tab over, and `Panel.ready` resolves again. The new process mounts with the properties its `activate` passes, so keep what the panel shows in session storage, the only state that survives standby, and restore it in `activate`. `Panel.state`, [Windows, panels…](docs/explanation/ui.md#panel), [How a plugin runs › Idle plugins are stopped](docs/explanation/plugins.md#idle-plugins-are-stopped) and [How the player runs and talks to plugins](docs/explanation/host-and-node.md) (the recorded `ui.mount`, the `panel_shown` wake) describe it. `TestHost.keepsRunning` lists `"its sidebar tab is the current tab"` while it is, and nothing for a background tab; `"a mounted panel"` is now for the bottom bar and the backdrop only.
9
+
3
10
  ## 1.6.1
4
11
 
5
12
  **Who must change: nobody.** Docs only: no change to the TypeScript API, the wire or `TestHost`, `apiVersion` stays `vestra/1`, no new capability.
Binary file
package/dist/i18n.js CHANGED
@@ -943,7 +943,6 @@ export const HOST_ZH_HANS = {
943
943
  sidebar: "侧栏",
944
944
  "video backdrop": "视频背景",
945
945
  "The {} is used by {}": "{}已被 {} 使用",
946
- "The sidebar holds at most {} tabs": "侧栏最多 {} 个页签",
947
946
  "{} is resolved by {}": "{} 已由 {} 解析",
948
947
  "File type .{}": "文件类型 .{}",
949
948
  "Not available in fullscreen": "全屏时不可用",
@@ -2782,12 +2782,18 @@ export declare class TestHost implements Transport {
2782
2782
  close(): void;
2783
2783
  /**
2784
2784
  * Why the player would keep this plugin running while nothing uses it
2785
- * (lazy activation, player 0.5.21), one line per reason, as the player's
2786
- * log says it: an event it listens to that is not one the player wakes
2787
- * it for (with what listens and where it was added), its mounted panel,
2788
- * its open windows. Empty: the player may stop it while idle and start
2789
- * it again on its next use. Filter chains, streams, jobs and the like
2790
- * (which also keep a plugin running) are not listed.
2785
+ * (lazy activation, player 0.5.21), one line per reason: an event it
2786
+ * listens to that is not one the player wakes it for (with what listens
2787
+ * and where it was added), its panel in the bottom bar or the backdrop,
2788
+ * its open windows (these as the player's log says them), and, from
2789
+ * player 0.7.3, its sidebar tab while that is the current tab. The
2790
+ * player counts the current tab as busy work, not as something live: it
2791
+ * keeps the plugin running only while the tab is shown, and a sidebar
2792
+ * panel in a background tab is no reason at all (the plugin may go to
2793
+ * standby; showing the tab starts it again). Empty: the player may stop
2794
+ * it while idle and start it again on its next use. Filter chains,
2795
+ * streams, jobs and the like (which also keep a plugin running) are not
2796
+ * listed.
2791
2797
  *
2792
2798
  * @capability None.
2793
2799
  * @since 1.5.40
@@ -314,8 +314,6 @@ const TEST_ZH_HANS = {
314
314
  "External SRT": "外部 SRT",
315
315
  "External ASS": "外部 ASS",
316
316
  };
317
- /** The player's limit of sidebar tabs. */
318
- const MAX_SIDEBAR_TABS = 8;
319
317
  /**
320
318
  * The player's refusal of a declaration (commands.rs `CommandError`): code
321
319
  * `invalid`, `conflict` or `limit`, its message prefixed as the player's.
@@ -3983,12 +3981,18 @@ export class TestHost {
3983
3981
  }
3984
3982
  /**
3985
3983
  * Why the player would keep this plugin running while nothing uses it
3986
- * (lazy activation, player 0.5.21), one line per reason, as the player's
3987
- * log says it: an event it listens to that is not one the player wakes
3988
- * it for (with what listens and where it was added), its mounted panel,
3989
- * its open windows. Empty: the player may stop it while idle and start
3990
- * it again on its next use. Filter chains, streams, jobs and the like
3991
- * (which also keep a plugin running) are not listed.
3984
+ * (lazy activation, player 0.5.21), one line per reason: an event it
3985
+ * listens to that is not one the player wakes it for (with what listens
3986
+ * and where it was added), its panel in the bottom bar or the backdrop,
3987
+ * its open windows (these as the player's log says them), and, from
3988
+ * player 0.7.3, its sidebar tab while that is the current tab. The
3989
+ * player counts the current tab as busy work, not as something live: it
3990
+ * keeps the plugin running only while the tab is shown, and a sidebar
3991
+ * panel in a background tab is no reason at all (the plugin may go to
3992
+ * standby; showing the tab starts it again). Empty: the player may stop
3993
+ * it while idle and start it again on its next use. Filter chains,
3994
+ * streams, jobs and the like (which also keep a plugin running) are not
3995
+ * listed.
3992
3996
  *
3993
3997
  * @capability None.
3994
3998
  * @since 1.5.40
@@ -4012,7 +4016,13 @@ export class TestHost {
4012
4016
  if (!WAKE_EVENTS.includes(event))
4013
4017
  for (const why of this.listeningWhy.get(event) ?? ["a listener"])
4014
4018
  reasons.push(`listens to ${event}: ${why}`);
4015
- if (this.panel)
4019
+ // A sidebar panel is never live (player 0.7.3): the current tab keeps
4020
+ // the plugin running as busy work, a background tab not at all.
4021
+ if (this.panel?.slot === "sidebar") {
4022
+ if (this.layout.sidebar?.owner === 1)
4023
+ reasons.push("its sidebar tab is the current tab");
4024
+ }
4025
+ else if (this.panel)
4016
4026
  reasons.push("a mounted panel");
4017
4027
  for (const [id, window] of this.windows)
4018
4028
  if (window.visible)
@@ -4234,8 +4244,8 @@ export class TestHost {
4234
4244
  "ui.mount": (p) => {
4235
4245
  if (this.panel)
4236
4246
  throw new HostError("conflict", "owner already mounted");
4237
- // Like the player: one panel in the bottom bar and the backdrop, tabs
4238
- // in the sidebar (up to 8).
4247
+ // Like the player: one panel in the bottom bar and the backdrop, any
4248
+ // number of tabs in the sidebar (player 0.7.3; 0.4.x to 0.7.2 took 8).
4239
4249
  const holder = p.slot === "backdrop"
4240
4250
  ? this.backdrop?.owner
4241
4251
  : p.slot === "bottom"
@@ -4246,11 +4256,6 @@ export class TestHost {
4246
4256
  this.#hostText(SLOT_LABELS[String(p.slot)]),
4247
4257
  String(holder),
4248
4258
  ]));
4249
- if (p.slot === "sidebar" &&
4250
- (this.layout.sidebar?.panels?.length ?? 0) >= MAX_SIDEBAR_TABS)
4251
- throw taken(this.#hostText("The sidebar holds at most {} tabs", [
4252
- MAX_SIDEBAR_TABS,
4253
- ]));
4254
4259
  const properties = this.#initialValues(this.#shownValues(p.properties));
4255
4260
  this.#seeImages(properties);
4256
4261
  this.#resetWrites("$mount");
@@ -2732,15 +2732,22 @@ export interface Panel extends View, Disposable {
2732
2732
  * A second sidebar panel is not refused: it resolves as another tab
2733
2733
  * (see {@link Panel.state}). Built-in plugins mount first at start-up,
2734
2734
  * so the playlist's tab is first and a built-in panel keeps its position.
2735
+ * Behaviour from player 0.7.3: the sidebar takes any number of tabs; the
2736
+ * strip shows the tabs that fit and a `»` menu lists all of them.
2737
+ * Players 0.4.x to 0.7.2 refused a ninth tab with `conflict`. A plugin
2738
+ * whose sidebar tab is in the background, and that holds nothing else
2739
+ * that keeps it running, goes to standby when idle; showing the tab
2740
+ * starts it again (see {@link Panel.state}).
2735
2741
  *
2736
2742
  * @throws `ui-prepare` (rejects) The Slint file does not compile, or a
2737
2743
  * bound property is not declared on the bridge global; `message` has the
2738
2744
  * diagnostics. (Players 0.4.0 and older also answer a taken bottom bar
2739
2745
  * or sidebar with it.)
2740
2746
  * @throws `conflict` (rejects) Another plugin's panel holds the bottom bar
2741
- * or the backdrop (shown, or being mounted), or the sidebar has all the
2742
- * tabs it takes (8); `message` names the position and the holder
2743
- * (「侧栏已被 vestra.playlist 使用」). Not an activation failure.
2747
+ * or the backdrop (shown, or being mounted); `message` names the
2748
+ * position and the holder (「底栏已被 vestra.playback 使用」). Not an
2749
+ * activation failure. Never for the sidebar (behaviour from player
2750
+ * 0.7.3); players 0.4.x to 0.7.2 also refused a ninth sidebar tab.
2744
2751
  * @throws `busy` (rejects) The player is still preparing this plugin's
2745
2752
  * previous mount, or its queue of mounts is full.
2746
2753
  * @throws `invalid` (rejects) `title` is longer than 128 bytes or has
@@ -2761,6 +2768,19 @@ export interface Panel extends View, Disposable {
2761
2768
  * only this plugin's own changes. A sidebar panel in a background tab
2762
2769
  * has `active: false`, `effective: false` and `reason: "otherTab"`.
2763
2770
  *
2771
+ * Behaviour from player 0.7.3: a background tab does not keep the plugin
2772
+ * running.
2773
+ * If the panel is all that keeps it running, the plugin goes to standby
2774
+ * after the idle time (stop reason `idle`): the player keeps its tab, with
2775
+ * its title, in the strip and the `»` menu. When the user shows the tab,
2776
+ * the player starts the plugin again; `activate` runs and mounts the same
2777
+ * panel (same file and component), which takes the tab over, and
2778
+ * {@link Panel.ready} resolves again. Anything the plugin kept only in
2779
+ * memory is gone: restore the view from storage (session storage
2780
+ * survives standby). While it is in the background, the player may also
2781
+ * drop the panel's component and build it again from the bridge
2782
+ * properties last written, as it does on any rebuild.
2783
+ *
2764
2784
  * @throws Never; `null` stands for "not mounted".
2765
2785
  *
2766
2786
  * @since 1.5.2
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vestra Player SDK
2
2
 
3
- > @vestra-player/sdk 1.6.1: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
3
+ > @vestra-player/sdk 1.6.2: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
4
4
 
5
5
  ## Read the documentation
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vestra-player/sdk",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Plugin API types, test host and plugin CLI for Vestra Player (apiVersion vestra/1)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {