From 08533f4d1f24fa9fbd187a86bc1e83d9b2b45783 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 8 May 2024 00:10:54 +0300 Subject: [PATCH 1/6] debug-author-profile --- src/components/Views/Author/Author.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/Views/Author/Author.tsx b/src/components/Views/Author/Author.tsx index 79140961..3d102df9 100644 --- a/src/components/Views/Author/Author.tsx +++ b/src/components/Views/Author/Author.tsx @@ -76,17 +76,24 @@ export const AuthorView = (props: Props) => { const fetchData = async (slug: string) => { try { - const [subscriptionsResult, followersResult, authorResult] = await Promise.all([ + const [followsResult, followersResult, authorResult] = await Promise.all([ apiClient.getAuthorFollows({ slug }), apiClient.getAuthorFollowers({ slug }), loadAuthor({ slug }), ]) - const { authors, topics } = subscriptionsResult + const { authors, topics, error } = followsResult + if (error) { + console.error(error) + return + } + console.debug(authorResult) setAuthor(authorResult) + console.debug(authors, topics) setFollowing([...(authors || []), ...(topics || [])]) + console.debug(followersResult) setFollowers(followersResult || []) - console.debug('[components.Author] following data loaded', subscriptionsResult) + console.debug('[components.Author] author follows:', followsResult) } catch (error) { console.error('[components.Author] fetch error', error) } From 605dae2127908d1c56851b5d68ee7f7b71fe9eab Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 8 May 2024 23:43:38 +0300 Subject: [PATCH 2/6] common-result --- src/graphql/client/core.ts | 2 +- src/graphql/query/core/author-follows.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphql/client/core.ts b/src/graphql/client/core.ts index 9c083e86..bab144f9 100644 --- a/src/graphql/client/core.ts +++ b/src/graphql/client/core.ts @@ -134,7 +134,7 @@ export const apiClient = { slug?: string author_id?: number user?: string - }): Promise => { + }): Promise => { const response = await publicGraphQLClient.query(authorFollows, params).toPromise() return response.data.get_author_follows }, diff --git a/src/graphql/query/core/author-follows.ts b/src/graphql/query/core/author-follows.ts index 9d46ea2c..31924246 100644 --- a/src/graphql/query/core/author-follows.ts +++ b/src/graphql/query/core/author-follows.ts @@ -3,6 +3,7 @@ import { gql } from '@urql/core' export default gql` query GetAuthorFollows($slug: String, $user: String, $author_id: Int) { get_author_follows(slug: $slug, user: $user, author_id: $author_id) { + error authors { id slug From 53d3e2d83635f8efd000eb431814f120f86d8d26 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 9 May 2024 18:08:54 +0300 Subject: [PATCH 3/6] nounswiped --- .../_shared/SolidSwiper/Swiper.module.scss | 12 ------------ src/graphql/client/core.ts | 1 - 2 files changed, 13 deletions(-) diff --git a/src/components/_shared/SolidSwiper/Swiper.module.scss b/src/components/_shared/SolidSwiper/Swiper.module.scss index 78d205e2..f66de2fc 100644 --- a/src/components/_shared/SolidSwiper/Swiper.module.scss +++ b/src/components/_shared/SolidSwiper/Swiper.module.scss @@ -8,18 +8,6 @@ } } -.unswiped { - width: 100%; - margin: 2rem 0; - margin-bottom: 6rem; - padding-bottom: 2rem; - display: block; - - h2 { - text-align: center; - } -} - .Swiper { display: block; margin: 2rem 0; diff --git a/src/graphql/client/core.ts b/src/graphql/client/core.ts index bab144f9..bbfa00f4 100644 --- a/src/graphql/client/core.ts +++ b/src/graphql/client/core.ts @@ -1,6 +1,5 @@ import type { Author, - AuthorFollowsResult, CommonResult, FollowingEntity, LoadShoutsOptions, From ab7dda6c1445a588d03402659389dc94716c8163 Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 10 May 2024 15:44:36 +0300 Subject: [PATCH 4/6] safari-regexp-fix --- src/components/Views/PublishSettings/PublishSettings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Views/PublishSettings/PublishSettings.tsx b/src/components/Views/PublishSettings/PublishSettings.tsx index de86a02b..44289502 100644 --- a/src/components/Views/PublishSettings/PublishSettings.tsx +++ b/src/components/Views/PublishSettings/PublishSettings.tsx @@ -59,7 +59,7 @@ export const PublishSettings = (props: Props) => { const composeDescription = () => { if (!props.form.description) { - const cleanFootnotes = props.form.body.replaceAll(/.*?<\/footnote>/g, '') + const cleanFootnotes = props.form.body.replaceAll(/(.*?)<\/footnote>/g, '') const leadText = cleanFootnotes.replaceAll(/<\/?[^>]+(>|$)/gi, ' ') return shorten(leadText, DESCRIPTION_MAX_LENGTH).trim() } From bc6b35c37491bbd6f3249d7490e131171916d1cc Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 11 May 2024 17:54:40 +0300 Subject: [PATCH 5/6] hotifx-profile --- package.json | 2 +- src/components/Views/Author/Author.tsx | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 289d1149..35efc4a1 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "deploy": "graphql-codegen && npm run typecheck && vite build && vercel", "dev": "vite", "e2e": "npx playwright test --project=chromium", - "fix": "npm run lint:code:fix && stylelint **/*.{scss,css} --fix", + "fix": "npm run check:code:fix && stylelint **/*.{scss,css} --fix", "format": "npx @biomejs/biome format src/. --write", "hygen": "HYGEN_TMPLS=gen hygen", "postinstall": "npm run codegen && npx patch-package", diff --git a/src/components/Views/Author/Author.tsx b/src/components/Views/Author/Author.tsx index 3d102df9..f4710bea 100644 --- a/src/components/Views/Author/Author.tsx +++ b/src/components/Views/Author/Author.tsx @@ -3,10 +3,10 @@ import type { Author, Reaction, Shout, Topic } from '../../../graphql/schema/cor import { getPagePath } from '@nanostores/router' import { clsx } from 'clsx' import { For, Match, Show, Switch, createEffect, createMemo, createSignal, on, onMount } from 'solid-js' -import { Meta, Title } from '../../../context/meta' import { useFollowing } from '../../../context/following' import { useLocalize } from '../../../context/localize' +import { Meta, Title } from '../../../context/meta' import { useSession } from '../../../context/session' import { apiClient } from '../../../graphql/client/core' import { router, useRouter } from '../../../stores/router' @@ -76,24 +76,17 @@ export const AuthorView = (props: Props) => { const fetchData = async (slug: string) => { try { - const [followsResult, followersResult, authorResult] = await Promise.all([ + const [subscriptionsResult, followersResult, authorResult] = await Promise.all([ apiClient.getAuthorFollows({ slug }), apiClient.getAuthorFollowers({ slug }), loadAuthor({ slug }), ]) - const { authors, topics, error } = followsResult - if (error) { - console.error(error) - return - } - console.debug(authorResult) + const { authors, topics } = subscriptionsResult setAuthor(authorResult) - console.debug(authors, topics) setFollowing([...(authors || []), ...(topics || [])]) - console.debug(followersResult) setFollowers(followersResult || []) - console.debug('[components.Author] author follows:', followsResult) + console.info('[components.Author] data loaded') } catch (error) { console.error('[components.Author] fetch error', error) } From 79749bd95eef7e52ebc30f99b6dfaa6315091285 Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 11 May 2024 19:11:34 +0300 Subject: [PATCH 6/6] about-hotfix --- src/components/Views/Author/Author.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Views/Author/Author.tsx b/src/components/Views/Author/Author.tsx index f4710bea..9c0423ba 100644 --- a/src/components/Views/Author/Author.tsx +++ b/src/components/Views/Author/Author.tsx @@ -243,7 +243,7 @@ export const AuthorView = (props: Props) => { class={styles.longBio} classList={{ [styles.longBioExpanded]: isBioExpanded() }} > -
(bioContainerRef.current = el)} innerHTML={author().about} /> +
(bioContainerRef.current = el)} innerHTML={author()?.about || ''} />