Skip to content

Commit 1718b51

Browse files
authored
fix: edit idea when building on it
feat: add link to parent idea build: remove shebang and call to main script in husky hooks feat: show stack of ideas fix: spacing between response part
1 parent 629abe4 commit 1718b51

File tree

14 files changed

+113
-37
lines changed

14 files changed

+113
-37
lines changed

.husky/commit-msg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
yarn commitlint --edit ${1}

.husky/post-checkout

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
yarn

.husky/post-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
git status

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
yarn pre-commit

.husky/pre-push

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
yarn build

src/config/appDataTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export enum AppDataTypes {
1515
}
1616

1717
export type ResponseData<T = UsefulnessNoveltyRatings> = {
18-
response: string;
18+
response: string | Array<string>;
1919
round?: number;
2020
bot?: boolean;
2121
assistantId?: AssistantId;

src/hooks/useAssistants.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { useAppDataContext } from '@/modules/context/AppDataContext';
1616
import { useSettings } from '@/modules/context/SettingsContext';
1717
import { useTranslation } from 'react-i18next';
1818
import { useActivityContext } from '@/modules/context/ActivityContext';
19+
import { joinMultipleResponses } from './utils/responses';
1920

2021
interface UseAssistantsValues {
2122
generateSingleResponse: () => Promise<ChatbotResponseAppData | undefined>;
@@ -152,8 +153,10 @@ const useAssistants = (): UseAssistantsValues => {
152153
set.data.assistant === persona.id && set.data.round === round - 1,
153154
);
154155
if (assistantSet) {
155-
const responses = assistantSet.data.responses.map(
156-
(r) => allResponses.find(({ id }) => r === id)?.data.response || '',
156+
const responses = assistantSet.data.responses.map((r) =>
157+
joinMultipleResponses(
158+
allResponses.find(({ id }) => r === id)?.data.response || '',
159+
),
157160
);
158161
return promptAssistant(
159162
persona,

src/hooks/utils/responses.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ export const isOwnResponse = (
127127
): boolean =>
128128
response.creator?.id === memberId &&
129129
typeof response.data?.assistantId === 'undefined';
130+
131+
export const joinMultipleResponses = (
132+
response: string | Array<string>,
133+
): string => (typeof response === 'string' ? response : response.join('\n'));

src/langs/en/main.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
},
4949
"RESPONSE_CARD": {
5050
"BUILD_ON_THIS": "Build on this",
51-
"OWN": "You wrote this"
51+
"OWN": "You wrote this",
52+
"AI_GENERATED": "AI generated",
53+
"PARENT_IDEA": "Parent idea"
5254
},
5355
"SETTINGS": {
5456
"TITLE": "Settings",

src/modules/adminPanel/Assistants.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
} from '@/config/prompts';
1212
import useAssistants from '@/hooks/useAssistants';
1313

14+
import { joinMultipleResponses } from '@/hooks/utils/responses';
1415
import { useActivityContext } from '../context/ActivityContext';
1516
import { useSettings } from '../context/SettingsContext';
1617

@@ -37,9 +38,12 @@ const Assistants: FC = () => {
3738
set.data.assistant === persona.id && set.data.round === round - 1,
3839
);
3940
if (assistantSet) {
40-
const responses = assistantSet.data.responses.map(
41-
(r) => allResponses.find(({ id }) => r === id)?.data.response || '',
42-
);
41+
const responses = assistantSet.data.responses
42+
.map(
43+
(r) =>
44+
allResponses.find(({ id }) => r === id)?.data.response || '',
45+
)
46+
.map((r) => joinMultipleResponses(r));
4347
return promptAssistant(
4448
persona,
4549
promptForSingleResponseAndProvideResponses(

0 commit comments

Comments
 (0)