Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

Commit 9a1cb4f

Browse files
committed
Identify actions from "the future"
1 parent 3473260 commit 9a1cb4f

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/ActionList.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class ActionList extends Component {
3737

3838
render() {
3939
const { styling, actions, actionIds, isWideLayout, onToggleAction, skippedActionIds,
40-
selectedActionId, startActionId, onSelect, onSearch, searchValue,
40+
selectedActionId, startActionId, onSelect, onSearch, searchValue, currentActionId,
4141
onCommit, onSweep } = this.props;
4242
const lowerSearchValue = searchValue && searchValue.toLowerCase();
4343
const filteredActionIds = searchValue ? actionIds.filter(
@@ -63,6 +63,7 @@ export default class ActionList extends Component {
6363
actionId >= startActionId && actionId <= selectedActionId ||
6464
actionId === selectedActionId
6565
}
66+
isInFuture={actionId > currentActionId}
6667
onSelect={(e) => onSelect(e, actionId)}
6768
timestamps={getTimestamps(actions, actionIds, actionId)}
6869
action={actions[actionId].action}

src/ActionListRow.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default class ActionListRow extends Component {
1212
styling: PropTypes.func.isRequired,
1313
isSelected: PropTypes.bool.isRequired,
1414
action: PropTypes.shape({ type: PropTypes.string.isRequired }).isRequired,
15+
isInFuture: PropTypes.bool.isRequired,
1516
isInitAction: PropTypes.bool.isRequired,
1617
onSelect: PropTypes.func.isRequired,
1718
timestamps: PropTypes.shape({
@@ -33,7 +34,7 @@ export default class ActionListRow extends Component {
3334

3435
render() {
3536
const { styling, isSelected, action, isInitAction, onSelect,
36-
timestamps, isSkipped } = this.props;
37+
timestamps, isSkipped, isInFuture } = this.props;
3738
const { hover } = this.state;
3839
const timeDelta = timestamps.current - timestamps.previous;
3940
const showButtons = hover && !isInitAction || isSkipped;
@@ -48,7 +49,8 @@ export default class ActionListRow extends Component {
4849
{...styling([
4950
'actionListItem',
5051
isSelected && 'actionListItemSelected',
51-
isSkipped && 'actionListItemSkipped'
52+
isSkipped && 'actionListItemSkipped',
53+
isInFuture && 'actionListFromFuture'
5254
], isSelected, action)}>
5355
<div {...styling(['actionListItemName', isSkipped && 'actionListItemNameSkipped'])}>
5456
{action.type}

src/DevtoolsInspector.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function getLastActionId(props) {
1717

1818
function getCurrentActionId(props, monitorState) {
1919
return monitorState.selectedActionId === null ?
20-
getLastActionId(props) : monitorState.selectedActionId;
20+
props.stagedActionIds[props.currentStateIndex] : monitorState.selectedActionId;
2121
}
2222

2323
function getFromState(actionIndex, stagedActionIds, computedStates, monitorState) {
@@ -149,10 +149,12 @@ export default class DevtoolsInspector extends Component {
149149

150150
render() {
151151
const { stagedActionIds: actionIds, actionsById: actions, computedStates,
152-
tabs, invertTheme, skippedActionIds, monitorState } = this.props;
152+
tabs, invertTheme, skippedActionIds, currentStateIndex, monitorState } = this.props;
153153
const { selectedActionId, startActionId, searchValue, tabName } = monitorState;
154154
const inspectedPathType = tabName === 'Action' ? 'inspectedActionPath' : 'inspectedStatePath';
155-
const { themeState, isWideLayout, action, nextState, delta, error } = this.state;
155+
const {
156+
themeState, isWideLayout, action, nextState, delta, error
157+
} = this.state;
156158
const { base16Theme, styling } = themeState;
157159

158160
return (
@@ -169,6 +171,7 @@ export default class DevtoolsInspector extends Component {
169171
onCommit={this.handleCommit}
170172
onSweep={this.handleSweep}
171173
skippedActionIds={skippedActionIds}
174+
currentActionId={actionIds[currentStateIndex]}
172175
lastActionId={getLastActionId(this.props)} />
173176
<ActionPreview {...{
174177
base16Theme, invertTheme, isWideLayout, tabs, tabName, delta, error, nextState,

src/utils/createStylingFromTheme.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ const getSheetFromColorMap = map => ({
120120
'background-color': map.SKIPPED_BACKGROUND_COLOR
121121
},
122122

123+
actionListFromFuture: {
124+
opacity: '0.6'
125+
},
126+
123127
actionListItemButtons: {
124128
position: 'relative',
125129
height: '20px',

0 commit comments

Comments
 (0)