Skip to content

Plat 98 - fix infinite tab reload#4261

Merged
rohanmathur91 merged 2 commits intoapi-client-redux-migrationfrom
PLAT-98
Jan 31, 2026
Merged

Plat 98 - fix infinite tab reload#4261
rohanmathur91 merged 2 commits intoapi-client-redux-migrationfrom
PLAT-98

Conversation

@srbh777
Copy link
Copy Markdown
Contributor

@srbh777 srbh777 commented Jan 31, 2026

Closes issue:

📜 Summary of changes:

🎥 Demo Video:

Video/Demo:

✅ Checklist:

  • Make sure linting and unit tests pass.
  • No install/build warnings introduced.
  • Verified UI in browser.
  • For UI changes, added/updated analytics events (if applicable).
  • For changes in extension's code, manually tested in Chrome and Firefox.
  • Added/updated unit tests for this change.
  • Raised pull request to update corresponding documentation (if already exists).
  • Added demo video showing the changes in action (if applicable).

🧪 Test instructions:

🔗 Other references:

Prevent tabs from reloading themselves by including tab ID in broadcast
messages and only triggering reloads in other tabs.
Prevent workspace broadcast during initialization to avoid tabs
reloading each other infinitely. Now, workspace change broadcasts
only occur on explicit user actions.
@linear
Copy link
Copy Markdown

linear bot commented Jan 31, 2026

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 31, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch PLAT-98

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rohanmathur91 rohanmathur91 merged commit 7cf0c05 into api-client-redux-migration Jan 31, 2026
3 checks passed
rohanmathur91 added a commit that referenced this pull request Feb 8, 2026
* init

* [PLAT-1] feat(api-client): multi-workspace view slice + context registry (#4000)

* add multi-workspace view slice + selectors

* add multi-workspace view reduce in store

* update root type

* add context registry

* fix: selector

* update thunks

* fix: types

* add ApiClientContextService

* add hooks

* fix: make create repo private

* fix: selectors

* fix

* fix: async

* add validateConnection for repo

* update type

* fix: ApiClientContextService

* fix: thunks

* update thunks

* fix: workspace state

* export raw result

* fix: return type

* fix: error

* fix: return

* fix: workspaceId type

* fix: context hooks

* refactor

* fix: result serialization

* feat(api-client): [PLAT-2] Add apiRecords slice for state management (#3993)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Import Fix APi Records redux (#4039)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Update imports to use new hooks file structure

* [PLAT-2] Refactor: Introduce Entity Abstraction for API Client State (#4040)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Add entity abstraction layer for API client records

* Moved to ApiClientEntity model

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* integration part 1 (#4045)

* fix: slice

* add workspace provider

* add setupWorkspaces

* fix: setup state

* fix:  types

* fix: repo creation

* ts ignore

* add comment

* persist selected workspaces

* chore: fix ts config

* wip

* fix: state updates

* fix: workspace deleted case

* fix: private workspace switch

* Fixed type cast and added todo

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* Adding collection variables

* Add variables manager

* Feature/collection variables (#4061)

* Added support for modifying and showing variables

* Add support to hydrate variables

* [PLAT-12]: tabs slice (#4059)

* add tabs slice

* add comment

* add comment

* fix: register workflow interface

* refactor

* fix: workflow abort

* review comments

* cleanup + fix active tab

* fix: selector

* fix: `useHostContext`

* fix: set in tabs slice

* test code

* Feature/rq arch/env variables (#4069)

* moved out variables persistence logic

* Added component to test variables

* adding env slice

* Fixed bug where local value was being set incorrectly

* Made global environment non-nullable

* Add environment variables

* [PLAT-7] feat: Buffer State Management  (#4062)

* feat: Enhance API Client State Management with Buffer and Entity Synchronization

* fix

* fix

* fixes

* Refactor buffer middleware and thunks for improved synchronization and type safety

- Updated buffer middleware to utilize new selectors and handle synchronization of active buffers based on state changes.
- Enhanced thunks to improve type safety by using ThunkDispatch and ensuring proper handling of record creation and updates.
- Cleaned up imports and added type annotations for better clarity and maintainability.

* Add scoped variables (#4074)

* [PLAT-14] feat: persist tab state across sessions (#4073)

* feat: Implement persistent state management for tabs

- Added `persistConfig.ts` to configure persistence for the tabs reducer using redux-persist.
- Introduced `persistTransform.ts` to handle serialization and deserialization of tab state, including error handling with Sentry.
- Updated the store configuration to use the new persisted tabs reducer.

* fix: tab persist

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-13]: tabs isDirty + emit buffer integration (#4071)

* add `useTabBufferIsDirty`

* fix: export

* cleanup: remove debugger

* refactor

* fix: emit buffer updated event

* refactor

* fix: tab isDirty

* address review comments

* refactor(api-client): Improve type safety for common entity setters (#4076)

* fix

* fix

* ref

* Feature/rq arch/runtime variables (#4077)

* Add runtime variables support

* integrate runtime variables with scoped variables

* [PLAT-15] feat: add tab buffer middleware for enhanced state management (#4075)

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* fix: tab buffer middleware

* refactor

* fix: Update existing buffer entity on referenceId match

- Modify bufferSlice to update the current data and reset the diff for existing buffer entities when a matching referenceId is found.
- This change ensures that the buffer state is accurately maintained without creating duplicates.

* fix: type

* fix

* fix: open buffer reducer

* fix: tab buffer middleware

* fix: tab persist

* refactor

* fix: draft request view

* fix: useBufferedEntity

* fix: hydrate buffer

* review comments

* fix tab buffer middleware

* fix: tab close thunks

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-17] Feat: Enhance buffer slice with Immer for patch management (#4084)

* Enhance buffer slice with Immer for patch management

- Integrated Immer's produceWithPatches for efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize patches for better performance and clarity.
- Cleaned up code by removing unnecessary variables and improving readability.
- Ensured backward compatibility and maintained existing functionality.

* Refactor buffer slice to remove unnecessary type assertions

- Simplified the unset and set operations in bufferSlice by removing redundant type assertions.
- Improved code readability and maintainability while ensuring existing functionality remains intact.

* add `WorkspaceIdContext`

* [PLAT-17] ref: Migrate Environment view to use Redux buffer (#4080)

* ref - migration env view

* feat: enhance buffer slice with immer for improved state management

- Integrated immer's produceWithPatches for more efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize immer's patching capabilities.
- Cleaned up code for better readability and maintainability, ensuring consistent handling of buffer entries.
- Enabled patches to streamline state changes and reduce direct mutations.

* ref - migration env view

* ref - migration env view

* Feature/auto generated headers params (#4089)

* Add useAutoGeneratedFields

* Fixed object bug

* don't throw error if all parents of inherit auth

* [PLAT-18]: tabs and env integration (#4086)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* cleanup

* fix: EnvironmentsList

* fix: `useEnvironmentById`

* fix: `GLOBAL_ENVIRONMENT_ID`

* fix: thunks

* fix: handle global env

* fix: TabsContainer

* refactor

* fix: tab title

* fix: find buffer by ref id

* fix: blockers

* fix

* [PLAT-19] Refactor Environment Variables List to Use New Data Structure (#4092)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* fixes

* Fixed auto focus for env view

* fix: blockers

* fix

* fix: new env creation

* fixes

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* cleanup + hook fix (#4096)

* cleanup + hook fix

* fix: workspace provider

* [PLAT-23]: render collection sidebar (#4097)

* [PLAT-22] Refactor Collection and Runtime Variables to use Buffered Redux State (#4098)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* runtime variables

* runtime variables

* firebase fix

* fixes

* runtime tab

* runtime

* fixes

* collection variable

* remove extra buffer deps

* fixed bug where buffer was being indexed incorrectly

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* [PLAT-24] fix: new record creation (#4101)

* fix: new record creation

* fix: new env input focus

* fix

* refactor

* Added saveBuffer support (#4102)

* Save undefined origin buffers (#4104)

* Added saveBuffer support

* Add support to save buffers with undefined origin

* [PLAT-26]: sidebar migration (#4105)

* add delete record thunk

* fix: rename collection and api

* fix: move utils

* add upsertRecords

* fix: stack trace

* fix: move

* fix: move

* add duplicate records thunk

* fix: upsert record

* Updated save buffer impl (#4108)

* [PLAT-25] Refactor Collection View and Variable Upsert to use Redux entities (#4109)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* [PLAT-27]: multi-workspace view (#4111)

* fix: switch workspace

* fix: workspace selection click

* fix: workspace loading

* fix: render collection sidebar

* add comment

* fix: env switcher

* add comment

* fix: render env list

* fix: duplicate records

* fix: delete records

* refactor

* fix: move

* fix: select state

* add errored record slice

* fix: errored records

* fix: fallback workspace

* fix

* [PLAT-25] Fix Hotkey Behavior in Collection View Tabs (#4113)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* fixes

* fix: update collection

* Feature/rq arch/http client view (#4122)

* Updated save buffer impl

* large changes for getting things started

* first working version

* Add support for filters in buffers

* Added better handling for saveBuffer

* enabled saving via hotkey

* optimized path checking

* Add support to apply filter when saving buffer

* in save buffer, update referenceId only if origin doesn't exist

* Added isNew and name change

* Add path variables support

* Added back auto generated fields

* Fixed response deleted on save

* Fixed executor and prep service interface

* Added back client code generator

* fixed test rerun

* cleared tsc errors

* cleaned up http client view

* made httpclientview generic

* Added draft support

* Fixed isNew and isPreview with draft

* fixed types in http executor

* removed comments

* [PLAT-30] feat(runner): Implement Redux slice for Collection Runner configuration (#4117)

* runconfig

* fixes

* fixes types

* [PLAT-29]: runner view integration (#4118)

* buffer

* buffer sync

* fix: buffer dirty check (#4121)

* fix: check dirty buffer

* refactor

* Update CollectionRunnerView.tsx

* add register and unregister tab

* fix: collection run order

* cleanup

* clean up

* fix: imports + types

* fix slice

* fix: close secondary buffers

* fix: patch effect

* fix: move buffered entity in runner view context

* save buffer

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Feature/rq arch/script context (#4132)

* fixed variables

* Made executors work direcly with entry than entity

* prepping for gql

* Added support for auto local sync (#4135)

* [PLAT-32]: collection runner + run results migration (#4136)

* add run thunks

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: typo

* fix: collection view container

* fix: collection runner view context

* fix: imports

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* enable executor

* fix

* fix

* fix

* fix: register workflow

* close tab and context

* fix: run abort on tab close

* fix: empty state

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [PLAT-34] Refactor: Migrate example collections import to a Redux slice (#4148)

* Refactor example collections import to Redux slice

- Move example collections import logic to a new Redux slice in
  `features/apiClient/slices/exampleCollections`
- Add selectors, thunks, and types for example collections state
- Update components to use new slice and hooks
- Persist import status and nudge state in Redux
- Register reducer in store and update usage in Daemon and Nudge
  components

* clean up

* fixes

* migrate fixes

* [PLAT-35]: graphQL view migration (#4149)

* fix: introspection

* fix: draft view

* fix: gql view

* fix

* fix: draft request view

* fix: auth change

* fix: url component

* fix: setResponse interface

* fix: types

* fix: save type issue

* comment (#4156)

* [PLAT-33] fix: importers and export (#4177)

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* exporter

* importer

* remove `any`

* fix: type

* fix

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* cleanup (#4178)

* [PLAT-42] fix: tabs cleanup (#4175)

* add tab close middleware

* refactor

* add sentry

* add middleware for api client store

* wip

* refactor

* fix: env delete

* undo

* fix: api delete

* [PLAT-44] feat(api-client): migrate Environment and Collection variable daemons to Redux  (#4180)

* [PLAT-38] feat(variables): Implement custom ordering for environment variables (#4169)

* Fix variable row handling for unique IDs and key updates

Ensure new variable rows use unique IDs and prevent key collisions when
updating variable keys in the environment list.

* Add variablesOrder to environments for custom variable ordering

This introduces a variablesOrder array to environment, collection, and
runtime variable entities, enabling custom display order for variables.
Includes migration logic for backward compatibility and updates all
reducers, selectors, and persistence transforms to support the new
field.

* Add variablesOrder support to environment and collection entities

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* [PLAT-39] Fix buffer slice to apply user edits on source data correctly (#4167)

* [PLAT-46] fix: workspace switch race condition (#4191)

* fix: workspace switch race condition

* refactor

* Refactor EnvironmentView imports and improve save feedback (#4195)

* Add container divs for QueryParamsTable layout styling (#4198)

* Update tab close confirmation message for unsaved changes (#4206)

* PLAT-49 Refactor autoGeneratedFields selector to resolve inherited auth (#4196)

* PLAT-58 Refactor to use useActiveTab instead of useActiveTabId (#4204)

* PLAT-62 Fix runtime variable override in getScopes function (#4209)

* PLAT-57 Refactor API Client empty view to use context for record creation (#4208)

* Refactor API Client empty view to use context for record creation

Update CollectionView to mark buffer as saved on name change. Comment
out buffer update in buffer slice to prevent overwriting current data.
Add "api_client_home" to ApiEntrySource.

* Refactor buffer sync logic and remove redundant markSaved call

- Simplify buffer middleware to sync only relevant buffers based on
  action payload
- Remove unnecessary markSaved dispatch from CollectionView
- Ensure isNew is set to false on syncFromSource

* [PLAT-16] chore: apply code rabbit feedback for API Client migration (#4189)

* CR comments till 40

* CR comments till 40

* rest of the comments addressed

* fixes

* Add Sentry error reporting to API Client components

- Capture exceptions in CollectionOverview, VariablesList, and
  ExampleCollectionsNudge for better error tracking
- Add revertChanges action to buffer slice and update HTTP/GraphQL views
  to use it
- Replace generic errors with EntityNotFound in requestViewTabSource
- Remove redundant error handling in switchToPrivateWorkspace

* [QA-77] fix: collection runner requests update (#4237)

* fix: collection runner request update

* fix

* fix

* [QA-73] fix: tab close bug for multi-workspace view (#4234)

* Refactor runtime variables to use feature context for workspaceId

* fix: loading state for empty view

* cleanup

* fix: tab close

* fix: delete record thunk condition

* fix: thunks pre condition

* undo

* add comment

---------

Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [QA-82] refactor: buffer middleware to use BufferSyncRemote pattern (#4230)

* Refactor buffer middleware to use BufferSyncRemote pattern

* Refactor buffer middleware for improved type safety and clarity

* rebase

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* QA-76 Fix file input type change to update form state correctly (#4231)

* Fix file input type change to update form state correctly

* Fix multipart form row type change to update value correctly

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Fix variable persistence logic and filter non-persisted variables on (#4222)

rehydrate

* Update auth.ts (#4221)

* fix: workspace context for empty view

* PLAT-63 Refactor APIClientModal to use API client context and buffer (#4213)

* Refactor APIClientModal to use API client context and buffer

* refactor

* cleanup

* Refactor APIClientModal to extract ApiClientSession component

* Fix request body state init for undefined or null body (#4244)

* Broadcast runtime variables sync to all workspace buffers (#4245)

Broadcast a synthetic sync event after updating runtime variables so
workspace buffer middleware can synchronize open buffers with the latest
global state.

* Fix variable sync to delete unset variables in executor factory (#4227)

* Fix variable sync to delete unset variables in executor factory

* Refactor variable retrieval in useRequestExecutorFactory

* QA-66 Refactor runtime variables to use feature context for workspaceId (#4214)

* Refactor runtime variables to use feature context for workspaceId

* Refactor RuntimeVariables to memoize handleTabOpen with useCallback

* Limit collection variables in script context to immediate collection (#4247)

Only expose variables from the direct collection in script execution
context, preventing access to ancestor collection variables. Update
store override logic to match.

* Fix record renaming to update full record object (#4260)

* PLAT-82 Fix race condition when creating workspace context (#4262)

* Fix race condition when creating workspace context

* Remove redundant workspace existence check in addContext

* Plat 98 - fix infinite tab reload (#4261)

* Fix infinite reload loop on workspace switch in multi-tab setup

Prevent tabs from reloading themselves by including tab ID in broadcast
messages and only triggering reloads in other tabs.

* Fix multi-tab infinite reload loop on workspace switch

Prevent workspace broadcast during initialization to avoid tabs
reloading each other infinitely. Now, workspace change broadcasts
only occur on explicit user actions.

* [PLAT-99] fix: daemons (#4263)

* chore: sync hive

* PLAT-70 Fix buffer sync to merge partial updates with remote data (#4251)

* Fix buffer sync to merge partial updates with remote data

* Fix global environment ID translation in local sync mode

* Fix environment update to ignore name field in changes

Update EnvironmentViewManager to use envId for global environments,
ensuring correct buffer reference in local-file mode. Use
isGlobalEnvironment
utility to determine global status in EnvironmentViewTabSource.

* Fix global environment ID handling in buffer sync and thunks

Prefer extracting the real global environment ID from payload or state
instead of using a constant. Use isGlobalEnvironment utility for
consistency in thunks.

* Add bulk buffer sync when action lacks reference ID

When an action does not include a reference ID, sync all buffers
matching the remote's entity types instead of skipping sync.

* Refactor global environment ID handling in EnvironmentDaemon

* fix: collection runner no request issue (#4264)

* Refactor API client importers to use feature context dispatch (#4267)

- Replace useApiClientDispatch with
  getApiClientFeatureContext().store.dispatch
- Update environment import actions to cast as any for type
  compatibility
- Minor formatting and import order improvements

* Refactor HTTP record type checks to use isHttpApiRecord utility (#4268)

* Runner Fix: Use shallowEqual in useAllDescendantApiRecordIds (#4273)

* Restore activeEnvironmentId from persisted state on rehydrate (#4257)

* [PLAT-86] fix: api client home page card (#4278)

* PLAT-89 Refactor variable editing to support ancestor collection scopes (#4250)

* Refactor variable editing to support ancestor collection scopes

Allow EditVariableView to edit variables from ancestor collections by
passing explicit scopeId and scopeName to useVariableScopeAdapter.
Update
scope display and icon logic for improved accuracy.

* Pass scopeId to VariablePopover VariableEditor props

* Refactor useVariableScopeAdapter to simplify scopeId and displayName
handling

* [PLAT-80]: sidebar showing different requests & collection when switch back to local workspace (#4277)

* fix: context loading + sidebar showing different data

* add workspaces sequentially

* fix: errored workspace in multi-view

* [PLAT-71] chore: capture tabs middleware error (#4279)

* Handle missing ApiClient context during tab buffer cleanup

Skip buffer cleanup if ApiClient context is unavailable, such as during
workspace or auth transitions. Also prevent errors in
CollectionVariablesDaemon
when repository emits variables for collections not present in the
store.

* chore: capture tabs middleware error

* undo

---------

Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* Wrap TabLabel in div to fix rendering issue

* [PLAT-69]: fix tabs persist (#4281)

* fix: workspace switching

* fix

* fix: tabs persist

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>

* chore: update feature compatible version (#4282)

* fix: workspace creation

* PLAT-81 Migrate History Tab Source (#4271)

* Migrate History Tab Source

Ensure only one history tab exists at a time and reuse its buffer.
Handle unsaved changes when switching history entries. Refactor
history tab source to include workspace context. Update tab actions
and sidebar/history view logic for new flow.

* Refactor tab system to support singleton tabs via route config

- Add  property to TabRoute and propagate through tab logic
- Remove openOrSwitchHistoryTab thunk; handle History tab as singleton via openBufferedTab
- Track singleton tab IDs in state and clean up on tab close/reset
- Update History tab source and related components for new singleton logic

* Add singleton flag to tabs and improve history save flow

- Add singleton property to TabState and ensure correct tab preview
  handling
- Refactor tab title logic to use singleton flag
- Update history save flow to skip markSaved for history tabs
- Add skipMarkSaved option to saveBuffer and related components
- Refactor entity type detection for history records

* Refactor imports in HistoryView for clarity and order

* Refactor API record creation in history views and list

* Reduce tabs store persist throttle to 100ms (#4290)

* Update persistTransform.ts (#4291)

* Wrap tab content in Fragment with source ID as key (#4292)

* master merge

* [PLAT-103] fix: remove workspace setup abort (#4296)

* [PLAT-100] fix: local workspace rpc build (#4297)

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>
rohanmathur91 added a commit that referenced this pull request Feb 16, 2026
* init

* [PLAT-1] feat(api-client): multi-workspace view slice + context registry (#4000)

* add multi-workspace view slice + selectors

* add multi-workspace view reduce in store

* update root type

* add context registry

* fix: selector

* update thunks

* fix: types

* add ApiClientContextService

* add hooks

* fix: make create repo private

* fix: selectors

* fix

* fix: async

* add validateConnection for repo

* update type

* fix: ApiClientContextService

* fix: thunks

* update thunks

* fix: workspace state

* export raw result

* fix: return type

* fix: error

* fix: return

* fix: workspaceId type

* fix: context hooks

* refactor

* fix: result serialization

* feat(api-client): [PLAT-2] Add apiRecords slice for state management (#3993)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Import Fix APi Records redux (#4039)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Update imports to use new hooks file structure

* [PLAT-2] Refactor: Introduce Entity Abstraction for API Client State (#4040)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Add entity abstraction layer for API client records

* Moved to ApiClientEntity model

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* integration part 1 (#4045)

* fix: slice

* add workspace provider

* add setupWorkspaces

* fix: setup state

* fix:  types

* fix: repo creation

* ts ignore

* add comment

* persist selected workspaces

* chore: fix ts config

* wip

* fix: state updates

* fix: workspace deleted case

* fix: private workspace switch

* Fixed type cast and added todo

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* Adding collection variables

* Add variables manager

* Feature/collection variables (#4061)

* Added support for modifying and showing variables

* Add support to hydrate variables

* [PLAT-12]: tabs slice (#4059)

* add tabs slice

* add comment

* add comment

* fix: register workflow interface

* refactor

* fix: workflow abort

* review comments

* cleanup + fix active tab

* fix: selector

* fix: `useHostContext`

* fix: set in tabs slice

* test code

* Feature/rq arch/env variables (#4069)

* moved out variables persistence logic

* Added component to test variables

* adding env slice

* Fixed bug where local value was being set incorrectly

* Made global environment non-nullable

* Add environment variables

* [PLAT-7] feat: Buffer State Management  (#4062)

* feat: Enhance API Client State Management with Buffer and Entity Synchronization

* fix

* fix

* fixes

* Refactor buffer middleware and thunks for improved synchronization and type safety

- Updated buffer middleware to utilize new selectors and handle synchronization of active buffers based on state changes.
- Enhanced thunks to improve type safety by using ThunkDispatch and ensuring proper handling of record creation and updates.
- Cleaned up imports and added type annotations for better clarity and maintainability.

* Add scoped variables (#4074)

* [PLAT-14] feat: persist tab state across sessions (#4073)

* feat: Implement persistent state management for tabs

- Added `persistConfig.ts` to configure persistence for the tabs reducer using redux-persist.
- Introduced `persistTransform.ts` to handle serialization and deserialization of tab state, including error handling with Sentry.
- Updated the store configuration to use the new persisted tabs reducer.

* fix: tab persist

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-13]: tabs isDirty + emit buffer integration (#4071)

* add `useTabBufferIsDirty`

* fix: export

* cleanup: remove debugger

* refactor

* fix: emit buffer updated event

* refactor

* fix: tab isDirty

* address review comments

* refactor(api-client): Improve type safety for common entity setters (#4076)

* fix

* fix

* ref

* Feature/rq arch/runtime variables (#4077)

* Add runtime variables support

* integrate runtime variables with scoped variables

* [PLAT-15] feat: add tab buffer middleware for enhanced state management (#4075)

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* fix: tab buffer middleware

* refactor

* fix: Update existing buffer entity on referenceId match

- Modify bufferSlice to update the current data and reset the diff for existing buffer entities when a matching referenceId is found.
- This change ensures that the buffer state is accurately maintained without creating duplicates.

* fix: type

* fix

* fix: open buffer reducer

* fix: tab buffer middleware

* fix: tab persist

* refactor

* fix: draft request view

* fix: useBufferedEntity

* fix: hydrate buffer

* review comments

* fix tab buffer middleware

* fix: tab close thunks

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-17] Feat: Enhance buffer slice with Immer for patch management (#4084)

* Enhance buffer slice with Immer for patch management

- Integrated Immer's produceWithPatches for efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize patches for better performance and clarity.
- Cleaned up code by removing unnecessary variables and improving readability.
- Ensured backward compatibility and maintained existing functionality.

* Refactor buffer slice to remove unnecessary type assertions

- Simplified the unset and set operations in bufferSlice by removing redundant type assertions.
- Improved code readability and maintainability while ensuring existing functionality remains intact.

* add `WorkspaceIdContext`

* [PLAT-17] ref: Migrate Environment view to use Redux buffer (#4080)

* ref - migration env view

* feat: enhance buffer slice with immer for improved state management

- Integrated immer's produceWithPatches for more efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize immer's patching capabilities.
- Cleaned up code for better readability and maintainability, ensuring consistent handling of buffer entries.
- Enabled patches to streamline state changes and reduce direct mutations.

* ref - migration env view

* ref - migration env view

* Feature/auto generated headers params (#4089)

* Add useAutoGeneratedFields

* Fixed object bug

* don't throw error if all parents of inherit auth

* [PLAT-18]: tabs and env integration (#4086)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* cleanup

* fix: EnvironmentsList

* fix: `useEnvironmentById`

* fix: `GLOBAL_ENVIRONMENT_ID`

* fix: thunks

* fix: handle global env

* fix: TabsContainer

* refactor

* fix: tab title

* fix: find buffer by ref id

* fix: blockers

* fix

* [PLAT-19] Refactor Environment Variables List to Use New Data Structure (#4092)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* fixes

* Fixed auto focus for env view

* fix: blockers

* fix

* fix: new env creation

* fixes

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* cleanup + hook fix (#4096)

* cleanup + hook fix

* fix: workspace provider

* [PLAT-23]: render collection sidebar (#4097)

* [PLAT-22] Refactor Collection and Runtime Variables to use Buffered Redux State (#4098)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* runtime variables

* runtime variables

* firebase fix

* fixes

* runtime tab

* runtime

* fixes

* collection variable

* remove extra buffer deps

* fixed bug where buffer was being indexed incorrectly

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* [PLAT-24] fix: new record creation (#4101)

* fix: new record creation

* fix: new env input focus

* fix

* refactor

* Added saveBuffer support (#4102)

* Save undefined origin buffers (#4104)

* Added saveBuffer support

* Add support to save buffers with undefined origin

* [PLAT-26]: sidebar migration (#4105)

* add delete record thunk

* fix: rename collection and api

* fix: move utils

* add upsertRecords

* fix: stack trace

* fix: move

* fix: move

* add duplicate records thunk

* fix: upsert record

* Updated save buffer impl (#4108)

* [PLAT-25] Refactor Collection View and Variable Upsert to use Redux entities (#4109)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* [PLAT-27]: multi-workspace view (#4111)

* fix: switch workspace

* fix: workspace selection click

* fix: workspace loading

* fix: render collection sidebar

* add comment

* fix: env switcher

* add comment

* fix: render env list

* fix: duplicate records

* fix: delete records

* refactor

* fix: move

* fix: select state

* add errored record slice

* fix: errored records

* fix: fallback workspace

* fix

* [PLAT-25] Fix Hotkey Behavior in Collection View Tabs (#4113)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* fixes

* fix: update collection

* Feature/rq arch/http client view (#4122)

* Updated save buffer impl

* large changes for getting things started

* first working version

* Add support for filters in buffers

* Added better handling for saveBuffer

* enabled saving via hotkey

* optimized path checking

* Add support to apply filter when saving buffer

* in save buffer, update referenceId only if origin doesn't exist

* Added isNew and name change

* Add path variables support

* Added back auto generated fields

* Fixed response deleted on save

* Fixed executor and prep service interface

* Added back client code generator

* fixed test rerun

* cleared tsc errors

* cleaned up http client view

* made httpclientview generic

* Added draft support

* Fixed isNew and isPreview with draft

* fixed types in http executor

* removed comments

* [PLAT-30] feat(runner): Implement Redux slice for Collection Runner configuration (#4117)

* runconfig

* fixes

* fixes types

* [PLAT-29]: runner view integration (#4118)

* buffer

* buffer sync

* fix: buffer dirty check (#4121)

* fix: check dirty buffer

* refactor

* Update CollectionRunnerView.tsx

* add register and unregister tab

* fix: collection run order

* cleanup

* clean up

* fix: imports + types

* fix slice

* fix: close secondary buffers

* fix: patch effect

* fix: move buffered entity in runner view context

* save buffer

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Feature/rq arch/script context (#4132)

* fixed variables

* Made executors work direcly with entry than entity

* prepping for gql

* Added support for auto local sync (#4135)

* [PLAT-32]: collection runner + run results migration (#4136)

* add run thunks

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: typo

* fix: collection view container

* fix: collection runner view context

* fix: imports

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* enable executor

* fix

* fix

* fix

* fix: register workflow

* close tab and context

* fix: run abort on tab close

* fix: empty state

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [PLAT-34] Refactor: Migrate example collections import to a Redux slice (#4148)

* Refactor example collections import to Redux slice

- Move example collections import logic to a new Redux slice in
  `features/apiClient/slices/exampleCollections`
- Add selectors, thunks, and types for example collections state
- Update components to use new slice and hooks
- Persist import status and nudge state in Redux
- Register reducer in store and update usage in Daemon and Nudge
  components

* clean up

* fixes

* migrate fixes

* [PLAT-35]: graphQL view migration (#4149)

* fix: introspection

* fix: draft view

* fix: gql view

* fix

* fix: draft request view

* fix: auth change

* fix: url component

* fix: setResponse interface

* fix: types

* fix: save type issue

* comment (#4156)

* [PLAT-33] fix: importers and export (#4177)

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* exporter

* importer

* remove `any`

* fix: type

* fix

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* cleanup (#4178)

* [PLAT-42] fix: tabs cleanup (#4175)

* add tab close middleware

* refactor

* add sentry

* add middleware for api client store

* wip

* refactor

* fix: env delete

* undo

* fix: api delete

* [PLAT-44] feat(api-client): migrate Environment and Collection variable daemons to Redux  (#4180)

* [PLAT-38] feat(variables): Implement custom ordering for environment variables (#4169)

* Fix variable row handling for unique IDs and key updates

Ensure new variable rows use unique IDs and prevent key collisions when
updating variable keys in the environment list.

* Add variablesOrder to environments for custom variable ordering

This introduces a variablesOrder array to environment, collection, and
runtime variable entities, enabling custom display order for variables.
Includes migration logic for backward compatibility and updates all
reducers, selectors, and persistence transforms to support the new
field.

* Add variablesOrder support to environment and collection entities

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* [PLAT-39] Fix buffer slice to apply user edits on source data correctly (#4167)

* [PLAT-46] fix: workspace switch race condition (#4191)

* fix: workspace switch race condition

* refactor

* Refactor EnvironmentView imports and improve save feedback (#4195)

* Add container divs for QueryParamsTable layout styling (#4198)

* Update tab close confirmation message for unsaved changes (#4206)

* PLAT-49 Refactor autoGeneratedFields selector to resolve inherited auth (#4196)

* PLAT-58 Refactor to use useActiveTab instead of useActiveTabId (#4204)

* PLAT-62 Fix runtime variable override in getScopes function (#4209)

* PLAT-57 Refactor API Client empty view to use context for record creation (#4208)

* Refactor API Client empty view to use context for record creation

Update CollectionView to mark buffer as saved on name change. Comment
out buffer update in buffer slice to prevent overwriting current data.
Add "api_client_home" to ApiEntrySource.

* Refactor buffer sync logic and remove redundant markSaved call

- Simplify buffer middleware to sync only relevant buffers based on
  action payload
- Remove unnecessary markSaved dispatch from CollectionView
- Ensure isNew is set to false on syncFromSource

* [PLAT-16] chore: apply code rabbit feedback for API Client migration (#4189)

* CR comments till 40

* CR comments till 40

* rest of the comments addressed

* fixes

* Add Sentry error reporting to API Client components

- Capture exceptions in CollectionOverview, VariablesList, and
  ExampleCollectionsNudge for better error tracking
- Add revertChanges action to buffer slice and update HTTP/GraphQL views
  to use it
- Replace generic errors with EntityNotFound in requestViewTabSource
- Remove redundant error handling in switchToPrivateWorkspace

* [QA-77] fix: collection runner requests update (#4237)

* fix: collection runner request update

* fix

* fix

* [QA-73] fix: tab close bug for multi-workspace view (#4234)

* Refactor runtime variables to use feature context for workspaceId

* fix: loading state for empty view

* cleanup

* fix: tab close

* fix: delete record thunk condition

* fix: thunks pre condition

* undo

* add comment

---------

Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [QA-82] refactor: buffer middleware to use BufferSyncRemote pattern (#4230)

* Refactor buffer middleware to use BufferSyncRemote pattern

* Refactor buffer middleware for improved type safety and clarity

* rebase

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* QA-76 Fix file input type change to update form state correctly (#4231)

* Fix file input type change to update form state correctly

* Fix multipart form row type change to update value correctly

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Fix variable persistence logic and filter non-persisted variables on (#4222)

rehydrate

* Update auth.ts (#4221)

* fix: workspace context for empty view

* PLAT-63 Refactor APIClientModal to use API client context and buffer (#4213)

* Refactor APIClientModal to use API client context and buffer

* refactor

* cleanup

* Refactor APIClientModal to extract ApiClientSession component

* Fix request body state init for undefined or null body (#4244)

* Broadcast runtime variables sync to all workspace buffers (#4245)

Broadcast a synthetic sync event after updating runtime variables so
workspace buffer middleware can synchronize open buffers with the latest
global state.

* Fix variable sync to delete unset variables in executor factory (#4227)

* Fix variable sync to delete unset variables in executor factory

* Refactor variable retrieval in useRequestExecutorFactory

* QA-66 Refactor runtime variables to use feature context for workspaceId (#4214)

* Refactor runtime variables to use feature context for workspaceId

* Refactor RuntimeVariables to memoize handleTabOpen with useCallback

* Limit collection variables in script context to immediate collection (#4247)

Only expose variables from the direct collection in script execution
context, preventing access to ancestor collection variables. Update
store override logic to match.

* Fix record renaming to update full record object (#4260)

* PLAT-82 Fix race condition when creating workspace context (#4262)

* Fix race condition when creating workspace context

* Remove redundant workspace existence check in addContext

* Plat 98 - fix infinite tab reload (#4261)

* Fix infinite reload loop on workspace switch in multi-tab setup

Prevent tabs from reloading themselves by including tab ID in broadcast
messages and only triggering reloads in other tabs.

* Fix multi-tab infinite reload loop on workspace switch

Prevent workspace broadcast during initialization to avoid tabs
reloading each other infinitely. Now, workspace change broadcasts
only occur on explicit user actions.

* [PLAT-99] fix: daemons (#4263)

* chore: sync hive

* PLAT-70 Fix buffer sync to merge partial updates with remote data (#4251)

* Fix buffer sync to merge partial updates with remote data

* Fix global environment ID translation in local sync mode

* Fix environment update to ignore name field in changes

Update EnvironmentViewManager to use envId for global environments,
ensuring correct buffer reference in local-file mode. Use
isGlobalEnvironment
utility to determine global status in EnvironmentViewTabSource.

* Fix global environment ID handling in buffer sync and thunks

Prefer extracting the real global environment ID from payload or state
instead of using a constant. Use isGlobalEnvironment utility for
consistency in thunks.

* Add bulk buffer sync when action lacks reference ID

When an action does not include a reference ID, sync all buffers
matching the remote's entity types instead of skipping sync.

* Refactor global environment ID handling in EnvironmentDaemon

* fix: collection runner no request issue (#4264)

* Refactor API client importers to use feature context dispatch (#4267)

- Replace useApiClientDispatch with
  getApiClientFeatureContext().store.dispatch
- Update environment import actions to cast as any for type
  compatibility
- Minor formatting and import order improvements

* Refactor HTTP record type checks to use isHttpApiRecord utility (#4268)

* Runner Fix: Use shallowEqual in useAllDescendantApiRecordIds (#4273)

* Restore activeEnvironmentId from persisted state on rehydrate (#4257)

* [PLAT-86] fix: api client home page card (#4278)

* PLAT-89 Refactor variable editing to support ancestor collection scopes (#4250)

* Refactor variable editing to support ancestor collection scopes

Allow EditVariableView to edit variables from ancestor collections by
passing explicit scopeId and scopeName to useVariableScopeAdapter.
Update
scope display and icon logic for improved accuracy.

* Pass scopeId to VariablePopover VariableEditor props

* Refactor useVariableScopeAdapter to simplify scopeId and displayName
handling

* [ENGG-5244] added variable list popover

* added components

* added components

* WIP-1

* add DynamicVariableProvider

* add faker provider

* add DynamicVariableResolver

* add resolver

* add comment

* added missed function

* fix: generate method

* removed unused code

* refactor

* add comments

* integrated 5243

* added examples

* added $ sign to dynamic variables

* WIP-1 (#4314)

* WIP-1

* added $ sign to dynamic variables

* addresed review comments

* ENGG-5294

* addresed review comments

* added fix for filtering

* addressed rview comments

* addressed rview comments

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>
rohanmathur91 added a commit that referenced this pull request Feb 16, 2026
* init

* [PLAT-1] feat(api-client): multi-workspace view slice + context registry (#4000)

* add multi-workspace view slice + selectors

* add multi-workspace view reduce in store

* update root type

* add context registry

* fix: selector

* update thunks

* fix: types

* add ApiClientContextService

* add hooks

* fix: make create repo private

* fix: selectors

* fix

* fix: async

* add validateConnection for repo

* update type

* fix: ApiClientContextService

* fix: thunks

* update thunks

* fix: workspace state

* export raw result

* fix: return type

* fix: error

* fix: return

* fix: workspaceId type

* fix: context hooks

* refactor

* fix: result serialization

* feat(api-client): [PLAT-2] Add apiRecords slice for state management (#3993)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Import Fix APi Records redux (#4039)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Update imports to use new hooks file structure

* [PLAT-2] Refactor: Introduce Entity Abstraction for API Client State (#4040)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Add entity abstraction layer for API client records

* Moved to ApiClientEntity model

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* integration part 1 (#4045)

* fix: slice

* add workspace provider

* add setupWorkspaces

* fix: setup state

* fix:  types

* fix: repo creation

* ts ignore

* add comment

* persist selected workspaces

* chore: fix ts config

* wip

* fix: state updates

* fix: workspace deleted case

* fix: private workspace switch

* Fixed type cast and added todo

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* Adding collection variables

* Add variables manager

* Feature/collection variables (#4061)

* Added support for modifying and showing variables

* Add support to hydrate variables

* [PLAT-12]: tabs slice (#4059)

* add tabs slice

* add comment

* add comment

* fix: register workflow interface

* refactor

* fix: workflow abort

* review comments

* cleanup + fix active tab

* fix: selector

* fix: `useHostContext`

* fix: set in tabs slice

* test code

* Feature/rq arch/env variables (#4069)

* moved out variables persistence logic

* Added component to test variables

* adding env slice

* Fixed bug where local value was being set incorrectly

* Made global environment non-nullable

* Add environment variables

* [PLAT-7] feat: Buffer State Management  (#4062)

* feat: Enhance API Client State Management with Buffer and Entity Synchronization

* fix

* fix

* fixes

* Refactor buffer middleware and thunks for improved synchronization and type safety

- Updated buffer middleware to utilize new selectors and handle synchronization of active buffers based on state changes.
- Enhanced thunks to improve type safety by using ThunkDispatch and ensuring proper handling of record creation and updates.
- Cleaned up imports and added type annotations for better clarity and maintainability.

* Add scoped variables (#4074)

* [PLAT-14] feat: persist tab state across sessions (#4073)

* feat: Implement persistent state management for tabs

- Added `persistConfig.ts` to configure persistence for the tabs reducer using redux-persist.
- Introduced `persistTransform.ts` to handle serialization and deserialization of tab state, including error handling with Sentry.
- Updated the store configuration to use the new persisted tabs reducer.

* fix: tab persist

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-13]: tabs isDirty + emit buffer integration (#4071)

* add `useTabBufferIsDirty`

* fix: export

* cleanup: remove debugger

* refactor

* fix: emit buffer updated event

* refactor

* fix: tab isDirty

* address review comments

* refactor(api-client): Improve type safety for common entity setters (#4076)

* fix

* fix

* ref

* Feature/rq arch/runtime variables (#4077)

* Add runtime variables support

* integrate runtime variables with scoped variables

* [PLAT-15] feat: add tab buffer middleware for enhanced state management (#4075)

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* fix: tab buffer middleware

* refactor

* fix: Update existing buffer entity on referenceId match

- Modify bufferSlice to update the current data and reset the diff for existing buffer entities when a matching referenceId is found.
- This change ensures that the buffer state is accurately maintained without creating duplicates.

* fix: type

* fix

* fix: open buffer reducer

* fix: tab buffer middleware

* fix: tab persist

* refactor

* fix: draft request view

* fix: useBufferedEntity

* fix: hydrate buffer

* review comments

* fix tab buffer middleware

* fix: tab close thunks

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-17] Feat: Enhance buffer slice with Immer for patch management (#4084)

* Enhance buffer slice with Immer for patch management

- Integrated Immer's produceWithPatches for efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize patches for better performance and clarity.
- Cleaned up code by removing unnecessary variables and improving readability.
- Ensured backward compatibility and maintained existing functionality.

* Refactor buffer slice to remove unnecessary type assertions

- Simplified the unset and set operations in bufferSlice by removing redundant type assertions.
- Improved code readability and maintainability while ensuring existing functionality remains intact.

* add `WorkspaceIdContext`

* [PLAT-17] ref: Migrate Environment view to use Redux buffer (#4080)

* ref - migration env view

* feat: enhance buffer slice with immer for improved state management

- Integrated immer's produceWithPatches for more efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize immer's patching capabilities.
- Cleaned up code for better readability and maintainability, ensuring consistent handling of buffer entries.
- Enabled patches to streamline state changes and reduce direct mutations.

* ref - migration env view

* ref - migration env view

* Feature/auto generated headers params (#4089)

* Add useAutoGeneratedFields

* Fixed object bug

* don't throw error if all parents of inherit auth

* [PLAT-18]: tabs and env integration (#4086)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* cleanup

* fix: EnvironmentsList

* fix: `useEnvironmentById`

* fix: `GLOBAL_ENVIRONMENT_ID`

* fix: thunks

* fix: handle global env

* fix: TabsContainer

* refactor

* fix: tab title

* fix: find buffer by ref id

* fix: blockers

* fix

* [PLAT-19] Refactor Environment Variables List to Use New Data Structure (#4092)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* fixes

* Fixed auto focus for env view

* fix: blockers

* fix

* fix: new env creation

* fixes

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* cleanup + hook fix (#4096)

* cleanup + hook fix

* fix: workspace provider

* [PLAT-23]: render collection sidebar (#4097)

* [PLAT-22] Refactor Collection and Runtime Variables to use Buffered Redux State (#4098)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* runtime variables

* runtime variables

* firebase fix

* fixes

* runtime tab

* runtime

* fixes

* collection variable

* remove extra buffer deps

* fixed bug where buffer was being indexed incorrectly

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* [PLAT-24] fix: new record creation (#4101)

* fix: new record creation

* fix: new env input focus

* fix

* refactor

* Added saveBuffer support (#4102)

* Save undefined origin buffers (#4104)

* Added saveBuffer support

* Add support to save buffers with undefined origin

* [PLAT-26]: sidebar migration (#4105)

* add delete record thunk

* fix: rename collection and api

* fix: move utils

* add upsertRecords

* fix: stack trace

* fix: move

* fix: move

* add duplicate records thunk

* fix: upsert record

* Updated save buffer impl (#4108)

* [PLAT-25] Refactor Collection View and Variable Upsert to use Redux entities (#4109)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* [PLAT-27]: multi-workspace view (#4111)

* fix: switch workspace

* fix: workspace selection click

* fix: workspace loading

* fix: render collection sidebar

* add comment

* fix: env switcher

* add comment

* fix: render env list

* fix: duplicate records

* fix: delete records

* refactor

* fix: move

* fix: select state

* add errored record slice

* fix: errored records

* fix: fallback workspace

* fix

* [PLAT-25] Fix Hotkey Behavior in Collection View Tabs (#4113)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* fixes

* fix: update collection

* Feature/rq arch/http client view (#4122)

* Updated save buffer impl

* large changes for getting things started

* first working version

* Add support for filters in buffers

* Added better handling for saveBuffer

* enabled saving via hotkey

* optimized path checking

* Add support to apply filter when saving buffer

* in save buffer, update referenceId only if origin doesn't exist

* Added isNew and name change

* Add path variables support

* Added back auto generated fields

* Fixed response deleted on save

* Fixed executor and prep service interface

* Added back client code generator

* fixed test rerun

* cleared tsc errors

* cleaned up http client view

* made httpclientview generic

* Added draft support

* Fixed isNew and isPreview with draft

* fixed types in http executor

* removed comments

* [PLAT-30] feat(runner): Implement Redux slice for Collection Runner configuration (#4117)

* runconfig

* fixes

* fixes types

* [PLAT-29]: runner view integration (#4118)

* buffer

* buffer sync

* fix: buffer dirty check (#4121)

* fix: check dirty buffer

* refactor

* Update CollectionRunnerView.tsx

* add register and unregister tab

* fix: collection run order

* cleanup

* clean up

* fix: imports + types

* fix slice

* fix: close secondary buffers

* fix: patch effect

* fix: move buffered entity in runner view context

* save buffer

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Feature/rq arch/script context (#4132)

* fixed variables

* Made executors work direcly with entry than entity

* prepping for gql

* Added support for auto local sync (#4135)

* [PLAT-32]: collection runner + run results migration (#4136)

* add run thunks

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: typo

* fix: collection view container

* fix: collection runner view context

* fix: imports

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* enable executor

* fix

* fix

* fix

* fix: register workflow

* close tab and context

* fix: run abort on tab close

* fix: empty state

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [PLAT-34] Refactor: Migrate example collections import to a Redux slice (#4148)

* Refactor example collections import to Redux slice

- Move example collections import logic to a new Redux slice in
  `features/apiClient/slices/exampleCollections`
- Add selectors, thunks, and types for example collections state
- Update components to use new slice and hooks
- Persist import status and nudge state in Redux
- Register reducer in store and update usage in Daemon and Nudge
  components

* clean up

* fixes

* migrate fixes

* [PLAT-35]: graphQL view migration (#4149)

* fix: introspection

* fix: draft view

* fix: gql view

* fix

* fix: draft request view

* fix: auth change

* fix: url component

* fix: setResponse interface

* fix: types

* fix: save type issue

* comment (#4156)

* [PLAT-33] fix: importers and export (#4177)

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* exporter

* importer

* remove `any`

* fix: type

* fix

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* cleanup (#4178)

* [PLAT-42] fix: tabs cleanup (#4175)

* add tab close middleware

* refactor

* add sentry

* add middleware for api client store

* wip

* refactor

* fix: env delete

* undo

* fix: api delete

* [PLAT-44] feat(api-client): migrate Environment and Collection variable daemons to Redux  (#4180)

* [PLAT-38] feat(variables): Implement custom ordering for environment variables (#4169)

* Fix variable row handling for unique IDs and key updates

Ensure new variable rows use unique IDs and prevent key collisions when
updating variable keys in the environment list.

* Add variablesOrder to environments for custom variable ordering

This introduces a variablesOrder array to environment, collection, and
runtime variable entities, enabling custom display order for variables.
Includes migration logic for backward compatibility and updates all
reducers, selectors, and persistence transforms to support the new
field.

* Add variablesOrder support to environment and collection entities

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* [PLAT-39] Fix buffer slice to apply user edits on source data correctly (#4167)

* [PLAT-46] fix: workspace switch race condition (#4191)

* fix: workspace switch race condition

* refactor

* Refactor EnvironmentView imports and improve save feedback (#4195)

* Add container divs for QueryParamsTable layout styling (#4198)

* Update tab close confirmation message for unsaved changes (#4206)

* PLAT-49 Refactor autoGeneratedFields selector to resolve inherited auth (#4196)

* PLAT-58 Refactor to use useActiveTab instead of useActiveTabId (#4204)

* PLAT-62 Fix runtime variable override in getScopes function (#4209)

* PLAT-57 Refactor API Client empty view to use context for record creation (#4208)

* Refactor API Client empty view to use context for record creation

Update CollectionView to mark buffer as saved on name change. Comment
out buffer update in buffer slice to prevent overwriting current data.
Add "api_client_home" to ApiEntrySource.

* Refactor buffer sync logic and remove redundant markSaved call

- Simplify buffer middleware to sync only relevant buffers based on
  action payload
- Remove unnecessary markSaved dispatch from CollectionView
- Ensure isNew is set to false on syncFromSource

* [PLAT-16] chore: apply code rabbit feedback for API Client migration (#4189)

* CR comments till 40

* CR comments till 40

* rest of the comments addressed

* fixes

* Add Sentry error reporting to API Client components

- Capture exceptions in CollectionOverview, VariablesList, and
  ExampleCollectionsNudge for better error tracking
- Add revertChanges action to buffer slice and update HTTP/GraphQL views
  to use it
- Replace generic errors with EntityNotFound in requestViewTabSource
- Remove redundant error handling in switchToPrivateWorkspace

* [QA-77] fix: collection runner requests update (#4237)

* fix: collection runner request update

* fix

* fix

* [QA-73] fix: tab close bug for multi-workspace view (#4234)

* Refactor runtime variables to use feature context for workspaceId

* fix: loading state for empty view

* cleanup

* fix: tab close

* fix: delete record thunk condition

* fix: thunks pre condition

* undo

* add comment

---------

Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [QA-82] refactor: buffer middleware to use BufferSyncRemote pattern (#4230)

* Refactor buffer middleware to use BufferSyncRemote pattern

* Refactor buffer middleware for improved type safety and clarity

* rebase

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* QA-76 Fix file input type change to update form state correctly (#4231)

* Fix file input type change to update form state correctly

* Fix multipart form row type change to update value correctly

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Fix variable persistence logic and filter non-persisted variables on (#4222)

rehydrate

* Update auth.ts (#4221)

* fix: workspace context for empty view

* PLAT-63 Refactor APIClientModal to use API client context and buffer (#4213)

* Refactor APIClientModal to use API client context and buffer

* refactor

* cleanup

* Refactor APIClientModal to extract ApiClientSession component

* Fix request body state init for undefined or null body (#4244)

* Broadcast runtime variables sync to all workspace buffers (#4245)

Broadcast a synthetic sync event after updating runtime variables so
workspace buffer middleware can synchronize open buffers with the latest
global state.

* Fix variable sync to delete unset variables in executor factory (#4227)

* Fix variable sync to delete unset variables in executor factory

* Refactor variable retrieval in useRequestExecutorFactory

* QA-66 Refactor runtime variables to use feature context for workspaceId (#4214)

* Refactor runtime variables to use feature context for workspaceId

* Refactor RuntimeVariables to memoize handleTabOpen with useCallback

* Limit collection variables in script context to immediate collection (#4247)

Only expose variables from the direct collection in script execution
context, preventing access to ancestor collection variables. Update
store override logic to match.

* Fix record renaming to update full record object (#4260)

* PLAT-82 Fix race condition when creating workspace context (#4262)

* Fix race condition when creating workspace context

* Remove redundant workspace existence check in addContext

* Plat 98 - fix infinite tab reload (#4261)

* Fix infinite reload loop on workspace switch in multi-tab setup

Prevent tabs from reloading themselves by including tab ID in broadcast
messages and only triggering reloads in other tabs.

* Fix multi-tab infinite reload loop on workspace switch

Prevent workspace broadcast during initialization to avoid tabs
reloading each other infinitely. Now, workspace change broadcasts
only occur on explicit user actions.

* [PLAT-99] fix: daemons (#4263)

* chore: sync hive

* PLAT-70 Fix buffer sync to merge partial updates with remote data (#4251)

* Fix buffer sync to merge partial updates with remote data

* Fix global environment ID translation in local sync mode

* Fix environment update to ignore name field in changes

Update EnvironmentViewManager to use envId for global environments,
ensuring correct buffer reference in local-file mode. Use
isGlobalEnvironment
utility to determine global status in EnvironmentViewTabSource.

* Fix global environment ID handling in buffer sync and thunks

Prefer extracting the real global environment ID from payload or state
instead of using a constant. Use isGlobalEnvironment utility for
consistency in thunks.

* Add bulk buffer sync when action lacks reference ID

When an action does not include a reference ID, sync all buffers
matching the remote's entity types instead of skipping sync.

* Refactor global environment ID handling in EnvironmentDaemon

* fix: collection runner no request issue (#4264)

* Refactor API client importers to use feature context dispatch (#4267)

- Replace useApiClientDispatch with
  getApiClientFeatureContext().store.dispatch
- Update environment import actions to cast as any for type
  compatibility
- Minor formatting and import order improvements

* Refactor HTTP record type checks to use isHttpApiRecord utility (#4268)

* Runner Fix: Use shallowEqual in useAllDescendantApiRecordIds (#4273)

* Restore activeEnvironmentId from persisted state on rehydrate (#4257)

* [PLAT-86] fix: api client home page card (#4278)

* PLAT-89 Refactor variable editing to support ancestor collection scopes (#4250)

* Refactor variable editing to support ancestor collection scopes

Allow EditVariableView to edit variables from ancestor collections by
passing explicit scopeId and scopeName to useVariableScopeAdapter.
Update
scope display and icon logic for improved accuracy.

* Pass scopeId to VariablePopover VariableEditor props

* Refactor useVariableScopeAdapter to simplify scopeId and displayName
handling

* [ENGG-5244] added variable list popover

* added components

* added components

* WIP-1

* add DynamicVariableProvider

* add faker provider

* add DynamicVariableResolver

* add resolver

* add comment

* added missed function

* fix: generate method

* removed unused code

* refactor

* add comments

* integrated 5243

* added examples

* added $ sign to dynamic variables

* WIP-1 (#4314)

* WIP-1

* added $ sign to dynamic variables

* addresed review comments

* ENGG-5294

* addresed review comments

* added fix for filtering

* added params support

* removed float variable

* addressed rview comments

* fixed filter issue

* add variables

* fix

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>
rohanmathur91 added a commit that referenced this pull request Feb 17, 2026
* init

* [PLAT-1] feat(api-client): multi-workspace view slice + context registry (#4000)

* add multi-workspace view slice + selectors

* add multi-workspace view reduce in store

* update root type

* add context registry

* fix: selector

* update thunks

* fix: types

* add ApiClientContextService

* add hooks

* fix: make create repo private

* fix: selectors

* fix

* fix: async

* add validateConnection for repo

* update type

* fix: ApiClientContextService

* fix: thunks

* update thunks

* fix: workspace state

* export raw result

* fix: return type

* fix: error

* fix: return

* fix: workspaceId type

* fix: context hooks

* refactor

* fix: result serialization

* feat(api-client): [PLAT-2] Add apiRecords slice for state management (#3993)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Import Fix APi Records redux (#4039)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Update imports to use new hooks file structure

* [PLAT-2] Refactor: Introduce Entity Abstraction for API Client State (#4040)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Add entity abstraction layer for API client records

* Moved to ApiClientEntity model

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* integration part 1 (#4045)

* fix: slice

* add workspace provider

* add setupWorkspaces

* fix: setup state

* fix:  types

* fix: repo creation

* ts ignore

* add comment

* persist selected workspaces

* chore: fix ts config

* wip

* fix: state updates

* fix: workspace deleted case

* fix: private workspace switch

* Fixed type cast and added todo

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* Adding collection variables

* Add variables manager

* Feature/collection variables (#4061)

* Added support for modifying and showing variables

* Add support to hydrate variables

* [PLAT-12]: tabs slice (#4059)

* add tabs slice

* add comment

* add comment

* fix: register workflow interface

* refactor

* fix: workflow abort

* review comments

* cleanup + fix active tab

* fix: selector

* fix: `useHostContext`

* fix: set in tabs slice

* test code

* Feature/rq arch/env variables (#4069)

* moved out variables persistence logic

* Added component to test variables

* adding env slice

* Fixed bug where local value was being set incorrectly

* Made global environment non-nullable

* Add environment variables

* [PLAT-7] feat: Buffer State Management  (#4062)

* feat: Enhance API Client State Management with Buffer and Entity Synchronization

* fix

* fix

* fixes

* Refactor buffer middleware and thunks for improved synchronization and type safety

- Updated buffer middleware to utilize new selectors and handle synchronization of active buffers based on state changes.
- Enhanced thunks to improve type safety by using ThunkDispatch and ensuring proper handling of record creation and updates.
- Cleaned up imports and added type annotations for better clarity and maintainability.

* Add scoped variables (#4074)

* [PLAT-14] feat: persist tab state across sessions (#4073)

* feat: Implement persistent state management for tabs

- Added `persistConfig.ts` to configure persistence for the tabs reducer using redux-persist.
- Introduced `persistTransform.ts` to handle serialization and deserialization of tab state, including error handling with Sentry.
- Updated the store configuration to use the new persisted tabs reducer.

* fix: tab persist

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-13]: tabs isDirty + emit buffer integration (#4071)

* add `useTabBufferIsDirty`

* fix: export

* cleanup: remove debugger

* refactor

* fix: emit buffer updated event

* refactor

* fix: tab isDirty

* address review comments

* refactor(api-client): Improve type safety for common entity setters (#4076)

* fix

* fix

* ref

* Feature/rq arch/runtime variables (#4077)

* Add runtime variables support

* integrate runtime variables with scoped variables

* [PLAT-15] feat: add tab buffer middleware for enhanced state management (#4075)

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* fix: tab buffer middleware

* refactor

* fix: Update existing buffer entity on referenceId match

- Modify bufferSlice to update the current data and reset the diff for existing buffer entities when a matching referenceId is found.
- This change ensures that the buffer state is accurately maintained without creating duplicates.

* fix: type

* fix

* fix: open buffer reducer

* fix: tab buffer middleware

* fix: tab persist

* refactor

* fix: draft request view

* fix: useBufferedEntity

* fix: hydrate buffer

* review comments

* fix tab buffer middleware

* fix: tab close thunks

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-17] Feat: Enhance buffer slice with Immer for patch management (#4084)

* Enhance buffer slice with Immer for patch management

- Integrated Immer's produceWithPatches for efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize patches for better performance and clarity.
- Cleaned up code by removing unnecessary variables and improving readability.
- Ensured backward compatibility and maintained existing functionality.

* Refactor buffer slice to remove unnecessary type assertions

- Simplified the unset and set operations in bufferSlice by removing redundant type assertions.
- Improved code readability and maintainability while ensuring existing functionality remains intact.

* add `WorkspaceIdContext`

* [PLAT-17] ref: Migrate Environment view to use Redux buffer (#4080)

* ref - migration env view

* feat: enhance buffer slice with immer for improved state management

- Integrated immer's produceWithPatches for more efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize immer's patching capabilities.
- Cleaned up code for better readability and maintainability, ensuring consistent handling of buffer entries.
- Enabled patches to streamline state changes and reduce direct mutations.

* ref - migration env view

* ref - migration env view

* Feature/auto generated headers params (#4089)

* Add useAutoGeneratedFields

* Fixed object bug

* don't throw error if all parents of inherit auth

* [PLAT-18]: tabs and env integration (#4086)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* cleanup

* fix: EnvironmentsList

* fix: `useEnvironmentById`

* fix: `GLOBAL_ENVIRONMENT_ID`

* fix: thunks

* fix: handle global env

* fix: TabsContainer

* refactor

* fix: tab title

* fix: find buffer by ref id

* fix: blockers

* fix

* [PLAT-19] Refactor Environment Variables List to Use New Data Structure (#4092)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* fixes

* Fixed auto focus for env view

* fix: blockers

* fix

* fix: new env creation

* fixes

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* cleanup + hook fix (#4096)

* cleanup + hook fix

* fix: workspace provider

* [PLAT-23]: render collection sidebar (#4097)

* [PLAT-22] Refactor Collection and Runtime Variables to use Buffered Redux State (#4098)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* runtime variables

* runtime variables

* firebase fix

* fixes

* runtime tab

* runtime

* fixes

* collection variable

* remove extra buffer deps

* fixed bug where buffer was being indexed incorrectly

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* [PLAT-24] fix: new record creation (#4101)

* fix: new record creation

* fix: new env input focus

* fix

* refactor

* Added saveBuffer support (#4102)

* Save undefined origin buffers (#4104)

* Added saveBuffer support

* Add support to save buffers with undefined origin

* [PLAT-26]: sidebar migration (#4105)

* add delete record thunk

* fix: rename collection and api

* fix: move utils

* add upsertRecords

* fix: stack trace

* fix: move

* fix: move

* add duplicate records thunk

* fix: upsert record

* Updated save buffer impl (#4108)

* [PLAT-25] Refactor Collection View and Variable Upsert to use Redux entities (#4109)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* [PLAT-27]: multi-workspace view (#4111)

* fix: switch workspace

* fix: workspace selection click

* fix: workspace loading

* fix: render collection sidebar

* add comment

* fix: env switcher

* add comment

* fix: render env list

* fix: duplicate records

* fix: delete records

* refactor

* fix: move

* fix: select state

* add errored record slice

* fix: errored records

* fix: fallback workspace

* fix

* [PLAT-25] Fix Hotkey Behavior in Collection View Tabs (#4113)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* fixes

* fix: update collection

* Feature/rq arch/http client view (#4122)

* Updated save buffer impl

* large changes for getting things started

* first working version

* Add support for filters in buffers

* Added better handling for saveBuffer

* enabled saving via hotkey

* optimized path checking

* Add support to apply filter when saving buffer

* in save buffer, update referenceId only if origin doesn't exist

* Added isNew and name change

* Add path variables support

* Added back auto generated fields

* Fixed response deleted on save

* Fixed executor and prep service interface

* Added back client code generator

* fixed test rerun

* cleared tsc errors

* cleaned up http client view

* made httpclientview generic

* Added draft support

* Fixed isNew and isPreview with draft

* fixed types in http executor

* removed comments

* [PLAT-30] feat(runner): Implement Redux slice for Collection Runner configuration (#4117)

* runconfig

* fixes

* fixes types

* [PLAT-29]: runner view integration (#4118)

* buffer

* buffer sync

* fix: buffer dirty check (#4121)

* fix: check dirty buffer

* refactor

* Update CollectionRunnerView.tsx

* add register and unregister tab

* fix: collection run order

* cleanup

* clean up

* fix: imports + types

* fix slice

* fix: close secondary buffers

* fix: patch effect

* fix: move buffered entity in runner view context

* save buffer

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Feature/rq arch/script context (#4132)

* fixed variables

* Made executors work direcly with entry than entity

* prepping for gql

* Added support for auto local sync (#4135)

* [PLAT-32]: collection runner + run results migration (#4136)

* add run thunks

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: typo

* fix: collection view container

* fix: collection runner view context

* fix: imports

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* enable executor

* fix

* fix

* fix

* fix: register workflow

* close tab and context

* fix: run abort on tab close

* fix: empty state

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [PLAT-34] Refactor: Migrate example collections import to a Redux slice (#4148)

* Refactor example collections import to Redux slice

- Move example collections import logic to a new Redux slice in
  `features/apiClient/slices/exampleCollections`
- Add selectors, thunks, and types for example collections state
- Update components to use new slice and hooks
- Persist import status and nudge state in Redux
- Register reducer in store and update usage in Daemon and Nudge
  components

* clean up

* fixes

* migrate fixes

* [PLAT-35]: graphQL view migration (#4149)

* fix: introspection

* fix: draft view

* fix: gql view

* fix

* fix: draft request view

* fix: auth change

* fix: url component

* fix: setResponse interface

* fix: types

* fix: save type issue

* comment (#4156)

* [PLAT-33] fix: importers and export (#4177)

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* exporter

* importer

* remove `any`

* fix: type

* fix

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* cleanup (#4178)

* [PLAT-42] fix: tabs cleanup (#4175)

* add tab close middleware

* refactor

* add sentry

* add middleware for api client store

* wip

* refactor

* fix: env delete

* undo

* fix: api delete

* [PLAT-44] feat(api-client): migrate Environment and Collection variable daemons to Redux  (#4180)

* [PLAT-38] feat(variables): Implement custom ordering for environment variables (#4169)

* Fix variable row handling for unique IDs and key updates

Ensure new variable rows use unique IDs and prevent key collisions when
updating variable keys in the environment list.

* Add variablesOrder to environments for custom variable ordering

This introduces a variablesOrder array to environment, collection, and
runtime variable entities, enabling custom display order for variables.
Includes migration logic for backward compatibility and updates all
reducers, selectors, and persistence transforms to support the new
field.

* Add variablesOrder support to environment and collection entities

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* [PLAT-39] Fix buffer slice to apply user edits on source data correctly (#4167)

* [PLAT-46] fix: workspace switch race condition (#4191)

* fix: workspace switch race condition

* refactor

* Refactor EnvironmentView imports and improve save feedback (#4195)

* Add container divs for QueryParamsTable layout styling (#4198)

* Update tab close confirmation message for unsaved changes (#4206)

* PLAT-49 Refactor autoGeneratedFields selector to resolve inherited auth (#4196)

* PLAT-58 Refactor to use useActiveTab instead of useActiveTabId (#4204)

* PLAT-62 Fix runtime variable override in getScopes function (#4209)

* PLAT-57 Refactor API Client empty view to use context for record creation (#4208)

* Refactor API Client empty view to use context for record creation

Update CollectionView to mark buffer as saved on name change. Comment
out buffer update in buffer slice to prevent overwriting current data.
Add "api_client_home" to ApiEntrySource.

* Refactor buffer sync logic and remove redundant markSaved call

- Simplify buffer middleware to sync only relevant buffers based on
  action payload
- Remove unnecessary markSaved dispatch from CollectionView
- Ensure isNew is set to false on syncFromSource

* [PLAT-16] chore: apply code rabbit feedback for API Client migration (#4189)

* CR comments till 40

* CR comments till 40

* rest of the comments addressed

* fixes

* Add Sentry error reporting to API Client components

- Capture exceptions in CollectionOverview, VariablesList, and
  ExampleCollectionsNudge for better error tracking
- Add revertChanges action to buffer slice and update HTTP/GraphQL views
  to use it
- Replace generic errors with EntityNotFound in requestViewTabSource
- Remove redundant error handling in switchToPrivateWorkspace

* [QA-77] fix: collection runner requests update (#4237)

* fix: collection runner request update

* fix

* fix

* [QA-73] fix: tab close bug for multi-workspace view (#4234)

* Refactor runtime variables to use feature context for workspaceId

* fix: loading state for empty view

* cleanup

* fix: tab close

* fix: delete record thunk condition

* fix: thunks pre condition

* undo

* add comment

---------

Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [QA-82] refactor: buffer middleware to use BufferSyncRemote pattern (#4230)

* Refactor buffer middleware to use BufferSyncRemote pattern

* Refactor buffer middleware for improved type safety and clarity

* rebase

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* QA-76 Fix file input type change to update form state correctly (#4231)

* Fix file input type change to update form state correctly

* Fix multipart form row type change to update value correctly

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Fix variable persistence logic and filter non-persisted variables on (#4222)

rehydrate

* Update auth.ts (#4221)

* fix: workspace context for empty view

* PLAT-63 Refactor APIClientModal to use API client context and buffer (#4213)

* Refactor APIClientModal to use API client context and buffer

* refactor

* cleanup

* Refactor APIClientModal to extract ApiClientSession component

* Fix request body state init for undefined or null body (#4244)

* Broadcast runtime variables sync to all workspace buffers (#4245)

Broadcast a synthetic sync event after updating runtime variables so
workspace buffer middleware can synchronize open buffers with the latest
global state.

* Fix variable sync to delete unset variables in executor factory (#4227)

* Fix variable sync to delete unset variables in executor factory

* Refactor variable retrieval in useRequestExecutorFactory

* QA-66 Refactor runtime variables to use feature context for workspaceId (#4214)

* Refactor runtime variables to use feature context for workspaceId

* Refactor RuntimeVariables to memoize handleTabOpen with useCallback

* Limit collection variables in script context to immediate collection (#4247)

Only expose variables from the direct collection in script execution
context, preventing access to ancestor collection variables. Update
store override logic to match.

* Fix record renaming to update full record object (#4260)

* PLAT-82 Fix race condition when creating workspace context (#4262)

* Fix race condition when creating workspace context

* Remove redundant workspace existence check in addContext

* Plat 98 - fix infinite tab reload (#4261)

* Fix infinite reload loop on workspace switch in multi-tab setup

Prevent tabs from reloading themselves by including tab ID in broadcast
messages and only triggering reloads in other tabs.

* Fix multi-tab infinite reload loop on workspace switch

Prevent workspace broadcast during initialization to avoid tabs
reloading each other infinitely. Now, workspace change broadcasts
only occur on explicit user actions.

* [PLAT-99] fix: daemons (#4263)

* chore: sync hive

* PLAT-70 Fix buffer sync to merge partial updates with remote data (#4251)

* Fix buffer sync to merge partial updates with remote data

* Fix global environment ID translation in local sync mode

* Fix environment update to ignore name field in changes

Update EnvironmentViewManager to use envId for global environments,
ensuring correct buffer reference in local-file mode. Use
isGlobalEnvironment
utility to determine global status in EnvironmentViewTabSource.

* Fix global environment ID handling in buffer sync and thunks

Prefer extracting the real global environment ID from payload or state
instead of using a constant. Use isGlobalEnvironment utility for
consistency in thunks.

* Add bulk buffer sync when action lacks reference ID

When an action does not include a reference ID, sync all buffers
matching the remote's entity types instead of skipping sync.

* Refactor global environment ID handling in EnvironmentDaemon

* fix: collection runner no request issue (#4264)

* Refactor API client importers to use feature context dispatch (#4267)

- Replace useApiClientDispatch with
  getApiClientFeatureContext().store.dispatch
- Update environment import actions to cast as any for type
  compatibility
- Minor formatting and import order improvements

* Refactor HTTP record type checks to use isHttpApiRecord utility (#4268)

* Runner Fix: Use shallowEqual in useAllDescendantApiRecordIds (#4273)

* Restore activeEnvironmentId from persisted state on rehydrate (#4257)

* [PLAT-86] fix: api client home page card (#4278)

* PLAT-89 Refactor variable editing to support ancestor collection scopes (#4250)

* Refactor variable editing to support ancestor collection scopes

Allow EditVariableView to edit variables from ancestor collections by
passing explicit scopeId and scopeName to useVariableScopeAdapter.
Update
scope display and icon logic for improved accuracy.

* Pass scopeId to VariablePopover VariableEditor props

* Refactor useVariableScopeAdapter to simplify scopeId and displayName
handling

* [ENGG-5244] added variable list popover

* added components

* added components

* WIP-1

* add DynamicVariableProvider

* add faker provider

* add DynamicVariableResolver

* add resolver

* add comment

* added missed function

* fix: generate method

* removed unused code

* refactor

* add comments

* integrated 5243

* added examples

* added $ sign to dynamic variables

* WIP-1 (#4314)

* WIP-1

* added $ sign to dynamic variables

* addresed review comments

* ENGG-5294

* addresed review comments

* added fix for filtering

* addressed rview comments

* addressed rview comments

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>
rohanmathur91 added a commit that referenced this pull request Feb 17, 2026
* init

* [PLAT-1] feat(api-client): multi-workspace view slice + context registry (#4000)

* add multi-workspace view slice + selectors

* add multi-workspace view reduce in store

* update root type

* add context registry

* fix: selector

* update thunks

* fix: types

* add ApiClientContextService

* add hooks

* fix: make create repo private

* fix: selectors

* fix

* fix: async

* add validateConnection for repo

* update type

* fix: ApiClientContextService

* fix: thunks

* update thunks

* fix: workspace state

* export raw result

* fix: return type

* fix: error

* fix: return

* fix: workspaceId type

* fix: context hooks

* refactor

* fix: result serialization

* feat(api-client): [PLAT-2] Add apiRecords slice for state management (#3993)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Import Fix APi Records redux (#4039)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Update imports to use new hooks file structure

* [PLAT-2] Refactor: Introduce Entity Abstraction for API Client State (#4040)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Add entity abstraction layer for API client records

* Moved to ApiClientEntity model

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* integration part 1 (#4045)

* fix: slice

* add workspace provider

* add setupWorkspaces

* fix: setup state

* fix:  types

* fix: repo creation

* ts ignore

* add comment

* persist selected workspaces

* chore: fix ts config

* wip

* fix: state updates

* fix: workspace deleted case

* fix: private workspace switch

* Fixed type cast and added todo

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* Adding collection variables

* Add variables manager

* Feature/collection variables (#4061)

* Added support for modifying and showing variables

* Add support to hydrate variables

* [PLAT-12]: tabs slice (#4059)

* add tabs slice

* add comment

* add comment

* fix: register workflow interface

* refactor

* fix: workflow abort

* review comments

* cleanup + fix active tab

* fix: selector

* fix: `useHostContext`

* fix: set in tabs slice

* test code

* Feature/rq arch/env variables (#4069)

* moved out variables persistence logic

* Added component to test variables

* adding env slice

* Fixed bug where local value was being set incorrectly

* Made global environment non-nullable

* Add environment variables

* [PLAT-7] feat: Buffer State Management  (#4062)

* feat: Enhance API Client State Management with Buffer and Entity Synchronization

* fix

* fix

* fixes

* Refactor buffer middleware and thunks for improved synchronization and type safety

- Updated buffer middleware to utilize new selectors and handle synchronization of active buffers based on state changes.
- Enhanced thunks to improve type safety by using ThunkDispatch and ensuring proper handling of record creation and updates.
- Cleaned up imports and added type annotations for better clarity and maintainability.

* Add scoped variables (#4074)

* [PLAT-14] feat: persist tab state across sessions (#4073)

* feat: Implement persistent state management for tabs

- Added `persistConfig.ts` to configure persistence for the tabs reducer using redux-persist.
- Introduced `persistTransform.ts` to handle serialization and deserialization of tab state, including error handling with Sentry.
- Updated the store configuration to use the new persisted tabs reducer.

* fix: tab persist

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-13]: tabs isDirty + emit buffer integration (#4071)

* add `useTabBufferIsDirty`

* fix: export

* cleanup: remove debugger

* refactor

* fix: emit buffer updated event

* refactor

* fix: tab isDirty

* address review comments

* refactor(api-client): Improve type safety for common entity setters (#4076)

* fix

* fix

* ref

* Feature/rq arch/runtime variables (#4077)

* Add runtime variables support

* integrate runtime variables with scoped variables

* [PLAT-15] feat: add tab buffer middleware for enhanced state management (#4075)

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* fix: tab buffer middleware

* refactor

* fix: Update existing buffer entity on referenceId match

- Modify bufferSlice to update the current data and reset the diff for existing buffer entities when a matching referenceId is found.
- This change ensures that the buffer state is accurately maintained without creating duplicates.

* fix: type

* fix

* fix: open buffer reducer

* fix: tab buffer middleware

* fix: tab persist

* refactor

* fix: draft request view

* fix: useBufferedEntity

* fix: hydrate buffer

* review comments

* fix tab buffer middleware

* fix: tab close thunks

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-17] Feat: Enhance buffer slice with Immer for patch management (#4084)

* Enhance buffer slice with Immer for patch management

- Integrated Immer's produceWithPatches for efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize patches for better performance and clarity.
- Cleaned up code by removing unnecessary variables and improving readability.
- Ensured backward compatibility and maintained existing functionality.

* Refactor buffer slice to remove unnecessary type assertions

- Simplified the unset and set operations in bufferSlice by removing redundant type assertions.
- Improved code readability and maintainability while ensuring existing functionality remains intact.

* add `WorkspaceIdContext`

* [PLAT-17] ref: Migrate Environment view to use Redux buffer (#4080)

* ref - migration env view

* feat: enhance buffer slice with immer for improved state management

- Integrated immer's produceWithPatches for more efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize immer's patching capabilities.
- Cleaned up code for better readability and maintainability, ensuring consistent handling of buffer entries.
- Enabled patches to streamline state changes and reduce direct mutations.

* ref - migration env view

* ref - migration env view

* Feature/auto generated headers params (#4089)

* Add useAutoGeneratedFields

* Fixed object bug

* don't throw error if all parents of inherit auth

* [PLAT-18]: tabs and env integration (#4086)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* cleanup

* fix: EnvironmentsList

* fix: `useEnvironmentById`

* fix: `GLOBAL_ENVIRONMENT_ID`

* fix: thunks

* fix: handle global env

* fix: TabsContainer

* refactor

* fix: tab title

* fix: find buffer by ref id

* fix: blockers

* fix

* [PLAT-19] Refactor Environment Variables List to Use New Data Structure (#4092)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* fixes

* Fixed auto focus for env view

* fix: blockers

* fix

* fix: new env creation

* fixes

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* cleanup + hook fix (#4096)

* cleanup + hook fix

* fix: workspace provider

* [PLAT-23]: render collection sidebar (#4097)

* [PLAT-22] Refactor Collection and Runtime Variables to use Buffered Redux State (#4098)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* runtime variables

* runtime variables

* firebase fix

* fixes

* runtime tab

* runtime

* fixes

* collection variable

* remove extra buffer deps

* fixed bug where buffer was being indexed incorrectly

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* [PLAT-24] fix: new record creation (#4101)

* fix: new record creation

* fix: new env input focus

* fix

* refactor

* Added saveBuffer support (#4102)

* Save undefined origin buffers (#4104)

* Added saveBuffer support

* Add support to save buffers with undefined origin

* [PLAT-26]: sidebar migration (#4105)

* add delete record thunk

* fix: rename collection and api

* fix: move utils

* add upsertRecords

* fix: stack trace

* fix: move

* fix: move

* add duplicate records thunk

* fix: upsert record

* Updated save buffer impl (#4108)

* [PLAT-25] Refactor Collection View and Variable Upsert to use Redux entities (#4109)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* [PLAT-27]: multi-workspace view (#4111)

* fix: switch workspace

* fix: workspace selection click

* fix: workspace loading

* fix: render collection sidebar

* add comment

* fix: env switcher

* add comment

* fix: render env list

* fix: duplicate records

* fix: delete records

* refactor

* fix: move

* fix: select state

* add errored record slice

* fix: errored records

* fix: fallback workspace

* fix

* [PLAT-25] Fix Hotkey Behavior in Collection View Tabs (#4113)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* fixes

* fix: update collection

* Feature/rq arch/http client view (#4122)

* Updated save buffer impl

* large changes for getting things started

* first working version

* Add support for filters in buffers

* Added better handling for saveBuffer

* enabled saving via hotkey

* optimized path checking

* Add support to apply filter when saving buffer

* in save buffer, update referenceId only if origin doesn't exist

* Added isNew and name change

* Add path variables support

* Added back auto generated fields

* Fixed response deleted on save

* Fixed executor and prep service interface

* Added back client code generator

* fixed test rerun

* cleared tsc errors

* cleaned up http client view

* made httpclientview generic

* Added draft support

* Fixed isNew and isPreview with draft

* fixed types in http executor

* removed comments

* [PLAT-30] feat(runner): Implement Redux slice for Collection Runner configuration (#4117)

* runconfig

* fixes

* fixes types

* [PLAT-29]: runner view integration (#4118)

* buffer

* buffer sync

* fix: buffer dirty check (#4121)

* fix: check dirty buffer

* refactor

* Update CollectionRunnerView.tsx

* add register and unregister tab

* fix: collection run order

* cleanup

* clean up

* fix: imports + types

* fix slice

* fix: close secondary buffers

* fix: patch effect

* fix: move buffered entity in runner view context

* save buffer

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Feature/rq arch/script context (#4132)

* fixed variables

* Made executors work direcly with entry than entity

* prepping for gql

* Added support for auto local sync (#4135)

* [PLAT-32]: collection runner + run results migration (#4136)

* add run thunks

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: typo

* fix: collection view container

* fix: collection runner view context

* fix: imports

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* enable executor

* fix

* fix

* fix

* fix: register workflow

* close tab and context

* fix: run abort on tab close

* fix: empty state

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [PLAT-34] Refactor: Migrate example collections import to a Redux slice (#4148)

* Refactor example collections import to Redux slice

- Move example collections import logic to a new Redux slice in
  `features/apiClient/slices/exampleCollections`
- Add selectors, thunks, and types for example collections state
- Update components to use new slice and hooks
- Persist import status and nudge state in Redux
- Register reducer in store and update usage in Daemon and Nudge
  components

* clean up

* fixes

* migrate fixes

* [PLAT-35]: graphQL view migration (#4149)

* fix: introspection

* fix: draft view

* fix: gql view

* fix

* fix: draft request view

* fix: auth change

* fix: url component

* fix: setResponse interface

* fix: types

* fix: save type issue

* comment (#4156)

* [PLAT-33] fix: importers and export (#4177)

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* exporter

* importer

* remove `any`

* fix: type

* fix

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* cleanup (#4178)

* [PLAT-42] fix: tabs cleanup (#4175)

* add tab close middleware

* refactor

* add sentry

* add middleware for api client store

* wip

* refactor

* fix: env delete

* undo

* fix: api delete

* [PLAT-44] feat(api-client): migrate Environment and Collection variable daemons to Redux  (#4180)

* [PLAT-38] feat(variables): Implement custom ordering for environment variables (#4169)

* Fix variable row handling for unique IDs and key updates

Ensure new variable rows use unique IDs and prevent key collisions when
updating variable keys in the environment list.

* Add variablesOrder to environments for custom variable ordering

This introduces a variablesOrder array to environment, collection, and
runtime variable entities, enabling custom display order for variables.
Includes migration logic for backward compatibility and updates all
reducers, selectors, and persistence transforms to support the new
field.

* Add variablesOrder support to environment and collection entities

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* [PLAT-39] Fix buffer slice to apply user edits on source data correctly (#4167)

* [PLAT-46] fix: workspace switch race condition (#4191)

* fix: workspace switch race condition

* refactor

* Refactor EnvironmentView imports and improve save feedback (#4195)

* Add container divs for QueryParamsTable layout styling (#4198)

* Update tab close confirmation message for unsaved changes (#4206)

* PLAT-49 Refactor autoGeneratedFields selector to resolve inherited auth (#4196)

* PLAT-58 Refactor to use useActiveTab instead of useActiveTabId (#4204)

* PLAT-62 Fix runtime variable override in getScopes function (#4209)

* PLAT-57 Refactor API Client empty view to use context for record creation (#4208)

* Refactor API Client empty view to use context for record creation

Update CollectionView to mark buffer as saved on name change. Comment
out buffer update in buffer slice to prevent overwriting current data.
Add "api_client_home" to ApiEntrySource.

* Refactor buffer sync logic and remove redundant markSaved call

- Simplify buffer middleware to sync only relevant buffers based on
  action payload
- Remove unnecessary markSaved dispatch from CollectionView
- Ensure isNew is set to false on syncFromSource

* [PLAT-16] chore: apply code rabbit feedback for API Client migration (#4189)

* CR comments till 40

* CR comments till 40

* rest of the comments addressed

* fixes

* Add Sentry error reporting to API Client components

- Capture exceptions in CollectionOverview, VariablesList, and
  ExampleCollectionsNudge for better error tracking
- Add revertChanges action to buffer slice and update HTTP/GraphQL views
  to use it
- Replace generic errors with EntityNotFound in requestViewTabSource
- Remove redundant error handling in switchToPrivateWorkspace

* [QA-77] fix: collection runner requests update (#4237)

* fix: collection runner request update

* fix

* fix

* [QA-73] fix: tab close bug for multi-workspace view (#4234)

* Refactor runtime variables to use feature context for workspaceId

* fix: loading state for empty view

* cleanup

* fix: tab close

* fix: delete record thunk condition

* fix: thunks pre condition

* undo

* add comment

---------

Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [QA-82] refactor: buffer middleware to use BufferSyncRemote pattern (#4230)

* Refactor buffer middleware to use BufferSyncRemote pattern

* Refactor buffer middleware for improved type safety and clarity

* rebase

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* QA-76 Fix file input type change to update form state correctly (#4231)

* Fix file input type change to update form state correctly

* Fix multipart form row type change to update value correctly

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Fix variable persistence logic and filter non-persisted variables on (#4222)

rehydrate

* Update auth.ts (#4221)

* fix: workspace context for empty view

* PLAT-63 Refactor APIClientModal to use API client context and buffer (#4213)

* Refactor APIClientModal to use API client context and buffer

* refactor

* cleanup

* Refactor APIClientModal to extract ApiClientSession component

* Fix request body state init for undefined or null body (#4244)

* Broadcast runtime variables sync to all workspace buffers (#4245)

Broadcast a synthetic sync event after updating runtime variables so
workspace buffer middleware can synchronize open buffers with the latest
global state.

* Fix variable sync to delete unset variables in executor factory (#4227)

* Fix variable sync to delete unset variables in executor factory

* Refactor variable retrieval in useRequestExecutorFactory

* QA-66 Refactor runtime variables to use feature context for workspaceId (#4214)

* Refactor runtime variables to use feature context for workspaceId

* Refactor RuntimeVariables to memoize handleTabOpen with useCallback

* Limit collection variables in script context to immediate collection (#4247)

Only expose variables from the direct collection in script execution
context, preventing access to ancestor collection variables. Update
store override logic to match.

* Fix record renaming to update full record object (#4260)

* PLAT-82 Fix race condition when creating workspace context (#4262)

* Fix race condition when creating workspace context

* Remove redundant workspace existence check in addContext

* Plat 98 - fix infinite tab reload (#4261)

* Fix infinite reload loop on workspace switch in multi-tab setup

Prevent tabs from reloading themselves by including tab ID in broadcast
messages and only triggering reloads in other tabs.

* Fix multi-tab infinite reload loop on workspace switch

Prevent workspace broadcast during initialization to avoid tabs
reloading each other infinitely. Now, workspace change broadcasts
only occur on explicit user actions.

* [PLAT-99] fix: daemons (#4263)

* chore: sync hive

* PLAT-70 Fix buffer sync to merge partial updates with remote data (#4251)

* Fix buffer sync to merge partial updates with remote data

* Fix global environment ID translation in local sync mode

* Fix environment update to ignore name field in changes

Update EnvironmentViewManager to use envId for global environments,
ensuring correct buffer reference in local-file mode. Use
isGlobalEnvironment
utility to determine global status in EnvironmentViewTabSource.

* Fix global environment ID handling in buffer sync and thunks

Prefer extracting the real global environment ID from payload or state
instead of using a constant. Use isGlobalEnvironment utility for
consistency in thunks.

* Add bulk buffer sync when action lacks reference ID

When an action does not include a reference ID, sync all buffers
matching the remote's entity types instead of skipping sync.

* Refactor global environment ID handling in EnvironmentDaemon

* fix: collection runner no request issue (#4264)

* Refactor API client importers to use feature context dispatch (#4267)

- Replace useApiClientDispatch with
  getApiClientFeatureContext().store.dispatch
- Update environment import actions to cast as any for type
  compatibility
- Minor formatting and import order improvements

* Refactor HTTP record type checks to use isHttpApiRecord utility (#4268)

* Runner Fix: Use shallowEqual in useAllDescendantApiRecordIds (#4273)

* Restore activeEnvironmentId from persisted state on rehydrate (#4257)

* [PLAT-86] fix: api client home page card (#4278)

* PLAT-89 Refactor variable editing to support ancestor collection scopes (#4250)

* Refactor variable editing to support ancestor collection scopes

Allow EditVariableView to edit variables from ancestor collections by
passing explicit scopeId and scopeName to useVariableScopeAdapter.
Update
scope display and icon logic for improved accuracy.

* Pass scopeId to VariablePopover VariableEditor props

* Refactor useVariableScopeAdapter to simplify scopeId and displayName
handling

* [ENGG-5244] added variable list popover

* added components

* added components

* WIP-1

* add DynamicVariableProvider

* add faker provider

* add DynamicVariableResolver

* add resolver

* add comment

* added missed function

* fix: generate method

* removed unused code

* refactor

* add comments

* integrated 5243

* added examples

* added $ sign to dynamic variables

* WIP-1 (#4314)

* WIP-1

* added $ sign to dynamic variables

* addresed review comments

* ENGG-5294

* addresed review comments

* added fix for filtering

* added params support

* removed float variable

* addressed rview comments

* fixed filter issue

* add variables

* fix

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>
dinex-dev added a commit that referenced this pull request Feb 20, 2026
* init

* [PLAT-1] feat(api-client): multi-workspace view slice + context registry (#4000)

* add multi-workspace view slice + selectors

* add multi-workspace view reduce in store

* update root type

* add context registry

* fix: selector

* update thunks

* fix: types

* add ApiClientContextService

* add hooks

* fix: make create repo private

* fix: selectors

* fix

* fix: async

* add validateConnection for repo

* update type

* fix: ApiClientContextService

* fix: thunks

* update thunks

* fix: workspace state

* export raw result

* fix: return type

* fix: error

* fix: return

* fix: workspaceId type

* fix: context hooks

* refactor

* fix: result serialization

* feat(api-client): [PLAT-2] Add apiRecords slice for state management (#3993)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Import Fix APi Records redux (#4039)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Remove buffer-related hooks and updaters from apiClient slices

* Update imports to use new hooks file structure

* [PLAT-2] Refactor: Introduce Entity Abstraction for API Client State (#4040)

* Add apiRecords slice with selectors, hooks, updaters, and utils

* Refactor API records state and updaters for granular patching

- Remove loading/error from apiRecords state and selectors
- Replace executeCommand with applyPatch using path-based set/unset
- Add pathConverter utils for granular object patching
- Refactor updaters to use SET/DELETE helpers and UpdateCommand types
- Improve type safety and code clarity in selectors and utils

* Add JSDoc comments and improve null checks in tree utils

* Refactor apiClient slices structure and update updaters API

- Move apiClient store/slices and utils to slices/
- Replace true-based delete markers with nulls in updaters and
  pathConverter
- Add hooks and types for apiClient slice state
- Refactor updater base class and request updaters for consistency
- Update DeepPartialWithNull and UpdateCommand types
- Add new pathConverter utility for set/delete operations
- Update imports and usage throughout for new structure

* Add entity abstraction layer for API client records

* Moved to ApiClientEntity model

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* integration part 1 (#4045)

* fix: slice

* add workspace provider

* add setupWorkspaces

* fix: setup state

* fix:  types

* fix: repo creation

* ts ignore

* add comment

* persist selected workspaces

* chore: fix ts config

* wip

* fix: state updates

* fix: workspace deleted case

* fix: private workspace switch

* Fixed type cast and added todo

---------

Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* Adding collection variables

* Add variables manager

* Feature/collection variables (#4061)

* Added support for modifying and showing variables

* Add support to hydrate variables

* [PLAT-12]: tabs slice (#4059)

* add tabs slice

* add comment

* add comment

* fix: register workflow interface

* refactor

* fix: workflow abort

* review comments

* cleanup + fix active tab

* fix: selector

* fix: `useHostContext`

* fix: set in tabs slice

* test code

* Feature/rq arch/env variables (#4069)

* moved out variables persistence logic

* Added component to test variables

* adding env slice

* Fixed bug where local value was being set incorrectly

* Made global environment non-nullable

* Add environment variables

* [PLAT-7] feat: Buffer State Management  (#4062)

* feat: Enhance API Client State Management with Buffer and Entity Synchronization

* fix

* fix

* fixes

* Refactor buffer middleware and thunks for improved synchronization and type safety

- Updated buffer middleware to utilize new selectors and handle synchronization of active buffers based on state changes.
- Enhanced thunks to improve type safety by using ThunkDispatch and ensuring proper handling of record creation and updates.
- Cleaned up imports and added type annotations for better clarity and maintainability.

* Add scoped variables (#4074)

* [PLAT-14] feat: persist tab state across sessions (#4073)

* feat: Implement persistent state management for tabs

- Added `persistConfig.ts` to configure persistence for the tabs reducer using redux-persist.
- Introduced `persistTransform.ts` to handle serialization and deserialization of tab state, including error handling with Sentry.
- Updated the store configuration to use the new persisted tabs reducer.

* fix: tab persist

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-13]: tabs isDirty + emit buffer integration (#4071)

* add `useTabBufferIsDirty`

* fix: export

* cleanup: remove debugger

* refactor

* fix: emit buffer updated event

* refactor

* fix: tab isDirty

* address review comments

* refactor(api-client): Improve type safety for common entity setters (#4076)

* fix

* fix

* ref

* Feature/rq arch/runtime variables (#4077)

* Add runtime variables support

* integrate runtime variables with scoped variables

* [PLAT-15] feat: add tab buffer middleware for enhanced state management (#4075)

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* feat: Add tab buffer middleware for enhanced state management in tabs slice

- Introduced a new middleware to manage tab buffering and entity synchronization.
- Updated the tabs slice to export the new middleware.
- Enhanced the store configuration to include the tab buffer middleware for improved state handling.

* fix: Address CodeRabbit feedback - add buffer reducer and refactor middleware

- Add bufferSlice.reducer to API client store configuration
  Fixes critical issue where buffer.open action had no reducer to handle it

- Refactor getEntityDataFromTabSource to eliminate code duplication
  Consolidate instanceof checks and sourceName fallbacks into single category-based logic
  Remove duplicate request/environment handling code

- Complete TODO for collection sourceName handling
- Remove debugger statement from ApiClientContextService

Addresses feedback from PR #4075

* cleanup

* fix: tab buffer middleware

* refactor

* fix: Update existing buffer entity on referenceId match

- Modify bufferSlice to update the current data and reset the diff for existing buffer entities when a matching referenceId is found.
- This change ensures that the buffer state is accurately maintained without creating duplicates.

* fix: type

* fix

* fix: open buffer reducer

* fix: tab buffer middleware

* fix: tab persist

* refactor

* fix: draft request view

* fix: useBufferedEntity

* fix: hydrate buffer

* review comments

* fix tab buffer middleware

* fix: tab close thunks

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* [PLAT-17] Feat: Enhance buffer slice with Immer for patch management (#4084)

* Enhance buffer slice with Immer for patch management

- Integrated Immer's produceWithPatches for efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize patches for better performance and clarity.
- Cleaned up code by removing unnecessary variables and improving readability.
- Ensured backward compatibility and maintained existing functionality.

* Refactor buffer slice to remove unnecessary type assertions

- Simplified the unset and set operations in bufferSlice by removing redundant type assertions.
- Improved code readability and maintainability while ensuring existing functionality remains intact.

* add `WorkspaceIdContext`

* [PLAT-17] ref: Migrate Environment view to use Redux buffer (#4080)

* ref - migration env view

* feat: enhance buffer slice with immer for improved state management

- Integrated immer's produceWithPatches for more efficient state updates in bufferSlice.
- Refactored applyPatch and update logic to utilize immer's patching capabilities.
- Cleaned up code for better readability and maintainability, ensuring consistent handling of buffer entries.
- Enabled patches to streamline state changes and reduce direct mutations.

* ref - migration env view

* ref - migration env view

* Feature/auto generated headers params (#4089)

* Add useAutoGeneratedFields

* Fixed object bug

* don't throw error if all parents of inherit auth

* [PLAT-18]: tabs and env integration (#4086)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* cleanup

* fix: EnvironmentsList

* fix: `useEnvironmentById`

* fix: `GLOBAL_ENVIRONMENT_ID`

* fix: thunks

* fix: handle global env

* fix: TabsContainer

* refactor

* fix: tab title

* fix: find buffer by ref id

* fix: blockers

* fix

* [PLAT-19] Refactor Environment Variables List to Use New Data Structure (#4092)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* fixes

* Fixed auto focus for env view

* fix: blockers

* fix

* fix: new env creation

* fixes

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* cleanup + hook fix (#4096)

* cleanup + hook fix

* fix: workspace provider

* [PLAT-23]: render collection sidebar (#4097)

* [PLAT-22] Refactor Collection and Runtime Variables to use Buffered Redux State (#4098)

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* cleanup

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* add `useGetSingleModeWorkspace`

* fix: type for workspace selector

* fix: env item

* fix: env list

* fix: sidebar to render env list

* fix: sidebar wrapper to consume workspace

* cleanup

* fix: workspace setup in feature container

* fix: open tab

* cleanup

* cleanup

* fix: container setup

* cleanup

* fix: useCloseActiveTabShortcut

* fix: export

* add `useTabBuffer`

* wip

* cleanup

* Refactor Environment Variables List Component to Use New Data Structure

- Updated `EnvironmentVariablesList` and `VariablesList` components to accept `EnvironmentVariables` and `ApiClientVariables` types.
- Removed unused props and streamlined variable handling logic.
- Enhanced variable management with new methods for adding, deleting, and changing keys in `ApiClientVariables`.
- Improved state management in `EnvironmentView` to reflect changes in variable data and saving logic.
- Added loading and unsaved changes indicators in the `VariablesListHeader` component.

* ref changes to variables

* runtime variables

* runtime variables

* firebase fix

* fixes

* runtime tab

* runtime

* fixes

* collection variable

* remove extra buffer deps

* fixed bug where buffer was being indexed incorrectly

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>

* [PLAT-24] fix: new record creation (#4101)

* fix: new record creation

* fix: new env input focus

* fix

* refactor

* Added saveBuffer support (#4102)

* Save undefined origin buffers (#4104)

* Added saveBuffer support

* Add support to save buffers with undefined origin

* [PLAT-26]: sidebar migration (#4105)

* add delete record thunk

* fix: rename collection and api

* fix: move utils

* add upsertRecords

* fix: stack trace

* fix: move

* fix: move

* add duplicate records thunk

* fix: upsert record

* Updated save buffer impl (#4108)

* [PLAT-25] Refactor Collection View and Variable Upsert to use Redux entities (#4109)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* [PLAT-27]: multi-workspace view (#4111)

* fix: switch workspace

* fix: workspace selection click

* fix: workspace loading

* fix: render collection sidebar

* add comment

* fix: env switcher

* add comment

* fix: render env list

* fix: duplicate records

* fix: delete records

* refactor

* fix: move

* fix: select state

* add errored record slice

* fix: errored records

* fix: fallback workspace

* fix

* [PLAT-25] Fix Hotkey Behavior in Collection View Tabs (#4113)

* collection view

* variable creation flow fix

* fixes

* fixes

* type fix

* noop context

* isNew fix

* cleanup

* fixes

* fixes

* collection fix

* fixes

* fix: update collection

* Feature/rq arch/http client view (#4122)

* Updated save buffer impl

* large changes for getting things started

* first working version

* Add support for filters in buffers

* Added better handling for saveBuffer

* enabled saving via hotkey

* optimized path checking

* Add support to apply filter when saving buffer

* in save buffer, update referenceId only if origin doesn't exist

* Added isNew and name change

* Add path variables support

* Added back auto generated fields

* Fixed response deleted on save

* Fixed executor and prep service interface

* Added back client code generator

* fixed test rerun

* cleared tsc errors

* cleaned up http client view

* made httpclientview generic

* Added draft support

* Fixed isNew and isPreview with draft

* fixed types in http executor

* removed comments

* [PLAT-30] feat(runner): Implement Redux slice for Collection Runner configuration (#4117)

* runconfig

* fixes

* fixes types

* [PLAT-29]: runner view integration (#4118)

* buffer

* buffer sync

* fix: buffer dirty check (#4121)

* fix: check dirty buffer

* refactor

* Update CollectionRunnerView.tsx

* add register and unregister tab

* fix: collection run order

* cleanup

* clean up

* fix: imports + types

* fix slice

* fix: close secondary buffers

* fix: patch effect

* fix: move buffered entity in runner view context

* save buffer

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Feature/rq arch/script context (#4132)

* fixed variables

* Made executors work direcly with entry than entity

* prepping for gql

* Added support for auto local sync (#4135)

* [PLAT-32]: collection runner + run results migration (#4136)

* add run thunks

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: typo

* fix: collection view container

* fix: collection runner view context

* fix: imports

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* enable executor

* fix

* fix

* fix

* fix: register workflow

* close tab and context

* fix: run abort on tab close

* fix: empty state

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [PLAT-34] Refactor: Migrate example collections import to a Redux slice (#4148)

* Refactor example collections import to Redux slice

- Move example collections import logic to a new Redux slice in
  `features/apiClient/slices/exampleCollections`
- Add selectors, thunks, and types for example collections state
- Update components to use new slice and hooks
- Persist import status and nudge state in Redux
- Register reducer in store and update usage in Daemon and Nudge
  components

* clean up

* fixes

* migrate fixes

* [PLAT-35]: graphQL view migration (#4149)

* fix: introspection

* fix: draft view

* fix: gql view

* fix

* fix: draft request view

* fix: auth change

* fix: url component

* fix: setResponse interface

* fix: types

* fix: save type issue

* comment (#4156)

* [PLAT-33] fix: importers and export (#4177)

* [PLAT-31] Feat: Add Redux slices for live run results and run history (#4131)

* init

* fixes

* entity

* fix: run collection command

* add slice into store

* fix

* refactor slice liverun

* type fix

* Update liveRunResult.ts

* fix: collection run and cancel thunks

* refactor

* fix

* fixes

* exporter

* importer

* remove `any`

* fix: type

* fix

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* cleanup (#4178)

* [PLAT-42] fix: tabs cleanup (#4175)

* add tab close middleware

* refactor

* add sentry

* add middleware for api client store

* wip

* refactor

* fix: env delete

* undo

* fix: api delete

* [PLAT-44] feat(api-client): migrate Environment and Collection variable daemons to Redux  (#4180)

* [PLAT-38] feat(variables): Implement custom ordering for environment variables (#4169)

* Fix variable row handling for unique IDs and key updates

Ensure new variable rows use unique IDs and prevent key collisions when
updating variable keys in the environment list.

* Add variablesOrder to environments for custom variable ordering

This introduces a variablesOrder array to environment, collection, and
runtime variable entities, enabling custom display order for variables.
Includes migration logic for backward compatibility and updates all
reducers, selectors, and persistence transforms to support the new
field.

* Add variablesOrder support to environment and collection entities

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* [PLAT-39] Fix buffer slice to apply user edits on source data correctly (#4167)

* [PLAT-46] fix: workspace switch race condition (#4191)

* fix: workspace switch race condition

* refactor

* Refactor EnvironmentView imports and improve save feedback (#4195)

* Add container divs for QueryParamsTable layout styling (#4198)

* Update tab close confirmation message for unsaved changes (#4206)

* PLAT-49 Refactor autoGeneratedFields selector to resolve inherited auth (#4196)

* PLAT-58 Refactor to use useActiveTab instead of useActiveTabId (#4204)

* PLAT-62 Fix runtime variable override in getScopes function (#4209)

* PLAT-57 Refactor API Client empty view to use context for record creation (#4208)

* Refactor API Client empty view to use context for record creation

Update CollectionView to mark buffer as saved on name change. Comment
out buffer update in buffer slice to prevent overwriting current data.
Add "api_client_home" to ApiEntrySource.

* Refactor buffer sync logic and remove redundant markSaved call

- Simplify buffer middleware to sync only relevant buffers based on
  action payload
- Remove unnecessary markSaved dispatch from CollectionView
- Ensure isNew is set to false on syncFromSource

* [PLAT-16] chore: apply code rabbit feedback for API Client migration (#4189)

* CR comments till 40

* CR comments till 40

* rest of the comments addressed

* fixes

* Add Sentry error reporting to API Client components

- Capture exceptions in CollectionOverview, VariablesList, and
  ExampleCollectionsNudge for better error tracking
- Add revertChanges action to buffer slice and update HTTP/GraphQL views
  to use it
- Replace generic errors with EntityNotFound in requestViewTabSource
- Remove redundant error handling in switchToPrivateWorkspace

* [QA-77] fix: collection runner requests update (#4237)

* fix: collection runner request update

* fix

* fix

* [QA-73] fix: tab close bug for multi-workspace view (#4234)

* Refactor runtime variables to use feature context for workspaceId

* fix: loading state for empty view

* cleanup

* fix: tab close

* fix: delete record thunk condition

* fix: thunks pre condition

* undo

* add comment

---------

Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* [QA-82] refactor: buffer middleware to use BufferSyncRemote pattern (#4230)

* Refactor buffer middleware to use BufferSyncRemote pattern

* Refactor buffer middleware for improved type safety and clarity

* rebase

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>

* QA-76 Fix file input type change to update form state correctly (#4231)

* Fix file input type change to update form state correctly

* Fix multipart form row type change to update value correctly

---------

Co-authored-by: Rohan Mathur <mathurrohan04@gmail.com>

* Fix variable persistence logic and filter non-persisted variables on (#4222)

rehydrate

* Update auth.ts (#4221)

* fix: workspace context for empty view

* PLAT-63 Refactor APIClientModal to use API client context and buffer (#4213)

* Refactor APIClientModal to use API client context and buffer

* refactor

* cleanup

* Refactor APIClientModal to extract ApiClientSession component

* Fix request body state init for undefined or null body (#4244)

* Broadcast runtime variables sync to all workspace buffers (#4245)

Broadcast a synthetic sync event after updating runtime variables so
workspace buffer middleware can synchronize open buffers with the latest
global state.

* Fix variable sync to delete unset variables in executor factory (#4227)

* Fix variable sync to delete unset variables in executor factory

* Refactor variable retrieval in useRequestExecutorFactory

* QA-66 Refactor runtime variables to use feature context for workspaceId (#4214)

* Refactor runtime variables to use feature context for workspaceId

* Refactor RuntimeVariables to memoize handleTabOpen with useCallback

* Limit collection variables in script context to immediate collection (#4247)

Only expose variables from the direct collection in script execution
context, preventing access to ancestor collection variables. Update
store override logic to match.

* Fix record renaming to update full record object (#4260)

* PLAT-82 Fix race condition when creating workspace context (#4262)

* Fix race condition when creating workspace context

* Remove redundant workspace existence check in addContext

* Plat 98 - fix infinite tab reload (#4261)

* Fix infinite reload loop on workspace switch in multi-tab setup

Prevent tabs from reloading themselves by including tab ID in broadcast
messages and only triggering reloads in other tabs.

* Fix multi-tab infinite reload loop on workspace switch

Prevent workspace broadcast during initialization to avoid tabs
reloading each other infinitely. Now, workspace change broadcasts
only occur on explicit user actions.

* [PLAT-99] fix: daemons (#4263)

* chore: sync hive

* PLAT-70 Fix buffer sync to merge partial updates with remote data (#4251)

* Fix buffer sync to merge partial updates with remote data

* Fix global environment ID translation in local sync mode

* Fix environment update to ignore name field in changes

Update EnvironmentViewManager to use envId for global environments,
ensuring correct buffer reference in local-file mode. Use
isGlobalEnvironment
utility to determine global status in EnvironmentViewTabSource.

* Fix global environment ID handling in buffer sync and thunks

Prefer extracting the real global environment ID from payload or state
instead of using a constant. Use isGlobalEnvironment utility for
consistency in thunks.

* Add bulk buffer sync when action lacks reference ID

When an action does not include a reference ID, sync all buffers
matching the remote's entity types instead of skipping sync.

* Refactor global environment ID handling in EnvironmentDaemon

* fix: collection runner no request issue (#4264)

* Refactor API client importers to use feature context dispatch (#4267)

- Replace useApiClientDispatch with
  getApiClientFeatureContext().store.dispatch
- Update environment import actions to cast as any for type
  compatibility
- Minor formatting and import order improvements

* Refactor HTTP record type checks to use isHttpApiRecord utility (#4268)

* Runner Fix: Use shallowEqual in useAllDescendantApiRecordIds (#4273)

* Restore activeEnvironmentId from persisted state on rehydrate (#4257)

* [PLAT-86] fix: api client home page card (#4278)

* PLAT-89 Refactor variable editing to support ancestor collection scopes (#4250)

* Refactor variable editing to support ancestor collection scopes

Allow EditVariableView to edit variables from ancestor collections by
passing explicit scopeId and scopeName to useVariableScopeAdapter.
Update
scope display and icon logic for improved accuracy.

* Pass scopeId to VariablePopover VariableEditor props

* Refactor useVariableScopeAdapter to simplify scopeId and displayName
handling

* [PLAT-80]: sidebar showing different requests & collection when switch back to local workspace (#4277)

* fix: context loading + sidebar showing different data

* add workspaces sequentially

* fix: errored workspace in multi-view

* [PLAT-71] chore: capture tabs middleware error (#4279)

* Handle missing ApiClient context during tab buffer cleanup

Skip buffer cleanup if ApiClient context is unavailable, such as during
workspace or auth transitions. Also prevent errors in
CollectionVariablesDaemon
when repository emits variables for collections not present in the
store.

* chore: capture tabs middleware error

* undo

---------

Co-authored-by: Saurabh <saurabh.bh@browserstack.com>

* Wrap TabLabel in div to fix rendering issue

* [PLAT-69]: fix tabs persist (#4281)

* fix: workspace switching

* fix

* fix: tabs persist

---------

Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>

* chore: update feature compatible version (#4282)

* fix: workspace creation

* PLAT-81 Migrate History Tab Source (#4271)

* Migrate History Tab Source

Ensure only one history tab exists at a time and reuse its buffer.
Handle unsaved changes when switching history entries. Refactor
history tab source to include workspace context. Update tab actions
and sidebar/history view logic for new flow.

* Refactor tab system to support singleton tabs via route config

- Add  property to TabRoute and propagate through tab logic
- Remove openOrSwitchHistoryTab thunk; handle History tab as singleton via openBufferedTab
- Track singleton tab IDs in state and clean up on tab close/reset
- Update History tab source and related components for new singleton logic

* Add singleton flag to tabs and improve history save flow

- Add singleton property to TabState and ensure correct tab preview
  handling
- Refactor tab title logic to use singleton flag
- Update history save flow to skip markSaved for history tabs
- Add skipMarkSaved option to saveBuffer and related components
- Refactor entity type detection for history records

* Refactor imports in HistoryView for clarity and order

* Refactor API record creation in history views and list

* feat: add CommonApiClientExporter and CommonApiClientExportModal components

* fix: CodeRabbit suggestions

* feat: move types for exporter in a single file

* [ENGG-5279] feat: OpenAPI export UI touchpoints (#4284)

* feat: OpenAPI export UI touchpoints

* fix: improve error logging in OpenAPI exporter and update export type handling

* feat: add YAML export support and refactor OpenAPI exporter logic

* fix: update exportResult structure from 'file' to 'files'

* refactor: move Sentry tracking to createOpenApiExporter exporter funciton remove useEffect from modal

* remove async from handleExport callback

* fix: update @requestly/alternative-importers to specific GitHub commit for testing

* rollback @requestly/alternative-importers to version 0.0.12

* fix: update export file type labels

* Update alternative-importers package version

---------

Co-authored-by: rohanmathur91 <mathurrohan04@gmail.com>
Co-authored-by: Saurabh <167960286+srbh777@users.noreply.github.com>
Co-authored-by: Rahul Ramteke <iostreamer007@gmail.com>
Co-authored-by: Saurabh <saurabh.bh@browserstack.com>
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