Skip to content

fix(frontend): implement infinite scrolling for the font selection dropdown menu#17

Open
Jonathanthedeveloper wants to merge 1 commit into
akinloluwami:mainfrom
Jonathanthedeveloper:fix/font-infinite-scroll
Open

fix(frontend): implement infinite scrolling for the font selection dropdown menu#17
Jonathanthedeveloper wants to merge 1 commit into
akinloluwami:mainfrom
Jonathanthedeveloper:fix/font-infinite-scroll

Conversation

@Jonathanthedeveloper
Copy link
Copy Markdown

@Jonathanthedeveloper Jonathanthedeveloper commented Apr 28, 2026

Summary by cubic

Adds infinite scrolling to the font selection dropdown so users can browse all Google Fonts and all search matches without the 50-item cap. Loads more fonts as you scroll and resets cleanly on search or menu close.

  • New Features

    • Infinite scroll using an IntersectionObserver sentinel that loads items in small batches.
    • Spacer element preserves scroll height without rendering all items at once.
  • Bug Fixes

    • All search matches are now accessible (no truncation to the initial limit).
    • List resets on query or menu close, and dropdown placement stays in sync with the displayed count.

Written for commit 35091bd. Summary will update on new commits. Review in cubic

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

@Jonathanthedeveloper is attempting to deploy a commit to the Akinkunmi Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/src/components/text-format-toolbar.tsx">

<violation number="1" location="frontend/src/components/text-format-toolbar.tsx:116">
P2: IntersectionObserver effect misses sentinel remounts because `displayCount` is not in dependencies, which can break continued infinite loading.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

)
if (sentinelRef.current) observer.observe(sentinelRef.current)
return () => observer.disconnect()
}, [fontOpen, allFilteredFonts.length])
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 28, 2026

Choose a reason for hiding this comment

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

P2: IntersectionObserver effect misses sentinel remounts because displayCount is not in dependencies, which can break continued infinite loading.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/text-format-toolbar.tsx, line 116:

<comment>IntersectionObserver effect misses sentinel remounts because `displayCount` is not in dependencies, which can break continued infinite loading.</comment>

<file context>
@@ -82,22 +84,43 @@ export default function TextFormatToolbar({
+    )
+    if (sentinelRef.current) observer.observe(sentinelRef.current)
+    return () => observer.disconnect()
+  }, [fontOpen, allFilteredFonts.length])
+
+
</file context>
Suggested change
}, [fontOpen, allFilteredFonts.length])
}, [fontOpen, allFilteredFonts.length, displayCount])
Fix with Cubic

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