From eec8ef251b5d1353f87075fe732757e48248842a Mon Sep 17 00:00:00 2001 From: duck_master Date: Tue, 5 Aug 2025 01:10:16 -0400 Subject: [PATCH 1/6] run prettier --- web/components/answers/compatibility-questions-display.tsx | 5 ++--- web/components/layout/tabs.tsx | 5 +++-- web/components/required-lover-form.tsx | 5 ++++- web/components/widgets/choices-toggle-group.tsx | 5 +++-- web/pages/profile.tsx | 5 ++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/web/components/answers/compatibility-questions-display.tsx b/web/components/answers/compatibility-questions-display.tsx index da0b898..02e40f8 100644 --- a/web/components/answers/compatibility-questions-display.tsx +++ b/web/components/answers/compatibility-questions-display.tsx @@ -407,7 +407,7 @@ function CompatibilityAnswerBlock(props: { {answerText} - + {answer.explanation && ( )} @@ -419,7 +419,7 @@ function CompatibilityAnswerBlock(props: { ? 'Acceptable' : 'Also acceptable'} - + {distinctPreferredAnswersText.map((text) => ( )} - {comparedLover && ( diff --git a/web/components/required-lover-form.tsx b/web/components/required-lover-form.tsx index cf6454d..98d75ea 100644 --- a/web/components/required-lover-form.tsx +++ b/web/components/required-lover-form.tsx @@ -47,7 +47,10 @@ export const RequiredLoveUserForm = (props: { setEditUsername?: (name: string) => unknown setEditDisplayName?: (name: string) => unknown lover: LoverRow - setLover: >(key: K, value: LoverRow[K] | undefined) => void + setLover: >( + key: K, + value: LoverRow[K] | undefined + ) => void isSubmitting: boolean onSubmit?: () => void loverCreatedAlready?: boolean diff --git a/web/components/widgets/choices-toggle-group.tsx b/web/components/widgets/choices-toggle-group.tsx index cf05fa8..928e220 100644 --- a/web/components/widgets/choices-toggle-group.tsx +++ b/web/components/widgets/choices-toggle-group.tsx @@ -13,8 +13,9 @@ const colorClasses = { export type ColorType = keyof typeof colorClasses -export function ChoicesToggleGroup>( - props: { +export function ChoicesToggleGroup< + T extends Record +>(props: { currentChoice: T[keyof T] | undefined choicesMap: T disabled?: boolean diff --git a/web/pages/profile.tsx b/web/pages/profile.tsx index 9cf2e66..6acb12a 100644 --- a/web/pages/profile.tsx +++ b/web/pages/profile.tsx @@ -30,7 +30,10 @@ function ProfilePageInner(props: { user: User; lover: Lover }) { user, }) - const setLoverState = > (key: K, value: LoverRow[K] | undefined) => { + const setLoverState = >( + key: K, + value: LoverRow[K] | undefined + ) => { setLover((prevState) => ({ ...prevState, [key]: value })) } From 716a0241e22b120e744549cea543a9ef3fcd2383 Mon Sep 17 00:00:00 2001 From: duck_master Date: Tue, 5 Aug 2025 01:37:59 -0400 Subject: [PATCH 2/6] refactor to comment out or avoid unused variables --- .../answers/free-response-add-question.tsx | 2 +- web/components/browse-matches-button.tsx | 14 +++++++------- web/components/filters/location-filter.tsx | 2 +- web/components/love-page.tsx | 4 ++-- web/components/widgets/searchable-select.tsx | 2 +- web/components/widgets/user-link.tsx | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/web/components/answers/free-response-add-question.tsx b/web/components/answers/free-response-add-question.tsx index caaf66a..c9ca914 100644 --- a/web/components/answers/free-response-add-question.tsx +++ b/web/components/answers/free-response-add-question.tsx @@ -22,7 +22,7 @@ export function AddQuestionButton(props: { user: User refreshAnswers: () => void }) { - const { isFirstQuestion, questions, user, refreshAnswers } = props + const { /*isFirstQuestion,*/ questions, user, refreshAnswers } = props const [openModal, setOpenModal] = usePersistentInMemoryState( false, `add-question-${user.id}` diff --git a/web/components/browse-matches-button.tsx b/web/components/browse-matches-button.tsx index 7b859be..eb97306 100644 --- a/web/components/browse-matches-button.tsx +++ b/web/components/browse-matches-button.tsx @@ -38,11 +38,11 @@ export const BrowseMatchesButton = (props: { placeholder: 'Write your introduction...', }) - const [isSubmitting, setIsSubmitting] = useState(false) + const [isSubmitting /*, setIsSubmitting*/] = useState(false) const submit = async () => { - const introduction = - (editor?.getCharacterCount() ?? 0) > 0 ? editor?.getJSON() : undefined + //const introduction = + ;(editor?.getCharacterCount() ?? 0) > 0 ? editor?.getJSON() : undefined // setIsSubmitting(true) // const result = await createMatch({ @@ -107,14 +107,14 @@ const BrowseMatchesDialog = (props: { lover, potentialLovers, compatibilityScores, - isSubmitting, + //isSubmitting, setOpen, - submit, - editor, + //submit, + //editor, } = props const [query, setQuery] = useState('') - const [error, setError] = useState(undefined) + //const [error, setError] = useState(undefined) const currentUser = useUser() const isCurrentUser = currentUser?.id === lover.user_id diff --git a/web/components/filters/location-filter.tsx b/web/components/filters/location-filter.tsx index 28b0069..5efcf86 100644 --- a/web/components/filters/location-filter.tsx +++ b/web/components/filters/location-filter.tsx @@ -28,7 +28,7 @@ export function LocationFilterText(props: { radius: number highlightedClass?: string }) { - const { location, youLover, radius, highlightedClass } = props + const { location, /*youLover,*/ radius, highlightedClass } = props if (!location) { return ( diff --git a/web/components/love-page.tsx b/web/components/love-page.tsx index ac15ef6..1be577a 100644 --- a/web/components/love-page.tsx +++ b/web/components/love-page.tsx @@ -45,7 +45,7 @@ export function LovePage(props: { const bottomNavOptions = user ? getBottomNavigation(user, lover) : signedOutNavigation() - const [isModalOpen, setIsModalOpen] = useState(false) + //const [isModalOpen, setIsModalOpen] = useState(false) const desktopSidebarOptions = getDesktopNav(user) const mobileSidebarOptions = user @@ -55,7 +55,7 @@ export function LovePage(props: { // eslint-disable-next-line react-hooks/rules-of-hooks trackPageView && useTracking(`view love ${trackPageView}`, trackPageProps) useOnline() - const [isAddFundsModalOpen, setIsAddFundsModalOpen] = useState(false) + const [, /*isAddFundsModalOpen*/ setIsAddFundsModalOpen] = useState(false) return ( <> diff --git a/web/components/widgets/searchable-select.tsx b/web/components/widgets/searchable-select.tsx index bd31144..fe3a0a8 100644 --- a/web/components/widgets/searchable-select.tsx +++ b/web/components/widgets/searchable-select.tsx @@ -52,7 +52,7 @@ export function SearchableSelect(props: { return ( - {({ open, close }) => ( + {({ close, ..._ }) => ( <> Bot ) -} +}*/ export function BannedBadge() { return ( From 30bdbddd7a8e21a7d87c225037a2bb498024c334 Mon Sep 17 00:00:00 2001 From: duck_master Date: Tue, 5 Aug 2025 02:14:03 -0400 Subject: [PATCH 3/6] create .github/workflows/ci-web.yml --- .github/workflows/ci-web.yml | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci-web.yml diff --git a/.github/workflows/ci-web.yml b/.github/workflows/ci-web.yml new file mode 100644 index 0000000..8f64489 --- /dev/null +++ b/.github/workflows/ci-web.yml @@ -0,0 +1,54 @@ +name: CI checks for web workspace + +on: + push: + branches: ['main'] + paths: ['web/**/*', '!**/*.{txt,md}'] + pull_request: + branches: ['main'] + paths: ['web/**/*', '!**/*.{txt,md}'] + +defaults: + run: + working-directory: 'web' + +jobs: + Prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '24.3.0' + cache: npm + cache-dependency-path: 'package.json' + - name: Install everything + run: npm ci + - name: Run prettier + run: yarn prettier . --check --ignore-unknown + ESLint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '24.3.0' + cache: npm + cache-dependency-path: 'package.json' + - name: Install everything + run: npm ci + - name: Run ESLint + run: yarn eslint . + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '24.3.0' + cache: npm + cache-dependency-path: 'package.json' + - name: Install everything + run: npm ci + - name: Compile with tsc + run: yarn tsc --pretty --project tsconfig.json --noEmit From fad750ec0d4e0e69914acc35c3a5eeda8c905d6d Mon Sep 17 00:00:00 2001 From: duck_master Date: Tue, 5 Aug 2025 21:50:39 -0400 Subject: [PATCH 4/6] make yarn installation a separate step --- .github/workflows/ci-web.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-web.yml b/.github/workflows/ci-web.yml index 8f64489..e0e981e 100644 --- a/.github/workflows/ci-web.yml +++ b/.github/workflows/ci-web.yml @@ -22,8 +22,10 @@ jobs: node-version: '24.3.0' cache: npm cache-dependency-path: 'package.json' - - name: Install everything - run: npm ci + - name: Install yarn + run: npm install -g yarn + - name: Install dependencies + run: yarn install --immutable - name: Run prettier run: yarn prettier . --check --ignore-unknown ESLint: @@ -35,8 +37,10 @@ jobs: node-version: '24.3.0' cache: npm cache-dependency-path: 'package.json' - - name: Install everything - run: npm ci + - name: Install yarn + run: npm install -g yarn + - name: Install dependencies + run: yarn install --immutable - name: Run ESLint run: yarn eslint . typecheck: @@ -48,7 +52,9 @@ jobs: node-version: '24.3.0' cache: npm cache-dependency-path: 'package.json' - - name: Install everything - run: npm ci + - name: Install yarn + run: npm install -g yarn + - name: Install dependencies + run: yarn install --immutable - name: Compile with tsc - run: yarn tsc --pretty --project tsconfig.json --noEmit + run: yarn tsc --noEmit --strict From db43095e354c141de9df2b4e972e52edff04a6f1 Mon Sep 17 00:00:00 2001 From: duck_master Date: Wed, 6 Aug 2025 19:06:02 -0400 Subject: [PATCH 5/6] make yarn install NOT immutable --- .github/workflows/ci-web.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-web.yml b/.github/workflows/ci-web.yml index e0e981e..3e5a078 100644 --- a/.github/workflows/ci-web.yml +++ b/.github/workflows/ci-web.yml @@ -25,7 +25,7 @@ jobs: - name: Install yarn run: npm install -g yarn - name: Install dependencies - run: yarn install --immutable + run: yarn install - name: Run prettier run: yarn prettier . --check --ignore-unknown ESLint: @@ -40,7 +40,7 @@ jobs: - name: Install yarn run: npm install -g yarn - name: Install dependencies - run: yarn install --immutable + run: yarn install - name: Run ESLint run: yarn eslint . typecheck: @@ -55,6 +55,6 @@ jobs: - name: Install yarn run: npm install -g yarn - name: Install dependencies - run: yarn install --immutable + run: yarn install - name: Compile with tsc run: yarn tsc --noEmit --strict From c16d210cbf1bba004689fda8d022376899eddf94 Mon Sep 17 00:00:00 2001 From: duck_master Date: Thu, 14 Aug 2025 19:29:05 -0400 Subject: [PATCH 6/6] switch caching to yarn and node version to lts/* for CI --- .github/workflows/ci-web.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-web.yml b/.github/workflows/ci-web.yml index 3e5a078..efc3b22 100644 --- a/.github/workflows/ci-web.yml +++ b/.github/workflows/ci-web.yml @@ -19,9 +19,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '24.3.0' - cache: npm - cache-dependency-path: 'package.json' + node-version: 'lts/*' # TODO: determine version used in production server + cache: yarn + cache-dependency-path: 'yarn.lock' - name: Install yarn run: npm install -g yarn - name: Install dependencies @@ -34,9 +34,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '24.3.0' - cache: npm - cache-dependency-path: 'package.json' + node-version: 'lts/*' + cache: yarn + cache-dependency-path: 'yarn.lock' - name: Install yarn run: npm install -g yarn - name: Install dependencies @@ -49,9 +49,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '24.3.0' - cache: npm - cache-dependency-path: 'package.json' + node-version: 'lts/*' + cache: yarn + cache-dependency-path: 'yarn.lock' - name: Install yarn run: npm install -g yarn - name: Install dependencies