Absolute URL or similar way to navigate between components in different modules?

Hi All,

In our Confluence Cloud Forge app, I added a tab under Space Settings (confluence:spaceSettings), and I would like to add a button to it that when clicked opens another component defined under Global Config (confluence:globalSettings), ideally also passing some state variables. I’m looking for a way to navigate between components defined under different modules, reusing the same React component and showing it under both modules is not an option.

Is there a way to either get an absolute URL that points to a specific component under a specific module, or target a component defined in another module, e.g. by referencing its key? Is this doable in Forge? I see that when I open my component under Global Config, the URL in my browser contains the Forge app id and the key I use when defining my component in manifest.yml, but the URL also contains another key which apparently originates from Forge’s internals. I would not rely on composing URLs like that, there really should be a standard way for doing this, I see no reason why not.

Has anyone been able to solve this? Any suggestions are welcome.
Thanks,
Gabor

2 Likes

Hi @GaborDicsoMidori,

I’m an engineer in Confluence Ecosystem. At the moment we don’t have a better way than manually composing the URLs. To clarify, if the link is clicked, you want the browser to navigate to GlobalSettings module’s page right?

I have created a feature request ticket here.

Hi Engin,

Thank you for your response and the ticket. Yes, the goal is to navigate to a page in the GlobalSettings module. I have implemented the URL composing workaround for now, but I’m looking forward to replacing it with a standard mechanism once available. Ideally I would like to be able to target any of my components defined under any module, also providing some context that allows me to set the initial state of the targeted component.

Kind regards,
Gabor

2 Likes

@EnginTekin It is surprising that in Forge you can generate a navigation link (URL) from a component in module “A” to a component in module “B”… :open_mouth:

Why is it missing? Is this an antipattern? A design flaw? Or what?

As Gabor wrote, the manual URL composition trick can work in simple situations, but we couldn’t figure out how to pass variables as part of the URL. Do you have a tricky solution for that?

1 Like

In addition to enhancing navigation within the app, being able to create unambiguous URLs pointing to any module of an app, possibly setting state via query parameters or POST requests, would also be beneficial for automated testing. Currently this is doable in a very limited way, for certain modules only, with no way to set initial state, and by requiring us to find out the envId of our app in advance, for which there is also no official way that I’m aware of (other than looking at the output of forge deploy --verbose or using the browser’s dev tools).

1 Like