Add ui-debugger modes

Summary:
## This diff: Add debugger mode infrastructure

We want to enable infrastructure allowing adding modes in the future without branching client and plugin code

This infra allows for the client to send a message informing flipper about the supported modes (following diffs)

Currently broadcasting mode change event over to the client

Reviewed By: lblasa

Differential Revision: D49385860

fbshipit-source-id: 2db6f65064d1ff7e1f57b2da93c3ed195400fb7f
This commit is contained in:
Sash Zats
2023-09-20 11:37:12 -07:00
committed by Facebook GitHub Bot
parent c3ad4f7180
commit 1c3720fd5c
6 changed files with 104 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ import {Atom} from 'flipper-plugin';
import {debounce} from 'lodash';
import {ClientNode, FrameworkEventType, Id, SnapshotInfo} from '../ClientTypes';
import {
TraversalMode,
LiveClientState,
SelectionSource,
UIActions,
@@ -189,6 +190,11 @@ export function uiActions(
searchTermUpdatedDebounced(searchTerm);
};
const setCurrentTraversalMode = (mode: TraversalMode) => {
tracker.track('traversal-mode-updated', {mode});
uiState.currentTraversalMode.set(mode);
};
return {
onExpandNode,
onCollapseNode,
@@ -207,5 +213,6 @@ export function uiActions(
onExpandAllRecursively,
onCollapseAllRecursively,
ensureAncestorsExpanded,
setCurrentTraversalMode,
};
}