Skip to content

fix(example-apps): clear eslint issues in dashproof-lab and dashmint-lab#79

Merged
thephez merged 1 commit into
mainfrom
fix/example-apps-lint
May 12, 2026
Merged

fix(example-apps): clear eslint issues in dashproof-lab and dashmint-lab#79
thephez merged 1 commit into
mainfrom
fix/example-apps-lint

Conversation

@thephez
Copy link
Copy Markdown
Collaborator

@thephez thephez commented May 12, 2026

Summary

  • dashproof-lab — Add coverage to ESLint globalIgnores (matches dashnote), replace HistoryPanel's prop-watching useEffect with the React-recommended "reset state during render" pattern to fix react-hooks/set-state-in-effect, and add two regression tests for the chain deep-link path.
  • dashmint-lab — Rename the Playwright fixture-API callback parameter from use to provide so eslint-plugin-react-hooks v6 stops flagging await use(page) as a misplaced React Hook call.

Notes

  • The HistoryPanel change also fixes a subtle latent bug: the new prevRequestToken is initialized to undefined (not to requestToken) so the panel still fires its reset on first render — the parent mounts a fresh panel with the token already bumped, so a same-value initializer would silently swallow the dispatch.
  • Root-level npm run lint (tsc) errors in setupDashClient.mjs are intentionally out of scope for this PR.

Test plan

  • cd example-apps/dashproof-lab && npm run lint — zero errors and warnings
  • cd example-apps/dashproof-lab && npm run test — 139/139 pass (was 137; two new regression tests)
  • cd example-apps/dashproof-lab && npm run build — clean
  • cd example-apps/dashmint-lab && npm run lint — zero errors
  • cd example-apps/dashmint-lab && npm run test — 88/88 pass
  • cd example-apps/dashmint-lab && npm run build — clean
  • e2e: cd example-apps/dashproof-lab && npm run test:e2e — manual run if you want to confirm the "View chain history" deep link still works against testnet

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved history panel state synchronization when switching tokens or chains.
    • Fixed user input preservation in history panel interactions.
  • Tests

    • Added test coverage for history panel chain mode behavior.

Review Change Stack

dashproof-lab:
- Add "coverage" to globalIgnores so Vitest coverage HTML reporter scripts
  stop triggering unused-disable warnings (matches dashnote).
- Replace HistoryPanel's prop-watching useEffect with the React-recommended
  "reset state during render" pattern, fixing react-hooks/set-state-in-effect.
  Initialize prevRequestToken to undefined so the panel still fires on its
  first render (the parent mounts it fresh with the token already bumped).
- Add regression tests covering the parent-dispatched chain deep-link and
  the fire-once-per-token invariant.

dashmint-lab:
- Rename the Playwright fixture-API second-arg callback parameter from
  `use` to `provide` (matching dashproof-lab's convention) so that
  eslint-plugin-react-hooks v6 stops flagging `await use(page)` as a
  misplaced React Hook call.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea5eedba-6d01-4155-acb7-d5d4c21d9170

📥 Commits

Reviewing files that changed from the base of the PR and between ee6e71a and 66f326d.

📒 Files selected for processing (4)
  • example-apps/dashmint-lab/test/e2e/fixtures.ts
  • example-apps/dashproof-lab/eslint.config.js
  • example-apps/dashproof-lab/src/components/HistoryPanel.tsx
  • example-apps/dashproof-lab/test/HistoryPanel.test.tsx

📝 Walkthrough

Walkthrough

This PR refactors the Dashmint-lab Playwright fixture to use the provide pattern and moves HistoryPanel state reset from a useEffect hook to render-time detection based on requestToken changes. Two new tests validate the refactored behavior, and ESLint configuration is updated to ignore the coverage directory.

Changes

Dashmint-lab Playwright fixture update

Layer / File(s) Summary
Playwright fixture provide pattern
example-apps/dashmint-lab/test/e2e/fixtures.ts
Fixture setup callback changed from use(page) to provide(page) while maintaining navigation, SDK connection wait with 60-second timeout, and test control handoff.

Dashproof-lab HistoryPanel state reset refactor

Layer / File(s) Summary
Render-time state reset mechanism
example-apps/dashproof-lab/src/components/HistoryPanel.tsx
HistoryPanel adds prevRequestToken state tracking and moves reset logic to render time. When requestToken changes and requestedChainId is present, the component switches to chain mode, updates chain-related state, and clears anchors and error state. Prior useEffect performing the same reset is removed.
Token change behavior tests and ESLint config
example-apps/dashproof-lab/eslint.config.js, example-apps/dashproof-lab/test/HistoryPanel.test.tsx
Two test cases verify HistoryPanel correctly responds to requestToken changes by loading the requested chain and updating UI, and preserves user edits when requestToken remains unchanged. ESLint configuration adds coverage directory to the ignore list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 The fixtures now provide their pages so clean,
While tokens reshape state in between,
Tests guard the behavior, old effects are freed,
A render-time dance for each chain-mode need!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main changes in the pull request, which focus on clearing ESLint issues across both dashproof-lab and dashmint-lab example apps.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/example-apps-lint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thephez thephez merged commit 254da27 into main May 12, 2026
3 checks passed
@thephez thephez deleted the fix/example-apps-lint branch May 12, 2026 18:04
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.

1 participant