From a6b791ab5aea56988078c422f71ef933ec3579f6 Mon Sep 17 00:00:00 2001 From: thislight Date: Sat, 28 Sep 2024 22:27:26 +0800 Subject: [PATCH 1/5] TootComposer: fix random stmt may be empty --- package.json | 2 +- src/timelines/TootComposer.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 700f2f4..4c0af67 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package", "name": "tutu", - "version": "1.0.6", + "version": "1.0.7", "description": "", "private": true, "type": "module", diff --git a/src/timelines/TootComposer.tsx b/src/timelines/TootComposer.tsx index 0440253..8e4ed25 100644 --- a/src/timelines/TootComposer.tsx +++ b/src/timelines/TootComposer.tsx @@ -183,7 +183,7 @@ function randomChoose( rn: number, K: T, ): T extends Array ? E : never { - const idx = Math.round(rn * K.length); + const idx = Math.round(rn * K.length) - 1; return K[idx]; } From 108e8fc87c7ad7b4406322107a54a8b67ed0a800 Mon Sep 17 00:00:00 2001 From: thislight Date: Sat, 28 Sep 2024 22:38:44 +0800 Subject: [PATCH 2/5] BottomSheet: fix bottomUp position on mobile --- src/material/BottomSheet.module.css | 8 ++++++++ src/material/BottomSheet.tsx | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/material/BottomSheet.module.css b/src/material/BottomSheet.module.css index f73f562..8f716e9 100644 --- a/src/material/BottomSheet.module.css +++ b/src/material/BottomSheet.module.css @@ -60,5 +60,13 @@ top: unset; transform: translateX(-50%); bottom: 0; + + @media (max-width: 560px) { + & { + transform: none; + height: unset; + + } + } } } diff --git a/src/material/BottomSheet.tsx b/src/material/BottomSheet.tsx index 3191426..89440e2 100644 --- a/src/material/BottomSheet.tsx +++ b/src/material/BottomSheet.tsx @@ -1,19 +1,14 @@ import { children, createEffect, - createRenderEffect, createSignal, onCleanup, - onMount, - startTransition, useTransition, - type ChildrenReturn, type ParentComponent, type ResolvedChildren, } from "solid-js"; import styles from "./BottomSheet.module.css"; import { useHeroSignal } from "../platform/anim"; -import { makeEventListener } from "@solid-primitives/event-listener"; export type BottomSheetProps = { open?: boolean; From 63603e049d35a7e55e2d2a4514fec23aff2197ce Mon Sep 17 00:00:00 2001 From: thislight Date: Sat, 28 Sep 2024 22:39:33 +0800 Subject: [PATCH 3/5] MediaAttachmentGrid: fix autoplay on iOS --- src/timelines/MediaAttachmentGrid.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/timelines/MediaAttachmentGrid.tsx b/src/timelines/MediaAttachmentGrid.tsx index f41477d..a88d7a6 100644 --- a/src/timelines/MediaAttachmentGrid.tsx +++ b/src/timelines/MediaAttachmentGrid.tsx @@ -109,8 +109,10 @@ const MediaAttachmentGrid: Component<{ src={item.url || undefined} style={style()} onLoadedMetadata={[setLoaded, true]} - autoplay={true} + autoplay={false} controls + playsinline /* or safari on iOS will play in full-screen */ + loop /> ); From d90876a84e6e930fce29251b8ef0deb36cc7ab23 Mon Sep 17 00:00:00 2001 From: thislight Date: Sat, 28 Sep 2024 22:46:28 +0800 Subject: [PATCH 4/5] TootComposer: fix placeholder empty --- src/timelines/TootComposer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/timelines/TootComposer.tsx b/src/timelines/TootComposer.tsx index 8e4ed25..b50ba64 100644 --- a/src/timelines/TootComposer.tsx +++ b/src/timelines/TootComposer.tsx @@ -183,7 +183,8 @@ function randomChoose( rn: number, K: T, ): T extends Array ? E : never { - const idx = Math.round(rn * K.length) - 1; + const idx = Math.floor(rn * K.length); + console.log(idx, K.length); return K[idx]; } From 3dc2196f1a841421ad274309bcbe05bc12f2b9cf Mon Sep 17 00:00:00 2001 From: thislight Date: Sat, 28 Sep 2024 22:46:48 +0800 Subject: [PATCH 5/5] TimelinePanel: allow the toot composer collpased --- src/timelines/Home.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/timelines/Home.tsx b/src/timelines/Home.tsx index 3ce4ce1..5c74795 100644 --- a/src/timelines/Home.tsx +++ b/src/timelines/Home.tsx @@ -172,6 +172,7 @@ const TimelinePanel: Component<{ client={props.client} expanded={item.id === expandedThreadId() ? 1 : 0} onExpandChange={(x) => { + setTyping(false) if (item.id !== expandedThreadId()) { setExpandedThreadId((x) => (x ? undefined : item.id)); } else if (x === 2) { @@ -423,11 +424,6 @@ const Home: ParentComponent = (props) => { } - fab={ - - - - } >