https://discord.umbraco.com logo
Bringing back the old jump menu for Content Conten...
# package-development
m
Bringing back the old jump menu for property groups, quick and dirty footerapp.. does anyone know if this could be moved as of old to work off the contentApp? Or have I missed another package that has already done it? https://cdn.discordapp.com/attachments/882984798719729704/1493963272108642474/image.png?ex=69e0e138&is=69df8fb8&hm=e367e70a1dad4a713d0793909eab043598aedb0f31702344b6ace7e02a593ced&
l
So they workspace view button would need to have some sort of submenu
interresting
m
had a thought and updated the ui/ux.. but now I don't seem to be able to find out which contentApp we are in... UMB_WORKSPACE_VIEW_CONTEXT don't seem to be able to get that.. and the UMB_WORKSPACE_CONTEXT doesn't seem to know the activeView.?? falling back to the route.. as that will end
view/content
/// but seems hacky and might lag instantiation. Though actually works quite nicely on the Info tab too... https://cdn.discordapp.com/attachments/1493963272498446516/1493996328223641770/image.png?ex=69e10001&is=69dfae81&hm=b69bd31ee2dca8fd3844e413df5d3151fb142bedd0752a6c7f6b85234bd9220c&
UMB_DOCUMENT_WORKSPACE_CONTEXT
, seem to have
workspace.view
but the
viewAlias
always seems to be undefined. ended up reverting to monitoring the dom.. which seems a little hacky..
Copy code
ts
_startMonitoring() {
    console.log("🚀 JumpMenu Manager: Monitoring DOM");
    if (this._timer) clearInterval(this._timer);

    this._timer = setInterval(() => {
        const currentUrl = globalThis.location.href;
        const isAllowedTab = currentUrl.includes('/view/content') || currentUrl.includes('/view/info');

        if (currentUrl !== this._lastUrl) {
            console.log("📍 URL Change detected:", currentUrl);
            this._lastUrl = currentUrl;
            this._stableCount = 0; // Reset stability on tab change
            this._cleanup();
        }

        if (isAllowedTab) {
            const injectedCount = this._inject();

            // If we injected something, reset stability. 
            // If we didn't, increment stability.
            if (injectedCount > 0) {
                this._stableCount = 0;
            } else {
                this._stableCount++;
            }

            // If the DOM has been stable for 10 cycles (approx 10 seconds), 
            // we assume the workspace has completed loading and slow down.
            if (this._stableCount > 10) {
                this._hibernate();
            }
        }
    }, 1000);
}
much better..
Copy code
js
 _observe(root) {
     const obs = new MutationObserver(() => this._triggerInject());
     obs.observe(root, { childList: true, subtree: true });
     this._observers.add(obs);
 }
3 Views