Repository navigation
style(ui): format ui/src with prettier and check it in CI - #522
Merged
Merged
Conversation
`prettier --check src/` failed on 31 files: formatting had drifted with no check to catch it, and eslint-config-prettier switches ESLint's style rules off, so nothing else would. All files are reformatted with the repository's own .prettierrc (no config change), and the UI job gains a Prettier step (`bun run format:check`) after ESLint. Whitespace and wrapping only: lint, typecheck, the 119 vitest tests and the build all pass after the reformat. Follow-up to #517. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uv6LUrB5HCQcqBvmcixYn3
Contributor
There was a problem hiding this comment.
Code Review
This pull request primarily applies code formatting and style updates across the UI codebase, standardizing on double quotes and consistent line wrapping. The review feedback identifies a timing issue in both useLayoutComputation.ts and useFlowNavigation.ts where fitView is called synchronously immediately after updating the graph state. To ensure the viewport is calculated correctly after React Flow has completed rendering and measuring the new layout, it is recommended to wrap these fitView calls in requestAnimationFrame.
|
3 tasks done
zaebee
added a commit
that referenced
this pull request
Oct 1, 2026
Both fitView calls ran synchronously after the store update that replaces the nodes (setLayout / setFlow). React Flow had not rendered or measured the new nodes yet, so the fit was computed against the previous view. Both are now deferred to the next animation frame. Measured in Chromium (Playwright) on the bundled graph.json, 3 runs each: - clicking a node into flow view: main fits 2 of 95 nodes, zoomed to the 2x cap on the clicked node; with the fix all 95 are in view. - initial load: all 94 nodes in view either way, but the fix fits them tighter (scale 0.197 -> 0.257), the old fit having included stale bounds. No console errors in either. useFlowNavigation.test.ts pinned the synchronous call; it now asserts that fitView is not called in the same tick and is called, with the same options, once the frame runs. It fails against the old hook. Found by gemini-code-assist on #522, where it was out of scope for a formatting-only change. Claude-Session: https://claude.ai/code/session_01Uv6LUrB5HCQcqBvmcixYn3 Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Follow-up to #517, which left this out of scope.
Problem
bun run format:check(prettier --check src/) failed on 31 files inui/. Formatting had drifted with nothing to catch it.eslint-config-prettierswitches ESLint's style rules off, so neither ESLint nor any CI step reports it.What changes
bun run format. This uses the repository's ownui/.prettierrc; the config is unchanged. The diff is whitespace and wrapping only (+975 / −820), and there are no hand edits.Prettier→bun run format:check, after ESLint. Without it formatting would drift again.Review tip
Hide whitespace changes in the diff view (
?w=1). Nothing should remain except lines that prettier rewrapped.Test plan
bun run format:checkpasses (was: 31 files).bun run lint,bun run typecheck,bun run test:run(14 files, 119 tests) andbun run buildall exit 0 after the reformat.actionlintclean onui.yml.ui/**).🤖 Generated with Claude Code
https://claude.ai/code/session_01Uv6LUrB5HCQcqBvmcixYn3
Generated by Claude Code