Skip to content

feat(environment): refactor environment editor into workspace tab view#7

Merged
bajrangCoder merged 5 commits into
mainfrom
refactor/environment-tab-view
Jul 24, 2026
Merged

feat(environment): refactor environment editor into workspace tab view#7
bajrangCoder merged 5 commits into
mainfrom
refactor/environment-tab-view

Conversation

@bajrangCoder

Copy link
Copy Markdown
Owner

Summary of Changes

This PR declutters the Environment sidebar panel by extracting the environment variable editor into a dedicated workspace tab (EnvironmentView), and refactors the tab state architecture to easily support future custom tab types

🚀 Key Improvements

  1. Extensible Tab Architecture (TabState):

    • Refactored TabState to use a tagged TabContent enum (TabContent::Request and TabContent::Environment).
    • Added generic icon support (TabIcon) to TabBar for custom tab types.
  2. Sidebar Decluttering (EnvironmentPanel):

    • Removed the inline variable editor and stacked border cards from the narrow sidebar panel.
    • Selecting an environment now opens or switches to its dedicated environment tab in the workspace.
  3. Key-Value Variable Table (EnvironmentView):

    • Built a full EnvironmentView component matching the clean key-value table design of HeaderEditor / ParamsEditor.
    • Supports key/value inputs, secret masking toggle, duplicate key detection, and single/all variable deletion.
    • Added rich centered empty states for empty environments and search filter misses.
  4. Unified 1-Line Header Bar:

    • Replaced stacked header bars with a single compact horizontal toolbar (40px).
    • Features color indicator dot, environment title, scope metadata (Workspace base, Global, etc.), active badge toggle, integrated search box with search icon, color picker swatch, and an actions menu.

- Refactor `TabState` to use tagged `TabContent` enum (`Request` vs `Environment`)
- Create dedicated `EnvironmentView` tab matching `RequestView` key-value table UI
- Simplify sidebar `EnvironmentPanel` to full-height list navigator
- Add unified 1-line environment header bar with color indicator, scope label, and search input with icon
- Implement empty state rendering for empty environments and search filter misses

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 refactors the UI so environment editing moves out of the sidebar into a dedicated workspace tab (EnvironmentView), while evolving the workspace tab model to support multiple tab content types (request vs environment) with custom icons.

Changes:

  • Introduces TabContent (request/environment) and updates tab rendering to support non-request workspace tabs with TabIcon.
  • Adds a new EnvironmentView workspace tab implementing a key/value variables table with search, secret masking, and bulk actions.
  • Simplifies EnvironmentPanel to a navigator-only sidebar that opens the selected environment in the workspace.

Reviewed changes

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

Show a summary per file
File Description
src/views/mod.rs Registers the new environment_view module.
src/views/main_view.rs Refactors tab state to TabContent, adds environment-tab open/switch logic, and updates workspace rendering for new tab types.
src/views/environment_view.rs Adds the new environment editor view (table UI, filtering, secret toggles, delete/clear actions).
src/entities/environment.rs Adds clear_variables to support bulk deletion from EnvironmentView.
src/components/tab_bar.rs Generalizes tab icon rendering via TabIcon and updates tab UI accordingly.
src/components/environment_panel.rs Removes inline variable editor and routes environment selection to open an environment workspace tab.

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

Comment thread src/views/main_view.rs
Comment thread src/views/main_view.rs
Comment thread src/views/main_view.rs Outdated

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread src/components/environment_panel.rs Outdated
Comment thread src/views/environment_view.rs
Comment thread src/components/tab_bar.rs
Comment thread src/components/environment_panel.rs Outdated
@bajrangCoder
bajrangCoder merged commit 7f040ac into main Jul 24, 2026
3 checks passed
@bajrangCoder
bajrangCoder deleted the refactor/environment-tab-view branch July 24, 2026 07:13
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