Skip to content

Fix Claude hook config and add JSX component CALLS edges#154

Open
GrimoireScribe wants to merge 1 commit intotirth8205:mainfrom
GrimoireScribe:fix/claude-hooks-jsx-calls
Open

Fix Claude hook config and add JSX component CALLS edges#154
GrimoireScribe wants to merge 1 commit intotirth8205:mainfrom
GrimoireScribe:fix/claude-hooks-jsx-calls

Conversation

@GrimoireScribe
Copy link
Copy Markdown

Summary

This PR does two things:

  1. Fixes Claude Code install/config issues:
  • removes invalid PreCommit hook generation
  • changes PostToolUse to code-review-graph update --skip-flows
  • makes generated Claude/settings/skill file reads and writes explicit UTF-8 for Windows safety
  1. Improves React/TSX graph coverage:
  • emits synthetic CALLS edges for JSX component invocations
  • supports plain component tags like <MarkdownMsg />
  • supports namespace/member usage like <UI.MarkdownMsg />
  • supports nested member chains like <UI.Messages.MarkdownMsg />
  • verifies behavior through parser tests, query_graph callers_of, and impact-radius tests

Why

React codebases often invoke components through JSX instead of normal function-call syntax. Before this PR, those usages produced no CALLS edges, which meant:

  • callers_of could miss component call sites entirely
  • impact radius under-reported React caller relationships
  • flow/impact analysis was weak for component migration work

Separately, Claude Code hook generation was out of sync with valid hook events, and Windows installs could fail on Unicode content due to default-encoding file writes.

Behavioral notes

Current JSX support is intentionally scoped:

  • component-like tags are identified by uppercase names
  • intrinsic DOM tags like <div> are ignored
  • namespace imports can resolve JSX member expressions to module files
  • unresolved member-style components still degrade gracefully

This improves React caller tracing a lot without trying to solve full React semantic analysis in one PR.

Verification

Ran:

uv run --extra dev pytest tests\test_skills.py tests\test_parser.py tests\test_tools.py -q
uv run --extra dev ruff check tests\test_tools.py tests\test_parser.py code_review_graph\parser.py

Copy link
Copy Markdown
Owner

@tirth8205 tirth8205 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bundles two distinct features: (a) hook schema fixes and (b) JSX/TSX component CALLS edges.

The hook fixes overlap with PR #141 and #152 (both already merged/in progress). The JSX parsing piece is unique and valuable — good test coverage and +285 lines to parser.py.

Could you rebase on latest main and consider splitting the JSX CALLS feature into its own PR? The hook fixes are being handled separately. The JSX work stands on its own merit and we'd be happy to merge it.

@GrimoireScribe GrimoireScribe force-pushed the fix/claude-hooks-jsx-calls branch from 495c97a to 4220626 Compare April 9, 2026 16:03
@GrimoireScribe
Copy link
Copy Markdown
Author

Thanks — I rebased the branch on latest main and force-pushed a JSX-only version of the PR branch.

I removed the overlapping hook/config changes and kept only the JSX component CALLS work plus the parser tests/fixture, so the branch is now focused on the React/TSX caller-tracing feature.

@GrimoireScribe
Copy link
Copy Markdown
Author

Thanks — I rebased the branch on latest main and force-pushed a JSX-only version of the PR branch.

I removed the overlapping hook/config changes and kept only the JSX component CALLS work plus the parser tests/fixture, so the branch is now focused on the React/TSX caller-tracing feature.

I also verified it locally against a real React component (MarkdownMsg) after rebuilding the graph. The JSX caller tracing is working end to end now. Two follow-up behaviors showed up outside this PR's scope: tests_for needs a query-side fix for TESTED_BY direction/fallbacks, and bare-name resolution benefits from preferring the component/function node over matching test nodes. I fixed those separately on my internal branch and can send them as a separate PR if useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants