diff --git a/how-to/workspace-platform-starter/CHANGELOG.md b/how-to/workspace-platform-starter/CHANGELOG.md index 5018883127..5b22a15952 100644 --- a/how-to/workspace-platform-starter/CHANGELOG.md +++ b/how-to/workspace-platform-starter/CHANGELOG.md @@ -2,6 +2,9 @@ ## v18.0.0 +- Improvement: Added `apply` as an action on the WorkspaceChangedLifecyclePayload. Previously we had `create`, `update`, `delete`. `update` was being fired when a workspace was updated and when a workspace was applied. `apply` now makes it clear when a particular workspace platform override has been triggered. +- Improvement: modules/integrations/workspaces this module now refreshes the entries when a workspace is applied. So if a workspace entry in Home said it was selected it would be updated and the newly selected workspace would be updated to reflect it is the currently selected workspace. +- Updated: modules/composite/default-workspace/lifecycle logic to listen out for the new `apply` action. - Added support for rspack for faster builds. `npm run build-client-rspack` will npx install rspack and use the webpack config file to build the JavaScript from the TypeScript files. It is faster but no type checking is performed so we still recommend doing validated builds using `npm run build` or `npm run build-client`. - Improved performance of switching schemes - Improved performance of computing dock configuration, especially on theme changes. diff --git a/how-to/workspace-platform-starter/client/src/framework/platform/platform-override.ts b/how-to/workspace-platform-starter/client/src/framework/platform/platform-override.ts index 81acdb1684..da71225302 100644 --- a/how-to/workspace-platform-starter/client/src/framework/platform/platform-override.ts +++ b/how-to/workspace-platform-starter/client/src/framework/platform/platform-override.ts @@ -412,7 +412,7 @@ export function overrideCallback( } await fireLifecycleEvent(platform, "workspace-changed", { - action: "update", + action: "apply", id: payload.workspaceId, workspace: payload }); diff --git a/how-to/workspace-platform-starter/client/src/framework/shapes/lifecycle-shapes.ts b/how-to/workspace-platform-starter/client/src/framework/shapes/lifecycle-shapes.ts index 54ba206e9a..55b236580d 100644 --- a/how-to/workspace-platform-starter/client/src/framework/shapes/lifecycle-shapes.ts +++ b/how-to/workspace-platform-starter/client/src/framework/shapes/lifecycle-shapes.ts @@ -57,7 +57,7 @@ export interface WorkspaceChangedLifecyclePayload { /** * The action that happened to the workspace. */ - action: "create" | "update" | "delete"; + action: "create" | "apply" | "update" | "delete"; /** * The id of the workspace. diff --git a/how-to/workspace-platform-starter/client/src/modules/composite/default-workspace/lifecycle.ts b/how-to/workspace-platform-starter/client/src/modules/composite/default-workspace/lifecycle.ts index cd13164907..c7ba13c028 100644 --- a/how-to/workspace-platform-starter/client/src/modules/composite/default-workspace/lifecycle.ts +++ b/how-to/workspace-platform-starter/client/src/modules/composite/default-workspace/lifecycle.ts @@ -92,7 +92,9 @@ export class ApplyDefaultWorkspaceProvider implements Lifecycle platform: WorkspacePlatformModule, payload?: WorkspaceChangedLifecyclePayload ): Promise => { - if (payload?.action === "create") { + if (payload?.action === "create" || payload?.action === "apply") { if (!isEmpty(this._lastQuery) && !this._lastQuery.startsWith("/w ")) { await this.rebuildResults(platform); } diff --git a/how-to/workspace-platform-starter/client/types/module/shapes/lifecycle-shapes.d.ts b/how-to/workspace-platform-starter/client/types/module/shapes/lifecycle-shapes.d.ts index 43ffd09d44..f589e1f304 100644 --- a/how-to/workspace-platform-starter/client/types/module/shapes/lifecycle-shapes.d.ts +++ b/how-to/workspace-platform-starter/client/types/module/shapes/lifecycle-shapes.d.ts @@ -51,7 +51,7 @@ export interface WorkspaceChangedLifecyclePayload { /** * The action that happened to the workspace. */ - action: "create" | "update" | "delete"; + action: "create" | "apply" | "update" | "delete"; /** * The id of the workspace. */