You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(console,runner): render the approvals inbox against one ticking clock, and lint both packages (#2927) (#2930)
`apps/console` and `packages/runner` had no `lint` script, so `turbo run lint`
skipped them silently and their 17 ESLint errors had never been seen. Both now
carry `"lint": "eslint ."`, and the `DEBT` list in check-lint-coverage.mjs is
empty — 45/45 workspace packages are linted.
Read one by one, the 17 were not one class of problem:
8x react-hooks/purity — real. The approvals inbox read `Date.now()` mid-render
for every age tint, "5m ago" label and SLA chip. Render must be pure: the output
depended on when React happened to render, so it disagreed with itself under
StrictMode's double render and then froze — an inbox left open kept saying "just
now" and an SLA countdown never counted down. The page now renders against a
single `now` held in state and advanced once a minute (the finest granularity it
displays), so render is a pure function of props+state and the figures tick.
`sla_due_at` also goes through a parse guard now: a due date the backend sends in
a shape `Date.parse` can't read rendered as "SLA NaNh left"; it renders nothing.
1x react-hooks/static-components — real. `StatusBadge` was declared inside
`ApprovalsInboxPage`, so it was a brand-new component type every render and React
remounted every status chip in the table on each re-render. Hoisted to module
scope with the translated label passed as a prop.
6x react-hooks/static-components — false positives (3 settings pages, 3 in the
runner's LayoutRenderer). All six render the result of `getIcon`/`getLazyIcon`,
which memoises per name in a module-level cache: the reference is stable and
nothing is created during render. They carry the same targeted disable +
justification the repo already uses at a dozen icon-registry sites, and both
resolvers now document the cache. Verified rather than assumed — typing into a
settings field keeps focus and every character, so nothing was being reset.
2 minor — a dead `token` initializer on the auth-preflight path (read, not blind
-deleted: no intended write was missing) and a `prefer-const`.
Closes#2927. Refs #2911, #2923.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: apps/console/src/pages/settings/SettingsHub.tsx
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ function SettingCard({ m, onOpen }: { m: SettingsManifest; onOpen: () => void })
43
43
>
44
44
<CardHeaderclassName="pb-3">
45
45
<divclassName="flex items-start justify-between">
46
+
{/* eslint-disable-next-line react-hooks/static-components -- getIcon returns a module-cached stable component per name, not one created during render */}
0 commit comments