Repository navigation
feat(description): file binary description implementation - #8434
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds file-entry description support across schema, converters, Redux state, UI editors, and persistence tests. It also changes environment-variable table resizing to use the adjacent column directly. ChangesFile description support
Binary file selection switch
Environment variable column resize
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant FileBody
participant ReduxStore
participant Converter
participant OpenCollection
User->>FileBody: edit Description in MultiLineEditor
FileBody->>ReduxStore: handleParamChange(type=description)
ReduxStore->>Converter: persist file entry
Converter->>OpenCollection: toOpenCollectionBody(file)
OpenCollection->>Converter: fromOpenCollectionBody(file)
Converter-->>ReduxStore: restore description on reload
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.44.1)packages/bruno-app/src/providers/ReduxStore/slices/collections/index.jsast-grep timed out on this file 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 |
Covers the UI table, FileEntry schema, .bru and .yml file persistence, OpenCollection converters, and end-to-end tests.
8d6d6d0 to
b489516
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for per-file descriptions in file request bodies, enabling round-tripping through Bruno’s schema, app state, YAML/.bru persistence, and OpenCollection conversions (kept separate from the OpenCollection schema where needed).
Changes:
- Add
descriptionto file-body entry types/schema and propagate it through OpenCollection/YAML conversion layers. - Add UI support for editing file-body descriptions (request pane + response example), including column sizing updates.
- Add Playwright and unit/integration tests plus fixture updates; bump
@opencollection/typesto0.10.0.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/request/description/write-request-body-file-description.spec.ts | Playwright coverage for editing file-body description and persisting to .bru. |
| tests/request/description/fixtures/collection/file-with-descriptions.bru | New .bru fixture with file-body @description annotations. |
| tests/request/description-yml/write-request-body-file-description.spec.ts | Playwright coverage for YAML variant persistence. |
| tests/request/description-yml/fixtures/collection/file-with-descriptions.yml | New .yml fixture containing file-body description fields (including multiline). |
| packages/bruno-schema/src/collections/index.js | Schema updated to allow description on file-body entries. |
| packages/bruno-schema-types/src/common/file.ts | Adds `description?: string |
| packages/bruno-filestore/src/formats/yml/common/body.ts | YAML <-> Bruno body conversion updated to read/write file-body descriptions. |
| packages/bruno-filestore/src/formats/yml/common/body.spec.ts | Unit tests for file-body description conversion and round-tripping. |
| packages/bruno-filestore/package.json | Bumps @opencollection/types to 0.10.0. |
| packages/bruno-converters/tests/opencollection/description.spec.js | Converter round-trip tests extended to cover file-body descriptions. |
| packages/bruno-converters/src/opencollection/common/body.ts | OpenCollection conversion updated to include file-body descriptions. |
| packages/bruno-converters/package.json | Bumps @opencollection/types to 0.10.0. |
| packages/bruno-app/src/utils/collections/index.js | Includes file-body entry description in export transform. |
| packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js | Initializes and persists file-body description in Redux updates. |
| packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js | Adds Description column support for response-example file body table. |
| packages/bruno-app/src/components/RequestPane/FileBody/StyledWrapper.js | Adjusts table column widths to accommodate the new Description column. |
| packages/bruno-app/src/components/RequestPane/FileBody/index.js | Adds Description column/editor and exposes data-testid for Playwright targeting. |
| packages/bruno-app/src/components/EnvironmentVariablesTable/index.js | Resizing logic tweak for adjacent-column selection. |
| packages/bruno-app/src/components/EditableTable/descriptionColumn.js | Adds placeholder behavior for empty description cells. |
| package-lock.json | Lockfile update for @opencollection/[email protected]. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/bruno-converters/src/opencollection/common/body.ts (1)
133-146: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove unnecessary
fileWithDescriptionalias.Line 140 creates
const fileWithDescription = file;without any type cast. Unlike the bruno-filestore counterpart (which castsfile as FileBodyVariant), this alias adds no type information —fileWithDescriptionhas the exact same type asfile. The description extraction can usefiledirectly.♻️ Proposed refactor
file: (fileBody.data || []).map((file): BrunoFileEntry => { const entry: BrunoFileEntry = { uid: uuid(), filePath: file.filePath || '', contentType: file.contentType || '', selected: file.selected !== false }; - const fileWithDescription = file; - const desc = typeof fileWithDescription.description === 'string' - ? fileWithDescription.description - : (fileWithDescription.description as { content?: string } | undefined)?.content; + const desc = typeof file.description === 'string' + ? file.description + : (file.description as { content?: string } | undefined)?.content; if (desc && desc.trim().length) entry.description = desc; return entry; })🤖 Prompt for 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. In `@packages/bruno-converters/src/opencollection/common/body.ts` around lines 133 - 146, Remove the unnecessary fileWithDescription alias in the body mapping logic and read description directly from file. In the map callback that builds BrunoFileEntry, keep the existing description extraction behavior but replace references to fileWithDescription with file since the alias adds no type information; this refactor belongs in the file-body conversion block that uses uuid() and creates the entry object.tests/request/description-yml/write-request-body-file-description.spec.ts (1)
21-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPrefer user-like interaction over direct CodeMirror API manipulation.
descCell.evaluate()callscm.setValue()directly on the CodeMirror instance, bypassing user interaction. This tests implementation details rather than user-visible behavior and will break if the CodeMirror internal API changes. Consider clicking into the editor and usingpage.keyboard.type()instead, or extract a reusable CodeMirror helper intests/utils/page/*if direct interaction proves unreliable.Additionally, wrapping the Arrange / Act / Assert phases in
test.step()would improve report readability, as recommended in the Playwright testing guide.As per path instructions: "Promote the use of
test.stepas much as possible so the generated reports are easier to read" and "Tests must verify user-visible behavior, not implementation details."♻️ Proposed refactor with test.step and user-like interaction
test('writes a multiline description to a file body row and persists it to the .yml file', async ({ pageWithUserData: page, collectionFixturePath }) => { + await test.step('Arrange: open request and locate description cell', async () => { await openRequest(page, COLLECTION, 'file-with-descriptions'); await selectRequestPaneTab(page, 'Body'); const fileTable = page.getByTestId('file-body-table'); const plainRow = fileTable.locator('tbody tr').nth(2); const descCell = plainRow.getByTestId('column-description'); + }); - await descCell.evaluate((el) => { - const cmEl = el.querySelector('.CodeMirror'); - if (!cmEl) throw new Error('No CodeMirror in plain-field description cell'); - const cm = (cmEl as any).CodeMirror; - if (!cm) throw new Error('CodeMirror instance not found'); - cm.setValue('File line one\nFile line two'); - }); + await test.step('Act: type multiline description into the editor', async () => { + await descCell.click(); + await page.keyboard.type('File line one'); + await page.keyboard.press('Enter'); + await page.keyboard.type('File line two'); + }); - await expect(descCell.locator('.CodeMirror-line').nth(0)).toHaveText('File line one'); - await expect(descCell.locator('.CodeMirror-line').nth(1)).toHaveText('File line two'); + await test.step('Assert: verify editor content and persisted file', async () => { + await expect(descCell.locator('.CodeMirror-line').nth(0)).toHaveText('File line one'); + await expect(descCell.locator('.CodeMirror-line').nth(1)).toHaveText('File line two'); - await page.keyboard.press(saveShortcut); - await expect(page.getByText('Request saved successfully')).toBeVisible({ timeout: 5000 }); + await page.keyboard.press(saveShortcut); + await expect(page.getByText('Request saved successfully')).toBeVisible({ timeout: 5000 }); - const ymlPath = path.join(collectionFixturePath!, 'file-with-descriptions.yml'); - const fileContent = fs.readFileSync(ymlPath, 'utf8'); + const ymlPath = path.join(collectionFixturePath!, 'file-with-descriptions.yml'); + const fileContent = fs.readFileSync(ymlPath, 'utf8'); - expect(fileContent).toContain('description:'); - expect(fileContent).toContain('File line one'); - expect(fileContent).toContain('File line two'); + expect(fileContent).toContain('description:'); + expect(fileContent).toContain('File line one'); + expect(fileContent).toContain('File line two'); + }); });Note: If
page.keyboard.type()does not reliably trigger CodeMirror's internal state updates, consider extracting atypeIntoCodeMirror(locator, text)helper intotests/utils/page/*that wraps the evaluate-based approach. This keeps the spec clean and centralizes the implementation-detail coupling in one place.🤖 Prompt for 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. In `@tests/request/description-yml/write-request-body-file-description.spec.ts` around lines 21 - 30, The test in write-request-body-file-description.spec.ts should avoid calling descCell.evaluate() and cm.setValue() directly on the CodeMirror instance, since that couples the spec to internal implementation details. Update the scenario to interact like a user by focusing the editor through descCell and typing the multiline text with page.keyboard.type(), or, if that is unreliable, move the direct CodeMirror manipulation into a reusable helper under tests/utils/page/* and call that helper from the spec. Wrap the Arrange/Act/Assert sections in test.step() to make the report clearer, and keep the final assertions on the visible .CodeMirror-line content.Source: Path instructions
🤖 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.
Nitpick comments:
In `@packages/bruno-converters/src/opencollection/common/body.ts`:
- Around line 133-146: Remove the unnecessary fileWithDescription alias in the
body mapping logic and read description directly from file. In the map callback
that builds BrunoFileEntry, keep the existing description extraction behavior
but replace references to fileWithDescription with file since the alias adds no
type information; this refactor belongs in the file-body conversion block that
uses uuid() and creates the entry object.
In `@tests/request/description-yml/write-request-body-file-description.spec.ts`:
- Around line 21-30: The test in write-request-body-file-description.spec.ts
should avoid calling descCell.evaluate() and cm.setValue() directly on the
CodeMirror instance, since that couples the spec to internal implementation
details. Update the scenario to interact like a user by focusing the editor
through descCell and typing the multiline text with page.keyboard.type(), or, if
that is unreliable, move the direct CodeMirror manipulation into a reusable
helper under tests/utils/page/* and call that helper from the spec. Wrap the
Arrange/Act/Assert sections in test.step() to make the report clearer, and keep
the final assertions on the visible .CodeMirror-line content.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8e749790-5f8c-4525-ad1d-00622ef5e8c9
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (19)
packages/bruno-app/src/components/EditableTable/descriptionColumn.jspackages/bruno-app/src/components/EnvironmentVariablesTable/index.jspackages/bruno-app/src/components/RequestPane/FileBody/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/FileBody/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/index.jspackages/bruno-app/src/utils/collections/index.jspackages/bruno-converters/package.jsonpackages/bruno-converters/src/opencollection/common/body.tspackages/bruno-converters/tests/opencollection/description.spec.jspackages/bruno-filestore/package.jsonpackages/bruno-filestore/src/formats/yml/common/body.spec.tspackages/bruno-filestore/src/formats/yml/common/body.tspackages/bruno-schema-types/src/common/file.tspackages/bruno-schema/src/collections/index.jstests/request/description-yml/fixtures/collection/file-with-descriptions.ymltests/request/description-yml/write-request-body-file-description.spec.tstests/request/description/fixtures/collection/file-with-descriptions.brutests/request/description/write-request-body-file-description.spec.ts
There was a problem hiding this comment.
🧹 Nitpick comments (5)
packages/bruno-app/src/components/RequestPane/FileBody/index.js (1)
147-167: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDescription column duplicates logic already factored into
createDescriptionColumn.This inline
MultiLineEditorwiring (value fallback,onSave/onRun/onChangeplumbing, placeholder logic) mirrorscreateDescriptionColumninpackages/bruno-app/src/components/EditableTable/descriptionColumn.js, which was extended in this same PR. SinceFileBodydoesn't use the genericEditableTable, reuse isn't a drop-in swap, but consider extracting a small shared render helper to avoid the two implementations drifting (e.g. placeholder text, description fallback value) as the feature evolves.🤖 Prompt for 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. In `@packages/bruno-app/src/components/RequestPane/FileBody/index.js` around lines 147 - 167, The Description column in FileBody duplicates the same MultiLineEditor wiring already centralized in createDescriptionColumn, so factor the shared value/placeholder/onChange/onSave/onRun setup into a reusable helper or shared renderer instead of maintaining two separate implementations. Use the existing createDescriptionColumn in packages/bruno-app/src/components/EditableTable/descriptionColumn.js as the reference for the shared behavior, and update FileBody to consume that helper so the fallback value, placeholder text, and description-change plumbing stay consistent as the feature evolves.packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js (1)
1726-1741: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
isSelectionUpdateis always true forFileBody's calls — the real gate isparam.selected's value, not edit type.Since
FileBody.handleParamChangealways dispatches acloneDeepof the full existingparam(which always has a booleanselectedfrom creation),typeof action.payload.param.selected === 'boolean'is true for every edit (filePath, contentType, description edits included), not just selection changes. The intended "only touch selection on selection edits" behavior currently works only because non-selected files keepselected: falseunchanged in the clone — so the exclusivity remap on lines 1736-1741 harmlessly re-runs (no-op) whenever editing fields on the already-selected file. This is not a bug given current callers, but the flag name/comment could mislead a future reader into thinking it's gated on an explicittype: 'selected'signal from the UI layer.Consider either renaming/commenting to clarify intent, or having
FileBodyonly includeselectedin the payload when the edit type is'selected', to make the reducer's guard meaningfully independent of caller cloning behavior.🤖 Prompt for 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. In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js` around lines 1726 - 1741, Clarify the selection-update guard in the collection reducer: `isSelectionUpdate` in the `collections` slice is currently driven by the presence of `param.selected`, but `FileBody.handleParamChange` always clones and dispatches a full param object so that flag is effectively always present. Update `FileBody.handleParamChange` and the reducer path that sets `param.selected`/remaps `item.draft.request.body.file` so selection exclusivity is only triggered for explicit selection edits, or rename/comment the guard to reflect that it depends on the caller’s payload shape rather than an edit-type signal.tests/request/binary-file/binary-file-selection-switch.spec.ts (3)
35-35: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
test.describe.serialis unnecessary with a single test.With only one test in this describe block,
.serialhas no effect. Consider usingtest.describeinstead, or keep.serialif you plan to add more tests that share thebeforeAllstate.🤖 Prompt for 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. In `@tests/request/binary-file/binary-file-selection-switch.spec.ts` at line 35, The use of test.describe.serial in the "File / Binary body - switching selected file" suite is unnecessary because there is only one test in that block. Update the describe wrapper in binary-file-selection-switch.spec.ts to use test.describe instead of test.describe.serial, unless you intend to add additional tests that rely on shared beforeAll state.
17-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove inline raw selectors into page modules per path instructions.
The spec uses several inline raw CSS selectors (
input[type="radio"],.dropdown-item,.file-picker-btn,.file-picker-selected,table tbody tr) on lines 19, 22, 76, 81, 82, 86, 87, and 90. The path instructions state: "Centralize locators and actions in page modules undertests/utils/page/*; never inline raw selectors in a spec." While the comment on line 16 justifies keeping the helper functions local, the locators themselves should be defined in page modules (e.g., viabuildCommonLocatorsor a dedicated file-body page module) and consumed here.♻️ Suggested refactor: extract locators to a page module
For example, add file-body locators to
tests/utils/page/locators.tsor a dedicatedtests/utils/page/fileBody.ts:// In tests/utils/page/fileBody.ts export const buildFileBodyLocators = (page: Page) => ({ rows: () => page.locator('table tbody tr'), radioInRow: (index: number) => page.locator('table tbody tr').nth(index).locator('input[type="radio"]'), addFileButton: () => page.getByRole('button', { name: /Add File/i }), filePickerBtn: () => page.locator('.file-picker-btn'), filePickerSelected: () => page.locator('.file-picker-selected'), dropdownItem: (text: string) => page.locator('.dropdown-item').filter({ hasText: text }), });Then consume them in the spec instead of inlining raw selectors.
🤖 Prompt for 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. In `@tests/request/binary-file/binary-file-selection-switch.spec.ts` around lines 17 - 33, The binary file selection spec still inlines raw CSS selectors instead of using page modules, so move those locators into a shared helper under tests/utils/page and have the spec consume them via buildCommonLocators or a dedicated file-body module. Update the local helpers selectRow and sendAndAssertSha256 only to use the exported locator methods for the radio rows and file/body UI, and replace every inline selector such as the radio, dropdown, file picker, selected state, and table row lookups with named page-module accessors.Source: Path instructions
26-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider keeping assertions in the spec body rather than in helpers.
The path instructions note: "Put assertions in the spec: action helpers should synchronize (wait for UI readiness) but not assert pass/fail conditions." While
sendAndAssertSha256is a test-local helper rather than a page-module action, inlining the assertions in the test body (or splitting send vs. assert) would make failure diagnostics clearer in the report—eachexpectwould map directly to atest.stepline.🤖 Prompt for 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. In `@tests/request/binary-file/binary-file-selection-switch.spec.ts` around lines 26 - 33, The helper sendAndAssertSha256 in the binary-file-selection-switch spec mixes an action with assertions, which reduces failure clarity. Split it so the helper only performs the request and waits for the UI to be ready, then move the sha256 parsing and expect checks into the spec body or a separate assertion helper used directly by the test. Keep the assertions near the test flow so each expect is reported against the relevant test step and the failure diagnostics stay explicit.Source: Path instructions
🤖 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.
Nitpick comments:
In `@packages/bruno-app/src/components/RequestPane/FileBody/index.js`:
- Around line 147-167: The Description column in FileBody duplicates the same
MultiLineEditor wiring already centralized in createDescriptionColumn, so factor
the shared value/placeholder/onChange/onSave/onRun setup into a reusable helper
or shared renderer instead of maintaining two separate implementations. Use the
existing createDescriptionColumn in
packages/bruno-app/src/components/EditableTable/descriptionColumn.js as the
reference for the shared behavior, and update FileBody to consume that helper so
the fallback value, placeholder text, and description-change plumbing stay
consistent as the feature evolves.
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js`:
- Around line 1726-1741: Clarify the selection-update guard in the collection
reducer: `isSelectionUpdate` in the `collections` slice is currently driven by
the presence of `param.selected`, but `FileBody.handleParamChange` always clones
and dispatches a full param object so that flag is effectively always present.
Update `FileBody.handleParamChange` and the reducer path that sets
`param.selected`/remaps `item.draft.request.body.file` so selection exclusivity
is only triggered for explicit selection edits, or rename/comment the guard to
reflect that it depends on the caller’s payload shape rather than an edit-type
signal.
In `@tests/request/binary-file/binary-file-selection-switch.spec.ts`:
- Line 35: The use of test.describe.serial in the "File / Binary body -
switching selected file" suite is unnecessary because there is only one test in
that block. Update the describe wrapper in binary-file-selection-switch.spec.ts
to use test.describe instead of test.describe.serial, unless you intend to add
additional tests that rely on shared beforeAll state.
- Around line 17-33: The binary file selection spec still inlines raw CSS
selectors instead of using page modules, so move those locators into a shared
helper under tests/utils/page and have the spec consume them via
buildCommonLocators or a dedicated file-body module. Update the local helpers
selectRow and sendAndAssertSha256 only to use the exported locator methods for
the radio rows and file/body UI, and replace every inline selector such as the
radio, dropdown, file picker, selected state, and table row lookups with named
page-module accessors.
- Around line 26-33: The helper sendAndAssertSha256 in the
binary-file-selection-switch spec mixes an action with assertions, which reduces
failure clarity. Split it so the helper only performs the request and waits for
the UI to be ready, then move the sha256 parsing and expect checks into the spec
body or a separate assertion helper used directly by the test. Keep the
assertions near the test flow so each expect is reported against the relevant
test step and the failure diagnostics stay explicit.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a85e2c6d-7f8d-4fd4-ab4c-45f73946b045
📒 Files selected for processing (9)
packages/bruno-app/src/components/EditableTable/descriptionColumn.jspackages/bruno-app/src/components/RequestPane/FileBody/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/index.spec.jspackages/bruno-converters/src/opencollection/common/body.tstests/request/binary-file/binary-file-selection-switch.spec.tstests/request/description-yml/write-request-body-file-description.spec.tstests/request/description/write-request-body-file-description.spec.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- tests/request/description-yml/write-request-body-file-description.spec.ts
- packages/bruno-converters/src/opencollection/common/body.ts
- tests/request/description/write-request-body-file-description.spec.ts
- packages/bruno-app/src/components/ResponseExample/ResponseExampleRequestPane/ResponseExampleFileBody/index.js
* fix: handle missing location header in redirect error response (usebruno#7725) * fix(request-panel)/websocket and grpc tooltip overflow fixed in request panel (usebruno#8544) * fix(request-panel)/websocket and grpx tooltip overflow fixed in request panel * added test ids and updated the locators for request panel icons * test(auth): fix modified-indicator inherit spec test (usebruno#8550) * test(auth): fix modified-indicator inherit spec test * fix(locators): updated locators for inherit * feat(description): file binary description implementation (usebruno#8434) * Add description support to file body entries Covers the UI table, FileEntry schema, .bru and .yml file persistence, OpenCollection converters, and end-to-end tests. * chore: update @opencollection/types to version 0.10.0 and adjust related code * fix: ensure placeholder is displayed correctly in description editor * fix: improve column resizing logic in EnvironmentVariablesTable * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <[email protected]> * fix: remove unused import of FileEntry in body.ts * feat: enhance file handling and selection logic in various components * test: refactor file description tests for improved readability and structure * refactor: streamline test setup for binary file selection * test: improve comments for clarity in file body description tests * refactor: simplify selection update logic in collections slice --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]> * fix(mount): show requests that failed to load in the collection overview (usebruno#8545) * fix(mount): show requests that failed to load in the collection overview Partial/errored requests were being dropped or mis-rendered: - collection-watcher (v1): the synchronous add path and the change path only logged parse errors and never emitted the item, so failed requests never reached the renderer. Both now send a partial item, matching the async worker path. - mount v2: reconcile dropped `raw` for errored items; it is now forwarded so the item's size can be derived, and size is set for every item. - RequestsNotLoaded: the relative pathname is computed separator-agnostically so it renders on Windows, and errored items are included. * fix(mount): render v2 requests that failed to parse in the sidebar An errored request had no parsed `request`, so tree-builder set `request: undefined`. The main->renderer payload is JSON round-tripped, which drops undefined keys, so the item reached the renderer without a `request` property and `isItemARequest` (which requires it) excluded it from the sidebar. Give errored items an empty `request` object so they survive serialization and render. Also render the "not loaded" table from the same filtered list used for the empty-state check, so errored items are listed consistently. * fix(mount): guard against NaN size and unstable keys for unloaded requests * fix(mount): recover unloaded requests on valid re-parse without crashing the reducer * feat(mount): moved the assignments in change reducer --------- Co-authored-by: Chirag Chandrashekhar <[email protected]> --------- Co-authored-by: Pragadesh-45 <[email protected]> Co-authored-by: sachin-thakur-bruno <[email protected]> Co-authored-by: Pooja <[email protected]> Co-authored-by: Sid <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: Chirag Chandrashekhar <[email protected]> Co-authored-by: Chirag Chandrashekhar <[email protected]> Co-authored-by: Bijin A B <[email protected]>
Description
Additional file/binary form descriptions which aren't a part of Opencollection schema right now, keeping it seperate
to not block the feature implementation
Additionally fixes a bug in the file selector which was using the wrong event prop
Opencollection PR: opencollection-dev/opencollection#59
Stacked on: #8269
Contribution 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