Add run options str - #795
Conversation
sonic16x
commented
Aug 6, 2026
commit: |
✅ Component tests succeed
|
✅ E2E tests succeed
|
| return {...state, repeatLeft: action.payload.repeatLeft}; | ||
| } | ||
| case actionNames.SET_RUN_OPTIONS: { | ||
| console.log('DEBUG payload', action.payload.runOptions); |
| export const runTest = (): RunTestAction => ({type: actionNames.RETRY_TEST}); | ||
| export const setRepeatCount = (repeatCount: number): Action<typeof actionNames.SET_REPEAT_COUNT, {repeatCount: number}> => ({type: actionNames.SET_REPEAT_COUNT, payload: {repeatCount}}); | ||
| export const setRepeatLeft = (repeatLeft: number): Action<typeof actionNames.SET_REPEAT_LEFT, {repeatLeft: number}> => ({type: actionNames.SET_REPEAT_LEFT, payload: {repeatLeft}}); | ||
| export const setRunOptions = (runOptions: RunOptions): Action<typeof actionNames.SET_RUN_OPTIONS, {runOptions: RunOptions}> => ({type: actionNames.SET_RUN_OPTIONS, payload: {runOptions}}); |
There was a problem hiding this comment.
Hmmm, so with this action, every time someone wants to update options, it's first needed to get them, merge and update. What if we had something like this:
type RunOptions = Record<string, string[]>;
const setRunOptions = (namespace: string, options: string[]) => /* ... */This would allow consumers to conveniently update only parts of the state they care about. And having an array instead of string | null allows to both avoid dealing with nulls and have multiple values just in case.
What do you think?
| const opts: string[] = []; | ||
|
|
||
| if (state.repeatCount > 1) { | ||
| opts.push(`x${state.repeatCount}`); |
There was a problem hiding this comment.
Let's use the \times symbol here as well: ×
| } | ||
| }); | ||
|
|
||
| return opts.join('⋅'); |
There was a problem hiding this comment.
nit: maybe let's add spaces around the dot? but that's up to you
|
Also, forgot to mention, let's make the text on the run button slightly brighter. I think we can change opacity from |