{{
user.changeset
? changeSetsStore.changeSetsById[user.changeset]?.name || "Head"
@@ -32,5 +40,6 @@ const changeSetsStore = useChangeSetsStore();
defineProps({
user: { type: Object as PropType
, required: true },
+ hideChangesetInfo: { type: Boolean },
});
diff --git a/app/web/src/components/layout/navbar/UserIcon.vue b/app/web/src/components/layout/navbar/UserIcon.vue
index cbed1c07e4..ed9745e10f 100644
--- a/app/web/src/components/layout/navbar/UserIcon.vue
+++ b/app/web/src/components/layout/navbar/UserIcon.vue
@@ -20,6 +20,7 @@
/>
, required: true },
changeSetStarSide: { type: Boolean },
+ hideChangesetStar: { type: Boolean },
});
const color = computed(() => {
diff --git a/app/web/src/store/change_sets.store.ts b/app/web/src/store/change_sets.store.ts
index 4a33a47f5b..0bfacb95e2 100644
--- a/app/web/src/store/change_sets.store.ts
+++ b/app/web/src/store/change_sets.store.ts
@@ -9,6 +9,7 @@ import { ChangeSet, ChangeSetStatus } from "@/api/sdf/dal/change_set";
import router from "@/router";
import { useWorkspacesStore } from "./workspaces.store";
import { useRealtimeStore } from "./realtime/realtime.store";
+import { useFeatureFlagsStore } from "./feature_flags.store";
export type ChangeSetId = string;
@@ -17,6 +18,7 @@ export function changeSetIdNil(): string {
}
export function useChangeSetsStore() {
+ const featureFlagsStore = useFeatureFlagsStore();
const workspacesStore = useWorkspacesStore();
const workspacePk = workspacesStore.selectedWorkspacePk;
@@ -27,6 +29,7 @@ export function useChangeSetsStore() {
selectedChangeSetId: null as ChangeSetId | null,
changeSetsWrittenAtById: {} as Record,
creatingChangeSet: false as boolean,
+ postApplyActor: null as string | null,
}),
getters: {
allChangeSets: (state) => _.values(state.changeSetsById),
@@ -184,11 +187,22 @@ export function useChangeSetsStore() {
// TODO(Theo/Wendy) - for multiplayer support, we should add code to react if the change set you are using is merged by someone else
{
eventType: "ChangeSetApplied",
- callback: (id) => {
- const changeSet = this.changeSetsById[id];
+ callback: (data) => {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const { changeSetPk, actor } = data as any as {
+ changeSetPk: string;
+ actor: string;
+ };
+ const changeSet = this.changeSetsById[changeSetPk];
if (changeSet) {
changeSet.status = ChangeSetStatus.Applied;
- this.changeSetsById[id] = changeSet;
+ if (
+ this.selectedChangeSetId === changeSetPk &&
+ featureFlagsStore.MUTLIPLAYER_CHANGESET_APPLY
+ ) {
+ this.postApplyActor = actor;
+ }
+ this.changeSetsById[changeSetPk] = changeSet;
}
},
},
diff --git a/app/web/src/store/feature_flags.store.ts b/app/web/src/store/feature_flags.store.ts
index 60994b8091..2ee5ddf562 100644
--- a/app/web/src/store/feature_flags.store.ts
+++ b/app/web/src/store/feature_flags.store.ts
@@ -13,6 +13,7 @@ const FLAG_MAPPING = {
FUNC_TEST_PANEL: "func_test_panel",
AUTO_REATTACH_FUNCTIONS: "auto_reattach_functions",
COLLABORATORS: "collaborators",
+ MUTLIPLAYER_CHANGESET_APPLY: "multiplayer_changeset_apply_flow",
};
type FeatureFlags = keyof typeof FLAG_MAPPING;
diff --git a/app/web/src/store/realtime/realtime.store.ts b/app/web/src/store/realtime/realtime.store.ts
index 27f932edb7..f56707e243 100644
--- a/app/web/src/store/realtime/realtime.store.ts
+++ b/app/web/src/store/realtime/realtime.store.ts
@@ -3,6 +3,7 @@ import * as _ from "lodash-es";
import ReconnectingWebSocket from "reconnecting-websocket";
import { computed, reactive, ref, watch } from "vue";
import { API_WS_URL } from "@/store/apis";
+import { ActorView } from "@/api/sdf/dal/history_actor";
import { useAuthStore } from "../auth.store";
import { WebsocketRequest, WsEventPayloadMap } from "./realtime_events";
@@ -35,6 +36,7 @@ type TrackedSubscription = EventTypeAndCallback & {
type RealtimeEventMetadata = {
version: number;
workspace_pk: string;
+ actor: ActorView;
};
export const useRealtimeStore = defineStore("realtime", () => {