Skip to content

Fix GraphQL request detection on response click#13

Merged
amrelsagaei merged 3 commits intomainfrom
ae-issue-12
Apr 13, 2026
Merged

Fix GraphQL request detection on response click#13
amrelsagaei merged 3 commits intomainfrom
ae-issue-12

Conversation

@amrelsagaei
Copy link
Copy Markdown
Collaborator

@amrelsagaei amrelsagaei commented Mar 28, 2026

This Fixes #12

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved handling of raw response content display in GraphQL view mode to correctly distinguish between HTTP responses and regular content types.

@amrelsagaei amrelsagaei requested a review from f8thl3ss March 28, 2026 16:18
Comment thread packages/frontend/src/views/GraphQLViewMode.vue Outdated
Comment thread packages/frontend/src/views/GraphQLViewMode.vue Outdated
Comment thread packages/frontend/src/views/GraphQLViewMode.vue Outdated
@amrelsagaei
Copy link
Copy Markdown
Collaborator Author

@f8thl3ss dropping the cache RequestFull doesn't have a method property and props.request?.raw always returns the original request, not the user's edits. In replay, the editor is the source of truth since users can edit the GraphQL query/variables from the view mode and save changes back to the replay request. When the active editor switches to the response pane, we fall back to cachedEditorView (already existed for saveChanges) to keep reading from the request editor. This avoids losing edits without introducing any new caching mechanism.

@amrelsagaei amrelsagaei requested a review from f8thl3ss April 2, 2026 15:07
Comment thread packages/frontend/src/views/GraphQLViewMode.vue Outdated
@amrelsagaei amrelsagaei requested a review from f8thl3ss April 10, 2026 12:52
@amrelsagaei
Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 13, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

Added a validation task to the build configuration that runs multiple checks sequentially. Fixed a bug in GraphQL view mode where response content was incorrectly treated as request content by introducing a filter to distinguish HTTP responses from raw editor text.

Changes

Cohort / File(s) Summary
Build Configuration
.mise/config.toml
Added new validate task that executes pnpm install, typecheck, lint, test, and knip commands in sequence.
GraphQL View Bug Fix
packages/frontend/src/views/GraphQLViewMode.vue
Introduced isResponseContent() helper to detect HTTP responses. Modified getRawData() to exclude content matching HTTP response patterns, preventing response text from being misidentified as request content.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A validate task hops into place,
While GraphQL bugs vanish without a trace,
Response from request, now clearly apart—
The view mode works right from the start! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The .mise/config.toml addition introduces a new validation task unrelated to the GraphQL bug fix, representing out-of-scope work beyond the stated objectives of fixing issue #12. Consider moving the .mise/config.toml changes to a separate PR focused on CI/validation infrastructure, keeping this PR focused solely on the GraphQL request detection fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main fix: addressing GraphQL request detection when the response pane is clicked, which is the core issue being resolved.
Linked Issues check ✅ Passed The PR successfully fixes the reported bug by detecting HTTP response content and preserving request editor state when focus switches to the response pane, directly addressing issue #12's requirement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ae-issue-12

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/frontend/src/views/GraphQLViewMode.vue`:
- Around line 82-85: Replace the unreliable content-based isResponseContent
check with an editor-type check: call window.getActiveEditor() and use
instanceof (or a type guard) to detect if the active editor is an
HTTPResponseEditor vs HTTPRequestEditor, and return true only for response
editors; update any call sites that rely on isResponseContent to use this new
logic so Pretty/body-only formatted responses are correctly identified (refer to
isResponseContent, window.getActiveEditor(), HTTPResponseEditor and
HTTPRequestEditor to locate the change).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fe9d682e-7730-4b46-9c5b-48a692464c4b

📥 Commits

Reviewing files that changed from the base of the PR and between da3d3c2 and b68c2a7.

📒 Files selected for processing (2)
  • .mise/config.toml
  • packages/frontend/src/views/GraphQLViewMode.vue

Comment thread packages/frontend/src/views/GraphQLViewMode.vue
@amrelsagaei amrelsagaei merged commit 173477e into main Apr 13, 2026
3 checks passed
@amrelsagaei amrelsagaei deleted the ae-issue-12 branch April 13, 2026 14:28
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: GraphQL request not detected if you click the response

2 participants