ui: persist issue properties pane visibility in localStorage

Store the open/closed state of the properties panel in localStorage
so it persists across navigations, issues, and companies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dotta
2026-03-03 12:07:01 -06:00
parent fd90723902
commit 31cab6efd2
3 changed files with 44 additions and 8 deletions

View File

@@ -29,7 +29,7 @@ import { Button } from "@/components/ui/button";
export function Layout() {
const { sidebarOpen, setSidebarOpen, toggleSidebar, isMobile } = useSidebar();
const { openNewIssue, openOnboarding } = useDialog();
const { panelContent, closePanel } = usePanel();
const { togglePanelVisible } = usePanel();
const { companies, loading: companiesLoading, selectedCompanyId, setSelectedCompanyId } = useCompany();
const { theme, toggleTheme } = useTheme();
const { companyPrefix } = useParams<{ companyPrefix: string }>();
@@ -88,9 +88,7 @@ export function Layout() {
setSelectedCompanyId,
]);
const togglePanel = useCallback(() => {
if (panelContent) closePanel();
}, [panelContent, closePanel]);
const togglePanel = togglePanelVisible;
// Cmd+1..9 to switch companies
const switchCompany = useCallback(

View File

@@ -4,15 +4,15 @@ import { Button } from "@/components/ui/button";
import { ScrollArea } from "@/components/ui/scroll-area";
export function PropertiesPanel() {
const { panelContent, closePanel } = usePanel();
const { panelContent, panelVisible, setPanelVisible } = usePanel();
if (!panelContent) return null;
if (!panelContent || !panelVisible) return null;
return (
<aside className="hidden md:flex w-80 border-l border-border bg-card flex-col shrink-0">
<div className="flex items-center justify-between px-4 py-2 border-b border-border">
<span className="text-sm font-medium">Properties</span>
<Button variant="ghost" size="icon-xs" onClick={closePanel}>
<Button variant="ghost" size="icon-xs" onClick={() => setPanelVisible(false)}>
<X className="h-4 w-4" />
</Button>
</div>