Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/src/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export const Layout = {
export const MaxNoteNumber = 127

export const WHEEL_SCROLL_RATE = 1 / 120

export const DEFAULT_TEMPO = 120
4 changes: 4 additions & 0 deletions app/src/components/inputs/NumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export const NumberInput: FC<NumberInputProps> = ({
if (e.key === "Enter") {
onEnter?.()
}
if (e.key === "Escape") {
// blur on escape to trigger onBlur validation
;(e.target as HTMLElement).blur()
}
}}
min={min}
max={max}
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/ui/RadioButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const RowWrapper = styled.div`
padding: 0.5rem 0;
align-items: center;

&:hover ${Button} {
&:hover [data-radio-button] {
border-color: var(--color-text-secondary);
}
`
Expand All @@ -47,7 +47,7 @@ export const RadioButton: FC<RadioButtonProps> = ({
}) => {
return (
<RowWrapper onClick={onClick}>
<Button>{isSelected && <CheckIcon />}</Button>
<Button data-radio-button>{isSelected && <CheckIcon />}</Button>
<RowLabel>{label}</RowLabel>
</RowWrapper>
)
Expand Down
3 changes: 2 additions & 1 deletion app/src/hooks/useConductorTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from "@signal-app/core"
import { isEqual } from "lodash"
import { useCallback, useMemo } from "react"
import { DEFAULT_TEMPO } from "../Constants"
import { useMobxGetter, useMobxSelector } from "./useMobxSelector"
import { usePlayer } from "./usePlayer"
import { useSong } from "./useSong"
Expand Down Expand Up @@ -34,7 +35,7 @@ export function useConductorTrack() {
get currentTempo() {
const { position } = usePlayer()
return useMobxSelector(
() => conductorTrack?.getTempo(position) ?? 0,
() => conductorTrack?.getTempo(position) ?? DEFAULT_TEMPO,
[conductorTrack, position],
)
},
Expand Down