Added tab switch on Issue click

This commit is contained in:
2026-02-19 07:03:24 +02:00
parent 88bf06df35
commit a48128d445
2 changed files with 9 additions and 4 deletions

View File

@@ -368,6 +368,7 @@ export default function DeviceDetail() {
const notesRef = useRef(null);
const [usersLoading, setUsersLoading] = useState(false);
const [unresolvedIssues, setUnresolvedIssues] = useState(0);
const [notesPanelTab, setNotesPanelTab] = useState(null);
const notesPanelRef = useRef(null);
useEffect(() => {
@@ -954,7 +955,7 @@ export default function DeviceDetail() {
</SectionCard>
);
const notesSection = <div ref={notesPanelRef}><NotesPanel deviceId={id} /></div>;
const notesSection = <div ref={notesPanelRef}><NotesPanel deviceId={id} initialTab={notesPanelTab} /></div>;
const logsSection = <DeviceLogsPanel deviceSerial={device.device_id} />;
// ===== Layout rendering =====
@@ -1054,7 +1055,7 @@ export default function DeviceDetail() {
<>
<div style={{ width: 1, height: 24, backgroundColor: "var(--border-primary)" }} />
<button
onClick={() => notesPanelRef.current?.scrollIntoView({ behavior: "smooth", block: "start" })}
onClick={() => { setNotesPanelTab("issues"); notesPanelRef.current?.scrollIntoView({ behavior: "smooth", block: "start" }); }}
className="flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded-md cursor-pointer hover:opacity-80 transition-opacity"
style={{ backgroundColor: "var(--danger-bg)", color: "var(--danger-text)", border: "none" }}
>