Uh oh!
There was an error while loading. Please reload this page.
fix: template mobile-nav set-state-in-effect + lint-staged unmatched-pattern - #539
Merged
Merged
Conversation
oxlint/oxfmt exit non-zero on an all-ignored fileset ("No files found to
lint"), so any commit touching only files under template/, generated
outputs, etc. failed pre-commit. The former Biome command used
--no-errors-on-unmatched; restore that behavior with
--no-error-on-unmatched-pattern on the oxlint and oxfmt lint-staged steps.
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>… nav
The mobile-nav Sheet reset its open state inside a useEffect keyed on
isMobile, which eslint-plugin-react-hooks v7 flags as set-state-in-effect.
Derive the open prop instead (open={mobileNavOpen && isMobile}) so the
portaled Radix sheet can't linger on desktop, and drop the effect. Radix
fires onOpenChange(false) when open goes false, so state stays in sync.
Verified on a freshly scaffolded app: eslint clean, typecheck passes,
vite build succeeds. Latent since #391; CI never lints the template or a
scaffolded app, so it went unnoticed until a fresh scaffold was linted.
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>Contributor
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 32119194591 -R databricks/appkit -n appkit-template-0.61.1-pr.9fb8285-fix-template-mobile-nav-set-state-in-effect-539 -D appkit-pr-539 \
&& unzip -o "appkit-pr-539/appkit-template-0.61.1-pr.9fb8285-fix-template-mobile-nav-set-state-in-effect-539.zip" -d "appkit-pr-539" \
&& databricks apps init --template "appkit-pr-539"The template pins |
MarioCadenas
enabled auto-merge (squash)
August 18, 2026 09:28
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
What
Two small lint-correctness fixes, both surfaced while regression-testing the Biome→oxc migration (#538) by scaffolding and linting a fresh app:
template/client/src/App.tsx— the mobile-navSheetreset its open state inside auseEffectkeyed onisMobile, whicheslint-plugin-react-hooksv7 flags asreact-hooks/set-state-in-effect. Fixed by deriving the open prop (open={mobileNavOpen && isMobile}) and dropping the effect.package.jsonlint-staged — restore--no-errors-on-unmatchedbehavior (lost in the oxc migration) so commits touching only oxc-ignored files don't fail pre-commit.Why
App.tsx: This eslint error has been latent since the responsive-nav change (feat: improve template and component responsiveness #391) —
eslint-plugin-react-hookshas been v7 (which addedset-state-in-effect) since the template was created. It went unnoticed because CI never lints the template or a scaffolded app. The fix follows React's recommended pattern (compute during render instead of resetting state in an effect):Behavior is preserved: on desktop the portaled Radix sheet is forced closed; on mobile the toggle works; a mobile→desktop resize closes it and Radix fires
onOpenChange(false), keeping state in sync — no effect needed.lint-staged:
oxlint/oxfmtexit non-zero on an all-ignored fileset ("No files found to lint"). The pre-oxc Biome command used--no-errors-on-unmatched; this restores that via--no-error-on-unmatched-patternon both tools.Verification
On a freshly scaffolded app (
databricks apps initfrom the template):eslint .→ 0 problems (was 1 error)tsc -b(server + client) → passesvite build→ succeedsNot fixed here (follow-up)
The root gap is that CI doesn't lint the template or a scaffolded app, so this class of error stays invisible. A CI step that scaffolds an app and runs
npm run lintwould catch it going forward — happy to do that separately.