Repository navigation
feat(app): migrate ctx API to bru.ctx - #8557
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
🚧 Files skipped from review as they are similar to previous changes (9)
WalkthroughThe PR migrates request and collection webviews from Changesbru.ctx Runtime Contract
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Webview
participant AppView
participant RequestRunner
Webview->>AppView: bru.ctx.submitRequest(options)
AppView->>RequestRunner: handleSendRequest(requestId, options)
RequestRunner-->>AppView: response, results, variables
AppView-->>Webview: state updates and callbacks
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/apps/apps-ctx-api.spec.ts`:
- Around line 168-176: Fix the guest webview selection and readiness handling in
guestEval and the runtimeVariables test setup. Ensure waitForGuestReady
completes before invoking __send, and disambiguate the target webview instead of
selecting the first data:text/html entry, using the expected collection/app
identifier or an equivalent readiness guard. Verify both runtimeVariables
override steps execute against the intended guest webview.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: edb70e84-944a-4228-a12f-ce81b68423a1
📒 Files selected for processing (9)
packages/bruno-app/src/components/AIAssist/index.jspackages/bruno-app/src/components/AppView/index.jspackages/bruno-app/src/components/AppView/webview-bridge.jspackages/bruno-app/src/components/CollectionApp/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/actions.jspackages/bruno-electron/src/ipc/ai/chat-prompts.jspackages/bruno-electron/src/ipc/ai/script-prompts.jstests/apps/apps-ctx-api.spec.tstests/apps/collection-apps.spec.ts
f122be8 to
26965ef
Compare
26965ef to
fdd140b
Compare
intekhabalamkhan402-dev
left a comment
There was a problem hiding this comment.
Submit general feedback without explicit approval
Description
bru.ctx.*What changed
window.ctxwindow.bru.ctxctx.theme('light'/'dark')bru.ctx.theme({ name, mode, config })ctx.responsebru.ctx.http.responsectx.assertionResults/ctx.testResultsbru.ctx.assertions/bru.ctx.testsctx.variablesbru.ctx.variables.resolvedctx.sendRequest(overrides?)bru.ctx.submitRequest(options?)with{ runtimeVariables }ctx.setRuntimeVariable(key, value)bru.ctx.variables.runtime.set(name, value)ctx.onResponseUpdatebru.ctx.http.onResponseChangectx.onResultsUpdatebru.ctx.onAssertionsChange+bru.ctx.onTestsChangectx.onVariablesUpdatebru.ctx.onVariablesChangectx.onCollectionUpdatebru.ctx.onCollectionChangeContribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
New Features
window.bru.ctxruntime API for embedded request and collection apps (replacingwindow.ctx), including updated request execution, resolved variables, and callback naming.bru.ctxfor listing requests.Documentation
bru.ctxcontract and best-practice initialization.Tests
bru.ctxbootstrapping, request/variable flow, and theme behavior.