Skip to content

Conversation

@Vaibhav91one
Copy link
Contributor

@Vaibhav91one Vaibhav91one commented Nov 25, 2025

Closes issue: #3823

Summary of changes:

Root Cause:
The SplitPaneLayout component was using key={splitDirection} on the Split component, causing React to remount the entire component tree (including SchemaBuilder) when the panel position changed. This resulted in loss of internal state maintained by graphiql-explorer's Explorer component.

Solution:

  • Removed the key prop from the Split component to prevent unnecessary remounting
  • Added useEffect hook to handle direction changes dynamically while preserving component state
  • Improved horizontal scrolling for query input field with hidden scrollbar
  • Fixed flexbox height calculation in API client body

🎥 Demo Video:

requestly_overflow_issue.mp4

Files Changed:

  • app/src/componentsV2/BottomSheet/components/BottomSheetLayout/components/SplitPaneLayout/SplitPaneLayout.tsx

    • Removed key={splitDirection} prop to prevent remounting
    • Added useEffect for dynamic direction handling
  • app/src/features/apiClient/screens/apiClient/apiClient.scss

    • Changed .api-client-body height from calc(100% - 43px) to height: 100% for better flexbox handling
  • app/src/features/apiClient/screens/apiClient/components/views/graphql/components/SchemaBuilder/schemaBuilder.scss

    • Added horizontal scrolling with hidden scrollbar for query input form element
    • Added padding to toolbar button

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed state loss when switching split panel direction in the bottom sheet
    • Corrected height calculation for the API client interface body
  • Style

    • Added horizontal scrolling to the GraphQL schema builder editor for improved content visibility
    • Enhanced toolbar button spacing in the schema builder

✏️ Tip: You can customize this high-level summary in your review settings.

… toggling panel position between bottom and side, and improve horizontal scrolling UX.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 25, 2025

Walkthrough

This PR modifies three files to address layout and component state preservation issues. In SplitPaneLayout.tsx, a new effect is introduced to handle Split component size adjustments when splitDirection or placement changes, while the key={splitDirection} prop is removed from the Split component to prevent remounting. In apiClient.scss, the .api-client-body height is changed from calc(100% - 43px) to 100%. In schemaBuilder.scss, horizontal scrolling with hidden scrollbars is enabled for the variable editor area, and padding is reintroduced for toolbar buttons while an existing overflow rule is commented out.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • SplitPaneLayout.tsx effect logic: Verify the effect correctly handles size adjustments and that removing the key prop doesn't introduce unexpected state or rendering issues when direction changes
  • Height calculation change: Confirm the layout implications of changing from calc(100% - 43px) to 100% and ensure it doesn't break spacing or overflow behavior
  • Scrollbar and padding changes: Review whether hiding scrollbars and reintroducing padding achieve the intended UX without side effects on the editor layout

Possibly related issues

  • bug: Schema Builder issues in GraphQL view #3823: The changes directly address this issue by removing the key={splitDirection} prop to prevent child component remounting and preserve state, and by adding overflow handling in schemaBuilder.scss

Possibly related PRs

Suggested reviewers

  • nafees87n
  • nsrCodes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main changes: fixing checkbox state persistence in GraphQL Schema Builder when toggling panel position and improving horizontal scrolling UX.
Description check ✅ Passed The PR description includes all critical sections from the template: issue reference, comprehensive summary of changes with root cause analysis, demo video, and affected files with explanations. All required checklist items are not filled but this is typical for work-in-progress PRs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

Copy link
Contributor

@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 (2)
app/src/componentsV2/BottomSheet/components/BottomSheetLayout/components/SplitPaneLayout/SplitPaneLayout.tsx (1)

28-35: Direction-change effect looks correct; consider tightening dependencies / duplication

The new effect correctly re-applies split sizes when splitDirection / placement changes, which should avoid remounts and preserve child state as intended. A couple of small cleanups you might consider:

  • The logic in this effect duplicates the mount‑only effect above. You could unify into a single effect that depends on isSheetPlacedAtBottom (and optionally initialSizes) so the sizing logic lives in one place.
  • splitDirection is derived from isSheetPlacedAtBottom, so including both in the dependency array is redundant; depending on isSheetPlacedAtBottom (and initialSizes if you want to react to size changes) is sufficient.
  • Since initialSizes is an array prop, if callers pass a new array literal each render, this effect will run and call setSizes every render. That’s harmless but slightly noisy; if that’s a concern, you could either document that initialSizes should be memoized or drop it from deps and only recompute on placement changes.

Behaviorally this is fine; the above is just to keep the effect minimal and avoid unnecessary setSizes calls.

app/src/features/apiClient/screens/apiClient/components/views/graphql/components/SchemaBuilder/schemaBuilder.scss (1)

82-89: Hidden horizontal scrollbar UX/accessibility and overflow change look reasonable; verify cross‑platform behavior

The combination of:

  • overflow-x: auto; overflow-y: hidden; with scrollbar styles that fully hide the horizontal scrollbar on the variable editor title bar, and
  • Removing overflow: hidden !important from the second child under .graphiql-explorer-root

should improve horizontal scroll space and prevent content clipping, while keeping visuals clean.

Two minor points to double‑check:

  1. Discoverability & keyboard access – With scrollbars fully hidden, ensure users can still reliably discover and use horizontal scrolling (e.g., via trackpad, mouse wheel + Shift, keyboard) and that focus/keyboard navigation doesn’t get cut off for long variable names on common OS/browser combos (Chrome/Firefox/Edge on macOS/Windows).
  2. Layout in constrained heights – With the overflow: hidden removed, verify there’s no unexpected vertical overflow or double‑scrolling inside the GraphQL explorer when nested in the bottom sheet with minimal height.

The added padding: 0 12px on .toolbar-button aligns with the rest of the spacing and looks good.

Also applies to: 111-111, 220-221

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1fc1bf6 and 7e4e3e3.

📒 Files selected for processing (3)
  • app/src/componentsV2/BottomSheet/components/BottomSheetLayout/components/SplitPaneLayout/SplitPaneLayout.tsx (1 hunks)
  • app/src/features/apiClient/screens/apiClient/apiClient.scss (1 hunks)
  • app/src/features/apiClient/screens/apiClient/components/views/graphql/components/SchemaBuilder/schemaBuilder.scss (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: nafees87n
Repo: requestly/requestly PR: 3655
File: app/src/features/apiClient/screens/apiClient/components/views/components/Collection/components/CollectionRunnerView/components/RunResultView/RunResultContainer/RunResultContainer.tsx:426-426
Timestamp: 2025-10-10T11:08:23.369Z
Learning: In the file `app/src/features/apiClient/screens/apiClient/components/views/components/Collection/components/CollectionRunnerView/components/RunResultView/RunResultContainer/RunResultContainer.tsx`, the `destroyInactiveTabPane={true}` setting is intentional. The loss of state (expandedKeys, scroll position) when switching tabs is acceptable for now and will be addressed in future work.
📚 Learning: 2025-10-10T11:08:23.369Z
Learnt from: nafees87n
Repo: requestly/requestly PR: 3655
File: app/src/features/apiClient/screens/apiClient/components/views/components/Collection/components/CollectionRunnerView/components/RunResultView/RunResultContainer/RunResultContainer.tsx:426-426
Timestamp: 2025-10-10T11:08:23.369Z
Learning: In the file `app/src/features/apiClient/screens/apiClient/components/views/components/Collection/components/CollectionRunnerView/components/RunResultView/RunResultContainer/RunResultContainer.tsx`, the `destroyInactiveTabPane={true}` setting is intentional. The loss of state (expandedKeys, scroll position) when switching tabs is acceptable for now and will be addressed in future work.

Applied to files:

  • app/src/componentsV2/BottomSheet/components/BottomSheetLayout/components/SplitPaneLayout/SplitPaneLayout.tsx
🔇 Additional comments (1)
app/src/features/apiClient/screens/apiClient/apiClient.scss (1)

74-85: Confirm that switching to height: 100% doesn’t regress vertical layout in edge cases

Changing .api-client-body from a fixed offset (calc(100% - 43px)) to height: 100% with flex: auto should generally play nicer with flex layouts, but it also changes how space is distributed when headers/footers or bottom sheets are present. Please sanity‑check:

  • Small viewport heights (e.g., short laptop screens).
  • Cases where the bottom sheet is open and the GraphQL view is active.

Specifically verify that the tabs/content area doesn’t get clipped or overflow unexpectedly in those states.

@dinex-dev dinex-dev linked an issue Nov 28, 2025 that may be closed by this pull request
4 tasks
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.

bug: Schema Builder issues in GraphQL view

1 participant