Skip to content

fix: maintain cluster context after adding repo (#616) - #641

Merged
undera merged 2 commits into
komodorio:mainfrom
Vedant5125:fix-navigation-logic-616
Jan 9, 2026
Merged

undera merged 2 commits into
komodorio:mainfrom
Vedant5125:fix-navigation-logic-616

Conversation

@Vedant5125

Copy link
Copy Markdown
Contributor

Changes Proposed

Changes Proposed

This PR resolves Issue #616 where the application lost the cluster context after a user added a new repository.

The Problem: After a successful repository addition, the app redirected to /#/repository/<name> instead of /#/<cluster>/repository/<name>. This caused a "cluster unreachable: context undefined" error when the user navigated away and back, as the routing state became corrupted.

The Fix:

Header Navigation: Updated Header.tsx to use the new prefixed path logic. This ensures that clicking the "Installed" or "Repository" tabs always maintains the active cluster context in the URL, preventing the app from falling into an "undefined" state.

Centralized Routing Logic: Updated LinkWithSearchParams.tsx to automatically handle cluster prefixing based on the active context and clusterMode state.

Modal Navigation Fix: Modified AddRepositoryModal.tsx to ensure the post-success redirect includes the current cluster context.

Ingress Stability: Standardized navigation to use absolute-style paths (starting with /). Since we use HashRouter, these are absolute to the hash root, ensuring the app remains stable when hosted on sub-paths.

Closes #616

Check List

@undera undera left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you did not change dependencies - rollback lock file changes

@Vedant5125

Copy link
Copy Markdown
Contributor Author

I've updated the PR to remove the lock file changes. Please let me know if there are any other adjustments you'd like me to make! Happy to help.

@undera
undera merged commit 37af7df into komodorio:main Jan 9, 2026
4 checks passed
@undera

undera commented Jan 9, 2026

Copy link
Copy Markdown
Collaborator

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After adding a repository the cluster is undefined

2 participants

⌂ 换网址