Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CollaborativeInputを作り直し #632

Merged
merged 1 commit into from
Nov 9, 2024
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
3 changes: 0 additions & 3 deletions apps/web-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"localforage": "^1.10.0",
"moment": "^2.29.1",
"pino": "^9.4.0",
"quill": "^1.3.7",
"re-resizable": "^6.9.1",
"react": "^18.3.1",
"react-dnd": "^16.0.0",
Expand All @@ -72,7 +71,6 @@
"react-draggable": "^4.4.4",
"react-konva": "^18.1.1",
"react-markdown": "^8.0.0",
"react-quilljs": "^1.2.17",
"react-rnd": "^10.3.7",
"react-use": "^17.3.1",
"react-virtuoso": "^4.0.0",
Expand Down Expand Up @@ -105,7 +103,6 @@
"@types/color-name": "1.1.5",
"@types/howler": "2.2.12",
"@types/html-escaper": "3.0.2",
"@types/quill": "2.0.14",
"@types/react": "18.3.12",
"@types/react-color": "3.0.12",
"@types/react-dom": "18.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
stateId: string;
};

export const boardEditorModalAtom = atom<BoardEditorModalType | null>(null);

Check warning on line 36 in apps/web-server/src/components/models/room/Room/subcomponents/components/BoardEditorModal/BoardEditorModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

Check warning on line 36 in apps/web-server/src/components/models/room/Room/subcomponents/components/BoardEditorModal/BoardEditorModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

const drawerBaseProps: Partial<ModalProps> = {
width: 600,
Expand Down Expand Up @@ -193,15 +193,12 @@
bufferDuration="default"
size="small"
value={board.name}
onChange={e => {
if (e.previousValue === e.currentValue) {
return;
}
onChange={currentValue => {

Check warning on line 196 in apps/web-server/src/components/models/room/Room/subcomponents/components/BoardEditorModal/BoardEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/BoardEditorModal/BoardEditorModal.tsx#L196

Added line #L196 was not covered by tests
updateBoard(board => {
if (board == null) {
return;
}
board.name = e.currentValue;
board.name = currentValue;

Check warning on line 201 in apps/web-server/src/components/models/room/Room/subcomponents/components/BoardEditorModal/BoardEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/BoardEditorModal/BoardEditorModal.tsx#L201

Added line #L201 was not covered by tests
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
| null;

const characterEditorModalPrimitiveAtom = atom<CharacterEditorModalState | null>(null);
export const characterEditorModalAtom = atom(

Check warning on line 93 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

Check warning on line 93 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
get => get(characterEditorModalPrimitiveAtom),
(get, set, newValue: CharacterEditorModalAction) => {
switch (newValue?.type) {
Expand Down Expand Up @@ -466,15 +466,12 @@
bufferDuration="default"
size="small"
value={character.name}
onChange={e => {
if (e.previousValue === e.currentValue) {
return;
}
onChange={currentValue => {

Check warning on line 469 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx#L469

Added line #L469 was not covered by tests
updateCharacter(character => {
if (character == null) {
return;
}
character.name = e.currentValue;
character.name = currentValue;

Check warning on line 474 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx#L474

Added line #L474 was not covered by tests
});
}}
/>
Expand Down Expand Up @@ -719,12 +716,12 @@
size="small"
bufferDuration="default"
value={character.memo}
onChange={e => {
onChange={currentValue => {

Check warning on line 719 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx#L719

Added line #L719 was not covered by tests
updateCharacter(character => {
if (character == null) {
return;
}
character.memo = e.currentValue;
character.memo = currentValue;

Check warning on line 724 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterEditorModal/CharacterEditorModal.tsx#L724

Added line #L724 was not covered by tests
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,17 +454,14 @@
bufferDuration="default"
size="small"
value={character.state.name}
onChange={e => {
if (e.previousValue === e.currentValue) {
return;
}
onChange={currentValue => {

Check warning on line 457 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterListPanelContent/CharacterListPanelContent.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterListPanelContent/CharacterListPanelContent.tsx#L457

Added line #L457 was not covered by tests
setRoomState(state => {
const targetCharacter =
state.characters?.[character.stateId];
if (targetCharacter == null) {
return;
}
targetCharacter.name = e.currentValue;
targetCharacter.name = currentValue;

Check warning on line 464 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterListPanelContent/CharacterListPanelContent.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterListPanelContent/CharacterListPanelContent.tsx#L464

Added line #L464 was not covered by tests
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

type UpOperation = U<typeof roomTemplate>;

export const characterParameterNamesEditorVisibilityAtom = atom(false);

Check warning on line 24 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

Check warning on line 24 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

type VisibleParameterForm = {
type: 'Bool' | 'Str' | 'Num';
Expand Down Expand Up @@ -97,16 +97,13 @@
size="small"
value={state.name}
bufferDuration={200}
onChange={e => {
if (e.previousValue === e.currentValue) {
return;
}
onChange={currentValue => {

Check warning on line 100 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx#L100

Added line #L100 was not covered by tests
setRoomState(state => {
const targetNumParamName = state.numParamNames?.[key];
if (targetNumParamName == null) {
return;
}
targetNumParamName.name = e.currentValue;
targetNumParamName.name = currentValue;

Check warning on line 106 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx#L106

Added line #L106 was not covered by tests
});
}}
/>
Expand Down Expand Up @@ -152,16 +149,13 @@
size="small"
value={state.name}
bufferDuration={200}
onChange={e => {
if (e.previousValue === e.currentValue) {
return;
}
onChange={currentValue => {

Check warning on line 152 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx#L152

Added line #L152 was not covered by tests
setRoomState(state => {
const targetBoolParamName = state.boolParamNames?.[key];
if (targetBoolParamName == null) {
return;
}
targetBoolParamName.name = e.currentValue;
targetBoolParamName.name = currentValue;

Check warning on line 158 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx#L158

Added line #L158 was not covered by tests
});
}}
/>
Expand Down Expand Up @@ -207,16 +201,13 @@
size="small"
value={state.name}
bufferDuration={200}
onChange={e => {
if (e.previousValue === e.currentValue) {
return;
}
onChange={currentValue => {

Check warning on line 204 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx#L204

Added line #L204 was not covered by tests
setRoomState(state => {
const targetStrParamName = state.strParamNames?.[key];
if (targetStrParamName == null) {
return;
}
targetStrParamName.name = e.currentValue;
targetStrParamName.name = currentValue;

Check warning on line 210 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterParameterNamesEditorModal/CharacterParameterNamesEditorModal.tsx#L210

Added line #L210 was not covered by tests
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { DialogFooter } from '@/components/ui/DialogFooter/DialogFooter';
import { flex, flexColumn, flexRow } from '@/styles/className';

export const characterTagNamesEditorVisibilityAtom = atom(false);

Check warning on line 13 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterTagNamesEditorModal/CharacterTagNamesEditorModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

Check warning on line 13 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterTagNamesEditorModal/CharacterTagNamesEditorModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

export const CharacterTagNamesEditorModal: React.FC = () => {
const [editorVisibility, setEditorVisibility] = useAtom(characterTagNamesEditorVisibilityAtom);
Expand All @@ -30,7 +30,7 @@
disabled={characterTagName == null}
value={characterTagName ?? ''}
bufferDuration="default"
onChange={({ currentValue }) => {
onChange={currentValue => {

Check warning on line 33 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterTagNamesEditorModal/CharacterTagNamesEditorModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterTagNamesEditorModal/CharacterTagNamesEditorModal.tsx#L33

Added line #L33 was not covered by tests
setRoomState(roomState => {
roomState[`characterTag${index}Name`] = currentValue;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
bufferDuration="default"
disabled={character == null}
value={character?.privateVarToml ?? ''}
onChange={e => {
onChange={currentValue => {

Check warning on line 28 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterVarInput/CharacterVarInput.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterVarInput/CharacterVarInput.tsx#L28

Added line #L28 was not covered by tests
if (character == null) {
return;
}
onChange(e.currentValue);
onChange(currentValue);

Check warning on line 32 in apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterVarInput/CharacterVarInput.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/CharacterVarInput/CharacterVarInput.tsx#L32

Added line #L32 was not covered by tests
}}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
size="small"
bufferDuration="default"
value={chatPaletteText ?? ''}
onChange={e => onChange(e.currentValue)}
onChange={currentValue => onChange(currentValue)}

Check warning on line 76 in apps/web-server/src/components/models/room/Room/subcomponents/components/ChatPalettePanelContent/ChatPalettePanelContent.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/ChatPalettePanelContent/ChatPalettePanelContent.tsx#L76

Added line #L76 was not covered by tests
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
const boardState = state(boardTemplate);
type BoardState = State<typeof boardTemplate>;

export const importBoardModalVisibilityAtom = atom(false);

Check warning on line 16 in apps/web-server/src/components/models/room/Room/subcomponents/components/ImportBoardModal/ImportBoardModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

Check warning on line 16 in apps/web-server/src/components/models/room/Room/subcomponents/components/ImportBoardModal/ImportBoardModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

export const ImportBoardModal: React.FC = () => {
const [visibility, setVisibility] = useAtom(importBoardModalVisibilityAtom);
Expand Down Expand Up @@ -90,10 +90,10 @@
<CollaborativeInput
multiline
value={value}
onChange={e => {
setValue(e.currentValue);
onChange={currentValue => {
setValue(currentValue);
}}
bufferDuration="short"

Check warning on line 96 in apps/web-server/src/components/models/room/Room/subcomponents/components/ImportBoardModal/ImportBoardModal.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/ImportBoardModal/ImportBoardModal.tsx#L93-L96

Added lines #L93 - L96 were not covered by tests
placeholder="ここにJSONをペーストしてください。"
/>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
const characterState = state(characterTemplate);
type CharacterState = State<typeof characterTemplate>;

export const importCharacterModalVisibilityAtom = atom(false);

Check warning on line 16 in apps/web-server/src/components/models/room/Room/subcomponents/components/ImportCharacterModal/ImportCharacterModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

Check warning on line 16 in apps/web-server/src/components/models/room/Room/subcomponents/components/ImportCharacterModal/ImportCharacterModal.tsx

View workflow job for this annotation

GitHub Actions / Check lint, prettier, and sort-package-json

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

export const ImportCharacterModal: React.FC = () => {
const [visibility, setVisibility] = useAtom(importCharacterModalVisibilityAtom);
Expand Down Expand Up @@ -92,8 +92,8 @@
<CollaborativeInput
multiline
value={value}
onChange={e => {
setValue(e.currentValue);
onChange={currentValue => {
setValue(currentValue);
}}
bufferDuration="short"
placeholder="ここにJSONをペーストしてください。"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@
value={memo.name}
style={{ width: '100%' }}
placeholder="名前"
onChange={e =>
onChange={currentValue =>

Check warning on line 163 in apps/web-server/src/components/models/room/Room/subcomponents/components/MemosPanelContent/MemosPanelContent.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/MemosPanelContent/MemosPanelContent.tsx#L163

Added line #L163 was not covered by tests
setRoomState(prevState => {
const memo = prevState.memos?.[memoId];
if (memo != null) {
memo.name = e.currentValue;
memo.name = currentValue;

Check warning on line 167 in apps/web-server/src/components/models/room/Room/subcomponents/components/MemosPanelContent/MemosPanelContent.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/MemosPanelContent/MemosPanelContent.tsx#L167

Added line #L167 was not covered by tests
}
})
}
Expand All @@ -177,7 +177,7 @@
bufferDuration="default"
value={memo.text}
placeholder="本文"
onChange={e => {
onChange={currentValue => {

Check warning on line 180 in apps/web-server/src/components/models/room/Room/subcomponents/components/MemosPanelContent/MemosPanelContent.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/MemosPanelContent/MemosPanelContent.tsx#L180

Added line #L180 was not covered by tests
setRoomState(roomState => {
if (roomState.memos == null) {
roomState.memos = {};
Expand All @@ -186,7 +186,7 @@
if (memo == null) {
return;
}
memo.text = e.currentValue;
memo.text = currentValue;

Check warning on line 189 in apps/web-server/src/components/models/room/Room/subcomponents/components/MemosPanelContent/MemosPanelContent.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/MemosPanelContent/MemosPanelContent.tsx#L189

Added line #L189 was not covered by tests
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
size="small"
value={overriddenParameterName ?? ''}
bufferDuration="default"
onChange={({ currentValue }) => {
onChange={currentValue => {

Check warning on line 56 in apps/web-server/src/components/models/room/Room/subcomponents/components/OverriddenParameterNameEditor/OverriddenParameterNameEditor.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/OverriddenParameterNameEditor/OverriddenParameterNameEditor.tsx#L56

Added line #L56 was not covered by tests
onOverriddenParameterNameChange(currentValue);
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
size="small"
bufferDuration="default"
value={state ?? ''}
onChange={e => {
if (e.previousValue === e.currentValue) {
return;
}
onChange(e.currentValue);
onChange={currentValue => {
onChange(currentValue);

Check warning on line 18 in apps/web-server/src/components/models/room/Room/subcomponents/components/PieceEditorMemoRow/PieceEditorMemoRow.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/PieceEditorMemoRow/PieceEditorMemoRow.tsx#L17-L18

Added lines #L17 - L18 were not covered by tests
}}
/>
</TableRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
bufferDuration="default"
size="small"
value={state ?? ''}
onChange={e => {
if (e.previousValue === e.currentValue) {
return;
}
onChange(e.currentValue);
onChange={currentValue => {
onChange(currentValue);

Check warning on line 16 in apps/web-server/src/components/models/room/Room/subcomponents/components/PieceEditorNameRow/PieceEditorNameRow.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/PieceEditorNameRow/PieceEditorNameRow.tsx#L15-L16

Added lines #L15 - L16 were not covered by tests
}}
/>
</TableRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
onChange={e => {
const newValue = produce(value, state => {
// nameがない状態をあらわす値として '' と undefined の2種類が混在するのは後々仕様変更があった際に困るかもしれないため、undefinedで統一させるようにしている
state.name = e.currentValue === '' ? undefined : e.currentValue;
state.name = e === '' ? undefined : e;

Check warning on line 31 in apps/web-server/src/components/models/room/Room/subcomponents/components/RectEditor/RectEditor.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/RectEditor/RectEditor.tsx#L31

Added line #L31 was not covered by tests
});
onChange(newValue);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,9 @@
<CollaborativeInput
bufferDuration="default"
value={publicChannelNames == null ? '' : publicChannelNames[key]}
onChange={e => {
if (e.previousValue === e.currentValue) {
return;
}
onChange={currentValue => {

Check warning on line 383 in apps/web-server/src/components/models/room/Room/subcomponents/components/RoomMessagesPanelContent/RoomMessagesPanelContent.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/RoomMessagesPanelContent/RoomMessagesPanelContent.tsx#L383

Added line #L383 was not covered by tests
operateAsStateWithImmer(state => {
state[key] = e.currentValue;
state[key] = currentValue;

Check warning on line 385 in apps/web-server/src/components/models/room/Room/subcomponents/components/RoomMessagesPanelContent/RoomMessagesPanelContent.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/RoomMessagesPanelContent/RoomMessagesPanelContent.tsx#L385

Added line #L385 was not covered by tests
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
bufferDuration="default"
disabled={disabled}
value={parameter?.value ?? ''}
onChange={e => {
onChange={currentValue => {

Check warning on line 70 in apps/web-server/src/components/models/room/Room/subcomponents/components/StringParameterInput/StringParameterInput.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/StringParameterInput/StringParameterInput.tsx#L70

Added line #L70 was not covered by tests
// valueで??演算子を使用しているため、e.previousValueは使えない。そのため代わりにparameter?.valueを使用している
const previousValue = parameter?.value;

if (previousValue === e.currentValue) {
if (previousValue === currentValue) {

Check warning on line 74 in apps/web-server/src/components/models/room/Room/subcomponents/components/StringParameterInput/StringParameterInput.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/StringParameterInput/StringParameterInput.tsx#L74

Added line #L74 was not covered by tests
return;
}
const diff2 = nullableTextDiff({ prev: previousValue, next: e.currentValue });
const diff2 = nullableTextDiff({ prev: previousValue, next: currentValue });

Check warning on line 77 in apps/web-server/src/components/models/room/Room/subcomponents/components/StringParameterInput/StringParameterInput.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/StringParameterInput/StringParameterInput.tsx#L77

Added line #L77 was not covered by tests
const operation: CharacterUpOperation = {
$v: 2,
$r: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
bufferDuration="default"
size="small"
value={state.value}
onChange={({ currentValue }) => {
onChange={currentValue => {

Check warning on line 157 in apps/web-server/src/components/models/room/Room/subcomponents/components/StringPieceEditor/StringPieceEditor.tsx

View check run for this annotation

Codecov / codecov/patch

apps/web-server/src/components/models/room/Room/subcomponents/components/StringPieceEditor/StringPieceEditor.tsx#L157

Added line #L157 was not covered by tests
updateState(state => {
if (state == null) {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

.collaborative-input {
/* Ant Design の Input の色と等しい */
background-color: #141414;
/* Ant Design の Input の色と等しい */
color: rgba(255, 255, 255, 0.85);
border: 1px solid #333;
border-radius: 6px;
}

.collaborative-input:focus {
outline: none;
border: 1px solid #0078d4;
}

.collaborative-input.very-small {
font-size: 0.7rem;
padding: 2px 4px;
}

.collaborative-input.small {
font-size: 0.75rem;
padding: 2px 4px;
}

.collaborative-input.medium {
font-size: 0.8rem;
padding: 4px 8px;
}

.collaborative-input.disabled {
color: gray;
cursor: not-allowed;
}
Loading
Loading