Skip to content

Conversation

@ENvironmentSet
Copy link
Collaborator

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Aug 22, 2025

🦋 Changeset detected

Latest commit: 29e0c21

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackflow/plugin-basic-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Aug 22, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Fixed AppScreen scrolling by targeting the inner content, ensuring scroll-to-top and in-app scroll controls behave reliably within content.
    • Improves consistency across layouts and nested content areas.
    • No changes to public APIs; existing integrations continue to work without modification.

Walkthrough

Shifts scroll operations from the outer paper container to a new inner content container ref (paperContentRef), updates handlers and the AppScreen context to use it, and moves the ref assignment to an inner wrapper around children. Public API, props, and exported signatures remain unchanged.

Changes

Cohort / File(s) Summary
UI scroll target refactor
extensions/plugin-basic-ui/src/components/AppScreen.tsx
Added paperContentRef; updated onTopClick and context scroll function to use the inner content ref; memoized context value now depends on paperContentRef; moved ref from outer wrapper to new inner content div around children.
Release notes / changeset
.changeset/stupid-heads-refuse.md
Added changeset entry documenting a patch release fixing AppScreen scroll behavior by attaching refs on paperContent.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant AS as AppScreen
  participant Ctx as AppScreen Context
  participant IC as Inner Content (paperContentRef)

  U->>AS: Click "Top" / call scrollToTop()
  AS->>Ctx: invoke context scroll function
  Ctx->>IC: scrollTo({ top: 0 })
  Note right of IC #DDEBF7: Scroll target changed to inner content element (paperContentRef)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6f951ca and 29e0c21.

📒 Files selected for processing (1)
  • .changeset/stupid-heads-refuse.md (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-appscreen-scroll

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ENvironmentSet ENvironmentSet enabled auto-merge (squash) August 22, 2025 14:29
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 22, 2025

Deploying stackflow-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29e0c21
Status:⚡️  Build in progress...

View logs

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 22, 2025

@stackflow/demo

yarn add https://pkg.pr.new/@stackflow/[email protected]

commit: 29e0c21

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 22, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
stackflow-docs 29e0c21 Commit Preview URL Aug 22 2025, 02:38 PM

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
extensions/plugin-basic-ui/src/components/AppScreen.tsx (5)

78-78: Good ref split; verify paper content is the actual scroll container.

Adding a dedicated paperContentRef is a clean fix to decouple transform/motion on paperRef from scroll. Please double-check css.paperContent sets scrolling semantics (overflow and sizing), otherwise the new scroll target will be inert on some layouts.

If not already defined, consider the following in AppScreen.css:

.paperContent {
  overflow: auto;
  /* Ensures the inner container spans the available viewport area */
  block-size: 100%;
  /* Mobile momentum scrolling */
  -webkit-overflow-scrolling: touch;
  /* Prevent scroll chaining during swipe-back */
  overscroll-behavior: contain;
}

205-208: Respect prefers-reduced-motion and add a safe fallback target.

Small UX/accessibility improvement and resilience if paperContentRef is null or non-scrollable at runtime.

Apply this diff:

-      paperContentRef.current?.scroll({
-        top: 0,
-        behavior: "smooth",
-      });
+      const $el = paperContentRef.current ?? paperRef.current;
+      if ($el) {
+        const prefersReducedMotion =
+          typeof window !== "undefined" &&
+          window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches;
+        $el.scroll({
+          top: 0,
+          behavior: prefersReducedMotion ? "auto" : "smooth",
+        });
+      }

221-225: Mirror reduced-motion handling in the public scroll API and add fallback.

Keeps context scrolling behavior consistent with the AppBar handler and avoids no-ops when the inner ref isn’t ready.

Apply this diff:

-            paperContentRef?.current?.scroll({
-              top,
-              behavior: "smooth",
-            });
+            const $el = paperContentRef.current ?? paperRef.current;
+            if ($el) {
+              const prefersReducedMotion =
+                typeof window !== "undefined" &&
+                window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches;
+              $el.scroll({
+                top,
+                behavior: prefersReducedMotion ? "auto" : "smooth",
+              });
+            }

233-234: Nit: remove stable ref object from deps.

paperContentRef object identity is stable; including it in useMemo deps is unnecessary noise.

Apply this diff:

-        [paperContentRef, zIndexDim, zIndexPaper, zIndexEdge, zIndexAppBar],
+        [zIndexDim, zIndexPaper, zIndexEdge, zIndexAppBar],

298-304: Expose paper content as a named part and make it optionally focusable.

  • Adding data-part aligns with other elements (paper, edge) and helps testing/diagnostics.
  • Optional tabIndex={-1} can help programmatically moving focus into the scroll region when needed (e.g., after navigation).

Apply this diff:

-          <div
-            ref={paperContentRef}
-            className={css.paperContent({ hasAppBar })}
-          >
+          <div
+            ref={paperContentRef}
+            className={css.paperContent({ hasAppBar })}
+            data-part="paperContent"
+            tabIndex={-1}
+          >
             {children}
           </div>
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 51ffe5c and 6f951ca.

📒 Files selected for processing (1)
  • extensions/plugin-basic-ui/src/components/AppScreen.tsx (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build all packages
  • GitHub Check: Create PR or release packages
  • GitHub Check: Check the TypeScript typings
  • GitHub Check: Check whether the written test passes normally
  • GitHub Check: Workers Builds: stackflow-docs

@ENvironmentSet ENvironmentSet merged commit 733ebcb into main Aug 22, 2025
5 of 8 checks passed
@ENvironmentSet ENvironmentSet deleted the fix-appscreen-scroll branch August 22, 2025 14:33
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