diff --git a/app/components/primary_navigation_component.html.erb b/app/components/primary_navigation_component.html.erb
index a0750d712..b889d9122 100644
--- a/app/components/primary_navigation_component.html.erb
+++ b/app/components/primary_navigation_component.html.erb
@@ -2,7 +2,7 @@
<% items.each do |item| %>
- <% if item.fetch(:current, false) || current_page?(item.fetch(:url)) || current_page?("#{item.fetch(:url)}/details") %>
+ <% if item.fetch(:current, false) || item.fetch(:comparable_urls).any? { |url| request.fullpath.include?(url) } %>
-
<%= govuk_link_to item[:name], item[:url], class: "app-primary-navigation__link", aria: { current: "page" } %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index ca0af4254..6b101117c 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -65,15 +65,15 @@
<% if !current_user.nil? %>
<% if current_user.support? %>
<% items = [
- { name: "Organisations", url: "/organisations" },
- { name: "Users", url: "/users" },
- { name: "Logs", url: case_logs_path },
+ { name: "Organisations", url: "/organisations", comparable_urls: ["/details", "/organisations"] },
+ { name: "Users", url: "/users", comparable_urls: ["/users", "/account"] },
+ { name: "Logs", url: case_logs_path, comparable_urls: ["/logs"] },
] %>
<% else %>
<% items = [
- { name: "Logs", url: case_logs_path },
- { name: "Users", url: users_organisation_path(current_user.organisation) },
- { name: "About your organisation", url: "/organisations/#{current_user.organisation.id}" },
+ { name: "Logs", url: case_logs_path, comparable_urls: ["/logs"] },
+ { name: "Users", url: users_organisation_path(current_user.organisation), comparable_urls: ["/users", "/account"] },
+ { name: "About your organisation", url: "/organisations/#{current_user.organisation.id}", comparable_urls: ["/details"] },
] %>
<% end %>
<%= render PrimaryNavigationComponent.new(items:) %>