@skyhook-io/k8s-ui 1.7.8 → 1.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo, useState, type ReactNode } from 'react';
|
|
1
|
+
import { useEffect, useMemo, useState, type ReactNode } from 'react';
|
|
2
2
|
import { ChevronRight, CircleCheck, Clock, ExternalLink } from 'lucide-react';
|
|
3
3
|
import { ClusterName, EmptyState } from '../ui';
|
|
4
4
|
import { formatCompactAge, formatRelativeAgeTime } from '../../utils/format';
|
|
@@ -108,9 +108,24 @@ function IssueRow({
|
|
|
108
108
|
const cluster = clusterLabel?.(issue);
|
|
109
109
|
const affected = affectedSummary(issue.affected);
|
|
110
110
|
const { headline } = issueMessageParts(issue);
|
|
111
|
+
const [renderDetails, setRenderDetails] = useState(open);
|
|
112
|
+
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (open) {
|
|
115
|
+
setRenderDetails(true);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (!renderDetails) return;
|
|
119
|
+
|
|
120
|
+
const timeout = window.setTimeout(() => setRenderDetails(false), 200);
|
|
121
|
+
return () => window.clearTimeout(timeout);
|
|
122
|
+
}, [open, renderDetails]);
|
|
111
123
|
|
|
112
124
|
return (
|
|
113
|
-
<li
|
|
125
|
+
<li
|
|
126
|
+
className="overflow-hidden rounded-xl border border-theme-border bg-theme-surface shadow-theme-sm"
|
|
127
|
+
style={{ contentVisibility: 'auto', containIntrinsicSize: 'auto 72px' }}
|
|
128
|
+
>
|
|
114
129
|
{/* The whole header is the single toggle target — chevron is just the
|
|
115
130
|
open/closed indicator, not a separate action. Deep-links live in the
|
|
116
131
|
expanded body (a link nested in a button would be invalid). */}
|
|
@@ -187,20 +202,27 @@ function IssueRow({
|
|
|
187
202
|
</span>
|
|
188
203
|
</div>
|
|
189
204
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
205
|
+
{renderDetails ? (
|
|
206
|
+
<div
|
|
207
|
+
className={`issue-details-motion ${open ? 'issue-details-motion-open' : ''}`}
|
|
208
|
+
onTransitionEnd={(event) => {
|
|
209
|
+
if (event.target !== event.currentTarget) return;
|
|
210
|
+
if (event.propertyName !== 'grid-template-rows') return;
|
|
211
|
+
if (!open) setRenderDetails(false);
|
|
212
|
+
}}
|
|
213
|
+
>
|
|
214
|
+
<div className="overflow-hidden">
|
|
215
|
+
<div className="border-t border-theme-border bg-theme-base/40 px-4 py-4 pl-11">
|
|
216
|
+
<div className="flex flex-col gap-4">
|
|
217
|
+
<Diagnosis issue={issue} />
|
|
218
|
+
<div className="border-t border-theme-border/70 pt-3">
|
|
219
|
+
<AffectedResources issue={issue} resourceHref={resourceHref} onResourceClick={onResourceClick} />
|
|
220
|
+
</div>
|
|
199
221
|
</div>
|
|
200
222
|
</div>
|
|
201
223
|
</div>
|
|
202
224
|
</div>
|
|
203
|
-
|
|
225
|
+
) : null}
|
|
204
226
|
</li>
|
|
205
227
|
);
|
|
206
228
|
}
|
package/src/theme/components.css
CHANGED
|
@@ -126,6 +126,25 @@
|
|
|
126
126
|
padding: 0.75rem;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
/* ── ISSUE ROW DETAILS ── */
|
|
130
|
+
|
|
131
|
+
.issue-details-motion {
|
|
132
|
+
display: grid;
|
|
133
|
+
grid-template-rows: 0fr;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
transition: grid-template-rows 200ms ease-out;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.issue-details-motion-open {
|
|
139
|
+
grid-template-rows: 1fr;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@starting-style {
|
|
143
|
+
.issue-details-motion-open {
|
|
144
|
+
grid-template-rows: 0fr;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
129
148
|
/* ── SUBTLE BORDERS ── */
|
|
130
149
|
|
|
131
150
|
.table-divide-subtle > * + * {
|