Skip to content

feat: add bulk editor for headers, params, form data, and env vars - #8

Merged
bajrangCoder merged 2 commits into
mainfrom
feat/bulk-edit-key-value
Jul 25, 2026
Merged

feat: add bulk editor for headers, params, form data, and env vars#8
bajrangCoder merged 2 commits into
mainfrom
feat/bulk-edit-key-value

Conversation

@bajrangCoder

Copy link
Copy Markdown
Owner

Summary

  • Add Bulk Edit mode for request headers, query params, form URL-encoded fields, and environment variables.
  • Toggle with the pen icon (enter bulk) and table icon (return to tabular view).
  • Bulk format is plain key: value (also accepts key=value); prefix with # to disable.
  • Register a custom highlighter language (kv) via tree-sitter-properties so keys, separators, values, and comments color correctly without enabling the full tree-sitter language pack.
  • Apply bulk text back into the row model when leaving bulk mode (env vars preserve secret flags by matching keys).

Add a toggle between the tabular key-value UI and a multiline bulk
editor using tree-sitter-properties for key: value syntax highlighting.
Disabled entries use # comments; the table icon returns to row view.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a “Bulk Edit” text mode across multiple editors (headers, query params, form-url-encoded data, and environment variables), backed by a shared key/value text parser/serializer and a lightweight custom syntax highlighter registration.

Changes:

  • Added Bulk Edit toggle + code-editor UI for headers, query params, form data, and environment variables.
  • Implemented src/utils/bulk_kv.rs for parsing/serializing key: value (and key=value) lines, with support for disabled entries and highlighting via tree-sitter-properties.
  • Added an entity API to replace environment variables in bulk (EnvironmentsEntity::set_variables) and registered the kv highlighter at app startup.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/views/environment_view.rs Adds bulk editor UI/state and applies bulk text back into environment variables while preserving secret flags by matching keys.
src/utils/mod.rs Exposes the new bulk-kv utilities and registration function from the utils module.
src/utils/bulk_kv.rs Introduces bulk key/value parsing + serialization and a kv syntax highlighter registration with tests.
src/entities/environment.rs Adds set_variables API used by environment bulk edit to replace variables wholesale.
src/components/params_editor.rs Adds bulk editor UI/state for query params and conversion between table rows and bulk text.
src/components/header_editor.rs Adds bulk editor UI/state for headers and integration with programmatic header upserts.
src/components/form_data_editor.rs Adds bulk editor UI/state for form-url-encoded fields and conversion between rows and bulk text.
src/app.rs Registers the kv highlighter on app init so bulk editors can use it.
Cargo.toml Adds tree-sitter-properties dependency for bulk editor highlighting.
Cargo.lock Updates lockfile for the new dependency and transitive version changes.
Comments suppressed due to low confidence (1)

src/components/header_editor.rs:324

  • In bulk mode, set_or_update_header parses and re-serializes the entire bulk editor content. This round-trip normalizes formatting and can delete or mutate user-entered blank lines / comment-only lines, causing unexpected data loss while the user is editing.
        if self.bulk_mode {
            let mut entries = self
                .bulk_editor
                .as_ref()
                .map(|editor| parse_bulk_kv(&editor.read(cx).text().to_string()))

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/params_editor.rs
Comment thread src/components/header_editor.rs
Comment thread src/components/header_editor.rs Outdated
@bajrangCoder
bajrangCoder requested a review from Copilot July 25, 2026 14:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bajrangCoder
bajrangCoder merged commit deabd54 into main Jul 25, 2026
3 checks passed
@bajrangCoder
bajrangCoder deleted the feat/bulk-edit-key-value branch July 25, 2026 14:45
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