Skip to content

Commit dcd1cd5

Browse files
fix(overmind-devtools): fix actions list size
1 parent 2eedae7 commit dcd1cd5

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

packages/node_modules/overmind-devtools/backend/dev.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
<script>
3838
async function checkDev() {
3939
try {
40-
const response = await fetch('http://localhost:3000')
40+
const response = await fetch('http://localhost:3333')
4141

4242
if (response.status >= 200 && response.status < 300) {
43-
location.href = 'http://localhost:3000'
43+
location.href = 'http://localhost:3333'
4444
} else {
4545
setTimeout(checkDev, 250)
4646
}

packages/node_modules/overmind-devtools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"overmind-devtools": "bin.js"
1010
},
1111
"scripts": {
12-
"start": "concurrently \"electron ./backend/main\" \"webpack-dev-server --port 3000\"",
12+
"start": "concurrently \"electron ./backend/main\" \"webpack-dev-server --port 3333\"",
1313
"build": "webpack",
1414
"typecheck": "tsc --noEmit",
1515
"test": "jest --runInBand",

packages/node_modules/overmind-devtools/src/components/ActionOperator/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const effectArgs = css({
1818

1919
export const value = css({
2020
marginLeft: 'auto',
21+
marginRight: '0.5rem',
2122
display: 'flex',
2223
alignItems: 'center',
2324
})

packages/node_modules/overmind-devtools/src/components/ActionSelector/index.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createElement, FunctionComponent, Fragment } from 'react'
22
import * as styles from './styles'
33
import { useOvermind } from '../../overmind'
44
import { nameToColor } from '../../overmind/utils'
5+
import { css } from 'emotion'
56

67
const ActionSelector: FunctionComponent = () => {
78
const { state, actions } = useOvermind()
@@ -20,16 +21,31 @@ const ActionSelector: FunctionComponent = () => {
2021
/>
2122

2223
<div className={styles.inputWrapper}>
23-
<div className={styles.suggestion}>{app.actionQuerySuggestion}</div>
24+
<div
25+
className={css(
26+
styles.suggestion,
27+
app.actionQuery.length ? styles.inputActive : null
28+
)}
29+
>
30+
{app.actionQuerySuggestion}
31+
</div>
2432
<input
2533
autoFocus
2634
placeholder="Search for action..."
2735
onBlur={() => actions.toggleQueryingAction()}
28-
className={styles.input}
36+
className={css(
37+
styles.input,
38+
app.actionQuery.length ? styles.inputActive : null
39+
)}
2940
value={app.actionQuery}
3041
onChange={(event) =>
3142
actions.changeActionQuery(event.currentTarget.value)
3243
}
44+
onKeyDown={(event) => {
45+
if (event.keyCode === 13) {
46+
actions.submitQueryAction()
47+
}
48+
}}
3349
/>
3450
</div>
3551
<div className={styles.resultWrapper}>

packages/node_modules/overmind-devtools/src/components/ActionSelector/styles.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,16 @@ export const input = css({
4040
},
4141
})
4242

43+
export const inputActive = css({
44+
paddingLeft: '1.5rem',
45+
})
46+
4347
export const suggestion = css({
4448
position: 'absolute',
4549
display: 'flex',
4650
alignItems: 'center',
51+
height: '100%',
52+
boxSizing: 'border-box',
4753
left: '-1rem',
4854
fontSize: 16,
4955
padding: '0.5rem',
@@ -68,7 +74,9 @@ export const noSelectedAction = css({
6874
export const resultWrapper = css({
6975
position: 'absolute',
7076
top: '100%',
71-
width: '100%',
77+
minWidth: '100%',
78+
maxHeight: '75vh',
79+
overflowY: 'scroll',
7280
left: 0,
7381
backgroundColor: colors.dark3,
7482
borderBottomLeftRadius: 3,

packages/node_modules/overmind-devtools/src/components/Inspector/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ const ValueComponent: FunctionComponent<ValueComponentProps> = ({
224224
{path[path.length - 1]}:
225225
</span>
226226
) : null}
227-
"{value}"
227+
"{value.length > 50 ? value.substr(0, 50) + '...' : value}"
228228
</div>
229229
)
230230
}

0 commit comments

Comments
 (0)