Repository navigation
fix(frontend): pass an explicit initial value to useRef so tsc passes on React 18 and 19 types - #344
Conversation
… on React 18 and 19 types React 19's @types/react makes the argument of useRef required, so useRef<number>() in TreeView.tsx fails with TS2554 (Dependabot #332). useRef<number | undefined>(undefined) typechecks on both 18 and 19 and keeps the same runtime behaviour. No other argument-less useRef in src. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDiW8qD4f2JDQJ4buGo
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDiW8qD4f2JDQJ4buGo
SonarCloud rule githubactions:S7679 flags $1 used directly in result and relevant. Each is now assigned to a named local. No change in behaviour: the gate's decision logic was re-run locally over seven cases (all success, a failure, a cancellation, designed skips, skips with a failed detector, a skip the detector did not allow, and mixed relevance) with the same exit codes as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDiW8qD4f2JDQJ4buGo
|
…ipt 7 together (#347) ## Change and reason One change: the pending frontend upgrades applied together, replacing five stale Dependabot PRs whose branches keep failing the branch-freshness rule. Supersedes Dependabot PRs 332, 333, 334, 335 and 336 (they are not closed by this PR). | Package | Before | After | |---|---|---| | vite | ^6.4.5 | ^8.3.7 (locked 8.3.7) | | @vitejs/plugin-react | ^4.3.4 | ^6.3.0 | | typescript | ^5.7.2 | ^7.0.2 | | react-router-dom | ^6.30.6 | ^7.18.5 | | react | ^18.3.1 | ^19.3.1 | | react-dom | ^18.3.1 | ^19.3.1 (Dependabot's react PR left it on 18, a runtime mismatch) | | @types/react | ^18.3.18 | ^19.3.0 | | @types/react-dom | ^18.3.5 | ^19.3.0 | Source changes: none were needed. `frontend/vite.config.ts` already used the function form of `manualChunks` and `useRef` already passes an explicit initial value (#344). Only `frontend/package.json` and `frontend/bun.lock` change. The lockfile change is needed because these are dependency upgrades; it was regenerated with Bun 1.4.4. No test or config pins the old frontend versions (grepped `test/`, `config/`, `scripts/`, `.github/`). ## Validation Bun 1.4.4, run in `frontend/` from a clean `node_modules` with `bun install --frozen-lockfile --ignore-scripts`. | Check | Baseline (main) | After | |---|---|---| | build (`tsc && vite build`) | pass | pass (Vite 8.3.7, 354 modules) | | typecheck | pass | pass (TypeScript 7.0.2) | | unit tests (`bun test src`) | 90 pass, 0 fail | 90 pass, 0 fail | | `scripts/lint-sonar-reliability.sh` | not run | OK, no S2871 or S7758 findings | Runtime smoke test (headless Chromium via Playwright, built `dist` served with SPA fallback, API requests answered 503): 15 routes visited by URL and 4 reached by clicking links. | | Baseline | After | |---|---|---| | page errors | 0 | 0 | | console errors (non-API) | 0 | 0 | | routes with non-empty rendered content | 15 of 15 | 15 of 15, same final paths and same text length on every route | | click navigation (/studies, /jobs, /databases, /config) | same | same | | expected API failures (503) | 191 | 194 (polling timing jitter; all to /api or /files) | NOT RUN: the Julia and R test suites locally, and `check-pr-freshness.sh` (the clone is shallow and the script refuses: "shallow clone; check out with fetch-depth: 0"). By hand, the merge base of HEAD and origin/main equals origin/main (e4e39aa), and the branch has one commit and no merge commits. ## Scope Left out: any source refactor, `.github/dependabot.yml`, and CONTRIBUTING.md. Its "Settled decisions" section still says "React 18"; the owner decides whether to update it. ## Contribution checks - [x] I followed [CONTRIBUTING.md](../CONTRIBUTING.md). - [x] This branch starts at current upstream main and contains no merges from fork main (checked by hand; the script could not run on the shallow clone). - [ ] CI has run and passes (pending). - [x] Existing licensing, citation and acknowledgement text is unchanged. --- _Generated by [Claude Code](https://claude.ai/code/session_01J4QvDiW8qD4f2JDQJ4buGo)_ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Frontend guidance now reflects React 19 while retaining the documented choices for TypeScript, Vite, bun, and the frontend project location. * **User-Facing Changes** * No changes to app features or behavior are described in this update. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <noreply@anthropic.com>



Change and reason
Dependabot's React bump (#332, react 18.3.1 to 19.3.1, @types/react 19.3.0) fails
tsc && vite buildwith:React 19's types make the
useRefargument required.useRef<number>()inTreeView.tsx(two places:saveTimer,scrollTimer) becomesuseRef<number | undefined>(undefined), which typechecks on React 18 and 19 types and behaves the same at runtime. A search offrontend/srcfound no other argument-lessuseRef/createRef. Same forward-compatible preparation as #342 and #343.Validation
Bun 1.4.4,
bun install --frozen-lockfile --ignore-scripts, infrontend/:bun run buildpasses,bun run typecheckpasses,bun test src90 pass / 0 fail.built in 34.45s), typecheck passes, 90 pass / 0 fail.tscreproduces exactly the two TS2554 errors above; tests 90 pass / 0 fail.bun run buildpasses (built in 20.22s), tests 90 pass / 0 fail.Not run: Julia and R jobs (this change touches one frontend file); CI on this PR covers them.
scripts/lint-sonar-reliability.shand SonarCloud were not run locally.Scope
One file, two lines. No
package.jsonor lockfile change; the React bump itself stays in #332.Contribution checks
Generated by Claude Code
CI/gate
The account ruleset "Branch-Floor" requires a status check named exactly
CI/gate; this repository never emitted it. Commit 6ca65cc adds one job to.github/workflows/ci.yml: idci-status,name: CI/gate,needsall seven other jobs (denominator 7),if: always(),permissions: {}, purerun:shell (nouses:, nothing new to pin). No trigger, path filter, existing job or check name was changed. The branch still starts at the tip of origin/main (6bb2ad2) with no merge commits; no rebase was needed.Rules, from the
if:conditions in the file:gateandoccupancy_gate(detectors) must besuccess.test,standards,agdaare governed bygate:successwhengatesucceeded withrelevant == 'true',skippedonly whengatesucceeded withrelevant == 'false'.occupancy,disagreementare governed byoccupancy_gatein the same way.failure,cancelled, empty or unknown results exit 1.$GITHUB_STEP_SUMMARY.Local evidence (decision script extracted from the YAML, run with
NEEDS_JSONset by hand;jq):gatefailed: exit 1gateskipped: exit 1weird: exit 1needs: exit 1YAML parsed with Bun's YAML parser: the new job's name, needs and the unchanged
on:block were read back correctly.NOT RUN: the repository's Julia test
test/unit/test_install_pins.jl(no Julia here; by reading it,CI/gatehas no${{and no matrix, so it should hold),actionlint(not installed).Summary by CodeRabbit