mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-29 01:08:56 +01:00
Preserve tenant-scoped metadata through partial URL updates and project stable URLs across runtime identities. Use a safe adjacent launch control across overview tables with desktop and mobile regression coverage.
22 lines
676 B
TypeScript
22 lines
676 B
TypeScript
export const RESOURCE_METADATA_CHANGED_EVENT = 'pulse:resource-metadata-changed';
|
|
|
|
export type ResourceMetadataChangedDetail = {
|
|
metadataKind: 'agent' | 'guest' | 'docker' | 'docker-host';
|
|
metadataId: string;
|
|
customUrl?: string;
|
|
};
|
|
|
|
export const dispatchResourceMetadataChanged = (detail: ResourceMetadataChangedDetail): void => {
|
|
if (typeof window === 'undefined' || !detail.metadataId) return;
|
|
|
|
try {
|
|
window.dispatchEvent(
|
|
new CustomEvent<ResourceMetadataChangedDetail>(RESOURCE_METADATA_CHANGED_EVENT, {
|
|
detail,
|
|
}),
|
|
);
|
|
} catch {
|
|
// Metadata writes remain authoritative; event dispatch is only same-tab UI synchronization.
|
|
}
|
|
};
|