From 2327cfb861a4910bae2a5b62bf648dc46519d494 Mon Sep 17 00:00:00 2001 From: Forgotten Date: Thu, 26 Feb 2026 15:41:59 -0600 Subject: [PATCH] feat(ui): make company rail items proper links for right-click support Company rail icons are now tags with href instead of +

{company.name}

diff --git a/ui/src/context/CompanyContext.tsx b/ui/src/context/CompanyContext.tsx index f4ad4758..00a45d98 100644 --- a/ui/src/context/CompanyContext.tsx +++ b/ui/src/context/CompanyContext.tsx @@ -35,7 +35,22 @@ const CompanyContext = createContext(null); export function CompanyProvider({ children }: { children: ReactNode }) { const queryClient = useQueryClient(); const [selectedCompanyId, setSelectedCompanyIdState] = useState( - () => localStorage.getItem(STORAGE_KEY) + () => { + // Check URL param first (supports "open in new tab" from company rail) + const urlParams = new URLSearchParams(window.location.search); + const companyParam = urlParams.get("company"); + if (companyParam) { + localStorage.setItem(STORAGE_KEY, companyParam); + // Clean up the URL param + urlParams.delete("company"); + const newSearch = urlParams.toString(); + const newUrl = + window.location.pathname + (newSearch ? `?${newSearch}` : ""); + window.history.replaceState({}, "", newUrl); + return companyParam; + } + return localStorage.getItem(STORAGE_KEY); + } ); const { data: companies = [], isLoading, error } = useQuery({