Skip to content

feat: add Finny visibility and access gating (closes #239) - #254

Merged
khanirfan18 merged 3 commits into
khanirfan18:mainfrom
hemag111:feat/239-finny-visibility-access-gating
Aug 12, 2026
Merged

feat: add Finny visibility and access gating (closes #239)#254
khanirfan18 merged 3 commits into
khanirfan18:mainfrom
hemag111:feat/239-finny-visibility-access-gating

Conversation

@hemag111

Copy link
Copy Markdown
Contributor

Closes #239

Changes

  • Finny launcher renders only when transactions.length > 5 (read from DataContext)
  • Unauthenticated users see only "Please sign in first to use Finny." — no chatbot mount, no Q&A flow, no AI requests
  • Mounted globally in Layout.jsx

Scope

Visibility + access control only, per issue — chatbot Q&A/AI integration left as placeholder for a future issue.

Testing

npm run lint and npm run build pass. Manually verified: hidden with ≤5 transactions, visible with >5, sign-in message shown when logged out, placeholder shown when logged in.

- Show Finny only when transactions.length > 5 (DataContext)
- Hide Finny entirely for 5 or fewer transactions
- Show sign-in prompt only for unauthenticated users, no chatbot logic runs
- Scoped to visibility/access control only
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

👷 Deploy request for finnboard0 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 52ba991

@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for finnboard ready!

Name Link
🔨 Latest commit 52ba991
🔍 Latest deploy log https://app.netlify.com/projects/finnboard/deploys/6a7b544fdbd41b0008e916c9
😎 Deploy Preview https://deploy-preview-254--finnboard.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@khanirfan18

Copy link
Copy Markdown
Owner

Thanks for the quick turnaround on this @hemag111 , looks good overall and the core gating logic matches the issue requirements.

Transaction check looks solid, (transactions?.length || 0) > 5 handles the boundary correctly and won't break if transactions is null or still loading.

One thing I want to double check before approving: right now the Finny trigger button shows up for any user with more than 5 transactions, even if they're logged out. Clicking it opens the panel and shows the sign in message, which technically satisfies "if opened, show the sign in message," but I want to confirm that's what we want vs hiding the entry point completely until the user is both authenticated and has enough transactions. Can you clarify which behavior was intended?

A couple smaller things, not blockers:

The modal doesn't close on Escape and there's no focus trap, might be worth a follow up a11y pass later.

No tests were added for the gating logic. Since this is exactly the kind of thing that can silently regress, a quick test for the 5 vs 6 transaction boundary and the logged out branch would give us more confidence.

Also just a nit, MIN_TRANSACTIONS_TO_SHOW is only defined in Finny.jsx right now. Fine for a single use case, but if FinnyPanel or anything else ever needs that same threshold we should move it to a shared constants file so they don't drift apart.

Nice work overall, just want clarity on the auth vs visibility question before merging.

@hemag111

Copy link
Copy Markdown
Contributor Author

Good question — I intentionally kept the button visible whenever transactions.length > 5, regardless of auth state, and gated the content on open rather than the entry point itself. That was based on this line in the issue: "If a user is not signed in and Finny is opened/triggered... display a simple message" — which implies the trigger is reachable while logged out, otherwise that flow couldn't happen. Happy to switch to fully hiding it for logged-out users if you'd prefer that instead — just let me know which you want and I'll update it.

For the other points:

  • Will add Escape-to-close and a basic focus trap on the modal.
  • Will add tests for the 5/6 boundary and the logged-out branch.
  • Will pull MIN_TRANSACTIONS_TO_SHOW into a shared constants file.

@khanirfan18

Copy link
Copy Markdown
Owner

@hemag111 Thanks for explaining the reasoning, that makes sense and matches the issue text, so let's keep the trigger visible for anyone with >5 transactions regardless of auth state.
One tweak on the sign-in message though: instead of just showing plain text "Please sign in first to use Finny," let's make it actionable, add a button/link in there that takes the user to the sign in or sign up page. Right now it's a dead end, the user sees the message but has no way to act on it from that panel.

Everything else sounds good, go ahead with the Escape-to-close, focus trap, tests, and shared constants file as planned.

- Extract gating logic into src/lib/finnyGating.js (shouldShowFinny, isFinnyAuthorized) for testability
- Move MIN_TRANSACTIONS_TO_SHOW into shared src/lib/finnyConstants.js
- Add Escape-to-close and basic focus handling to FinnyPanel
- Add tests for transaction boundary (5 vs 6) and auth gating
@hemag111

Copy link
Copy Markdown
Contributor Author

@khanirfan18 Thanks ,I’ve pushed the follow-up change.

The logged-out Finny panel now has actionable Sign in and Sign up links, while keeping the trigger visible for users with more than 5 transactions as discussed.

The previous tests and production build passed successfully.

@khanirfan18
khanirfan18 merged commit d67673a into khanirfan18:main Aug 12, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

hey @hemag111, really glad you took the time to contribute! your first PR just got merged and that genuinely means a lot to us 🎉

hope this is just the beginning. feel free to pick up more issues whenever you're up for it, and if you're enjoying the project a ⭐ on the repo would be awesome

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Finny, FinBoard’s chatbot visibility and access gating

2 participants