feat: add bulk editor for headers, params, form data, and env vars - #8
Merged
Conversation
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.
There was a problem hiding this comment.
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.rsfor parsing/serializingkey: value(andkey=value) lines, with support for disabled entries and highlighting viatree-sitter-properties. - Added an entity API to replace environment variables in bulk (
EnvironmentsEntity::set_variables) and registered thekvhighlighter 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_headerparses 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
key: value(also acceptskey=value); prefix with#to disable.kv) viatree-sitter-propertiesso keys, separators, values, and comments color correctly without enabling the full tree-sitter language pack.