diff --git a/CHANGELOG.md b/CHANGELOG.md index 28397a418..fe397ea79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## [0.3.2-beta.0](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.3.2-beta.0) (2025-01-17) +## [0.3.3-beta.0](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.3.3-beta.0) (2025-01-24) ### Bug Fixes @@ -24,8 +24,10 @@ * add turbo build in ci ([7b848cd](https://github.com/RSSNext/follow/commit/7b848cd08aa4f97b1df35666166561d6fc30c5c9)) * add type checking to test script ([#1666](https://github.com/RSSNext/follow/issues/1666)) ([518a32f](https://github.com/RSSNext/follow/commit/518a32f2ce1498f21cff87e0b95d0a4fd0a0f4a0)) * adjust activation toast style ([e81245e](https://github.com/RSSNext/follow/commit/e81245e395ce1829f0c185a5a184c4cba8f8406c)) +* adjust ios styles ([585aa03](https://github.com/RSSNext/follow/commit/585aa03b238f4f451849eaad8098dcf08ad9405e)) * adjust padding based on FeedViewType in EntryList component ([f3f86b7](https://github.com/RSSNext/follow/commit/f3f86b7c0ddc1cae0c26246bc8e91cbb79e64189)) * adjust ScrollView padding to accommodate safe area insets in FollowFeed component ([de3a625](https://github.com/RSSNext/follow/commit/de3a625db513f559ad2e8d6e86b1af2798b88a37)) +* adjust SwipeableItem friction and improve loading indicator display in Lists screen ([43bebd7](https://github.com/RSSNext/follow/commit/43bebd7c41ec7dcc1ba4967fecbc4de6708a31a3)) * ai daily report layout in mobile ([64c7df1](https://github.com/RSSNext/follow/commit/64c7df1dda3e4a30a6152b24bcea0dd135e12ca9)) * ai entry actions with user role checks, close [#2591](https://github.com/RSSNext/follow/issues/2591) ([7129db7](https://github.com/RSSNext/follow/commit/7129db766c5ed2e7257f59bc914c1b56a27cc6a3)) * align notification skeleton to left ([fa08d1a](https://github.com/RSSNext/follow/commit/fa08d1a0cb8421ca40e38dddd0d74415389f7a80)), closes [#1672](https://github.com/RSSNext/follow/issues/1672) @@ -33,6 +35,7 @@ * allow collect entry from list ([706f484](https://github.com/RSSNext/follow/commit/706f4847576fbb0237925434d4dace5c22fdbf93)) * allow select one feed ([3c21d92](https://github.com/RSSNext/follow/commit/3c21d92baf0a03373224ac9d5a7a416947788388)), closes [#1512](https://github.com/RSSNext/follow/issues/1512) * allow selecting when meta key is pressed ([6b8572c](https://github.com/RSSNext/follow/commit/6b8572c37aa287aa544e6ddb2847693ba597b0be)) +* allow set cookie on verify-totp ([6b884d1](https://github.com/RSSNext/follow/commit/6b884d1fd7e6eb6045856b60701979c298ecd8b4)) * always exclude routeParams ([1466886](https://github.com/RSSNext/follow/commit/1466886c426095aa59bbc06f93a44245bfa3b480)) * **animation:** preserve exit transition for smoother animations ([#2237](https://github.com/RSSNext/follow/issues/2237)) ([aab23d3](https://github.com/RSSNext/follow/commit/aab23d3a347ee445f9a53d4053624e9daad4662c)) * app notification font size ([1b5f944](https://github.com/RSSNext/follow/commit/1b5f9448062bde224770dfe5129304d7a812585d)) @@ -49,10 +52,12 @@ * auth in electron ([405ee42](https://github.com/RSSNext/follow/commit/405ee42e8a1232424bb667cd56fffd3d0b463a4e)) * authentication style on mobile ([58e796e](https://github.com/RSSNext/follow/commit/58e796e3df1844ccb2c4cadb6578051d1114c628)) * **auth:** handle optional icon class names for providers in login components ([de8d337](https://github.com/RSSNext/follow/commit/de8d3376713be0b696579e16395b887b2658d59f)) +* **auth:** only set status as unauthenticated when there is no session ([bc9a9d4](https://github.com/RSSNext/follow/commit/bc9a9d4310fdb5f0d51f7f512c47c96f95318f74)), closes [#2473](https://github.com/RSSNext/follow/issues/2473) * **auth:** redirect url ([e7d5576](https://github.com/RSSNext/follow/commit/e7d5576b63a77cd4f4e25a3124f9685f408a73de)) * auto archived list flash ([#1269](https://github.com/RSSNext/follow/issues/1269)) ([8d2478c](https://github.com/RSSNext/follow/commit/8d2478c6a93aa9f5a99fddc55bbb8e532e1a0fe1)) * auto load achieved entries when show achieved button is available ([074a60d](https://github.com/RSSNext/follow/commit/074a60d3cf93bcede88ea4d70b07cf7480be4229)) * back to previous entry list will refresh data ([84a188a](https://github.com/RSSNext/follow/commit/84a188a8e1fa88df18b9bd4d5f0bea1fc92f9394)) +* blurhash size ([4696ac6](https://github.com/RSSNext/follow/commit/4696ac6d47be38a8ec3d0cf20b63273ca24d7960)) * **boost:** card text align center ([632d5d4](https://github.com/RSSNext/follow/commit/632d5d42d67999523e602fb18f59ca72543b7d7a)) * break hono types ([bb529c4](https://github.com/RSSNext/follow/commit/bb529c498a7e2d0408b7de9e1d2f78db9a8b0d0f)) * **bridge:** window call should catch error ([7bdf100](https://github.com/RSSNext/follow/commit/7bdf10050cef7f39b0f485b89ca0445c49116d81)) @@ -70,6 +75,7 @@ * center dialog ([4a1ae06](https://github.com/RSSNext/follow/commit/4a1ae0668855b24513cf85b2a6527edf20c2da47)) * change invitation code placeholder font to theme font ([#1978](https://github.com/RSSNext/follow/issues/1978)) ([d78f7cd](https://github.com/RSSNext/follow/commit/d78f7cdc178388f5e0c83be4ce49e32f68863efa)) * changelog ([f84aa0b](https://github.com/RSSNext/follow/commit/f84aa0b0cfdc350f26e79ce68c75788cc090321d)) +* check view ([f52338c](https://github.com/RSSNext/follow/commit/f52338ce331293411038fb4660f7bb0d635c8401)) * ci ([#1943](https://github.com/RSSNext/follow/issues/1943)) ([f7eca73](https://github.com/RSSNext/follow/commit/f7eca73f5b2a5f1d3d24a3189fd4708da282b45b)) * **ci:** concurrency group ([fb0152e](https://github.com/RSSNext/follow/commit/fb0152eaec76b28ed9fc26381917ca7ec2aecb0b)) * **ci:** forge build error ([#1500](https://github.com/RSSNext/follow/issues/1500)) ([a5e3e02](https://github.com/RSSNext/follow/commit/a5e3e0228c7088e78061801466267ebdbd288e2c)) @@ -91,6 +97,7 @@ * content ([5a30f38](https://github.com/RSSNext/follow/commit/5a30f384082949f17a71f6d1f837b30966368157)) * context menu for multi select ([d68de79](https://github.com/RSSNext/follow/commit/d68de7933235351d64df68e3e2c49623184f4284)) * corner player style on safari ([e740d4d](https://github.com/RSSNext/follow/commit/e740d4da78032547c48014a31a25968fe1ad192f)) +* correct ModalHeaderSubmitButton naming and enhance UI components ([55dcfb0](https://github.com/RSSNext/follow/commit/55dcfb06df5cdf520cb316b3af6e73650063e52f)) * correct visibility logic for entry read command ([bdad091](https://github.com/RSSNext/follow/commit/bdad0915995fd4853db49a257a5bd1f13ad092be)) * correct z-index in toast ([6507744](https://github.com/RSSNext/follow/commit/6507744847b6ceee093adb17076292993d525313)) * crash when using Google Translate, close [#2121](https://github.com/RSSNext/follow/issues/2121) ([4ae7290](https://github.com/RSSNext/follow/commit/4ae7290de115e6d352d84282b8470bcd15a115c4)) @@ -105,6 +112,7 @@ * debug proxy page ([#1439](https://github.com/RSSNext/follow/issues/1439)) ([c8d1230](https://github.com/RSSNext/follow/commit/c8d1230be753109bd7eaef45e7d0ad0399d8bd4d)) * debugger network ([a76814d](https://github.com/RSSNext/follow/commit/a76814ddfc5a019564bfc1980572157e1a30d776)) * **debug:** inject `import.env` ([810516a](https://github.com/RSSNext/follow/commit/810516ae7d9b4196c047249cb0f889de8b012b99)) +* delay the setVoice until before starting play tts, close [#2042](https://github.com/RSSNext/follow/issues/2042) ([e64da25](https://github.com/RSSNext/follow/commit/e64da259e7aa0247904d42b39a5a63e8d869f4c3)) * delete condition item ([8b9750d](https://github.com/RSSNext/follow/commit/8b9750da1219f3d046b78c70c1966e284b086348)) * delete last condition ([72d894a](https://github.com/RSSNext/follow/commit/72d894a754ba3a0c3b6c4e030b3b274dc98de6b6)) * detecting windows11 ([#1170](https://github.com/RSSNext/follow/issues/1170)) ([2813f1d](https://github.com/RSSNext/follow/commit/2813f1d6540fcb215287dd32cbc0f8cf87cb1cb0)) @@ -159,6 +167,7 @@ * feed column pb in mobile ([4035a6b](https://github.com/RSSNext/follow/commit/4035a6b7b839a284e452f51e75c759f25136784a)) * feed icon fallback delay ms ([89239d8](https://github.com/RSSNext/follow/commit/89239d89aa52429eef348e500c7ed7d6170c766a)) * feed icon margin right ([0f32364](https://github.com/RSSNext/follow/commit/0f3236406dc354adc9830c51e73f9fb4790f159a)) +* **feed-column:** correct sorting icon status ([#2652](https://github.com/RSSNext/follow/issues/2652)) ([4045251](https://github.com/RSSNext/follow/commit/404525196763501d2bf315ed68c7f3aaac7a4683)) * feedIcon margin ([03ce13d](https://github.com/RSSNext/follow/commit/03ce13d45bd89908bd9bcb06484a07873b6388f5)) * fill height when zooming ([75e0da2](https://github.com/RSSNext/follow/commit/75e0da2a866a7789606bd40d484fc29973fd9e0a)) * fill missing userId when open tip modal, close [#2248](https://github.com/RSSNext/follow/issues/2248) ([53ad291](https://github.com/RSSNext/follow/commit/53ad291820ccefc6badee8d3dc6af276c31c3cc6)) @@ -191,11 +200,13 @@ * **i18n:** update label for notification badge settings in zh-CN locale and others ([#1455](https://github.com/RSSNext/follow/issues/1455)) ([ec82f03](https://github.com/RSSNext/follow/commit/ec82f036b44a3d0d463c48c1d793fc517def1d07)) * ignore `file` and editor protocols ([2badb9b](https://github.com/RSSNext/follow/commit/2badb9b1c0bf6628d2a2fc177063fd0c7c7fb08b)) * ignore `node_modules` for tailwindcss to avoid warning ([#2425](https://github.com/RSSNext/follow/issues/2425)) ([1e8f80e](https://github.com/RSSNext/follow/commit/1e8f80ef158ce1e59af7ae106b871a60742038f3)) +* ignore customize toolbar in EntryItem context menu ([79daad4](https://github.com/RSSNext/follow/commit/79daad4db321f8ca76c9db503f15e951c640e5fb)) * image blurhash out when image loaded ([5b237ca](https://github.com/RSSNext/follow/commit/5b237caf803ed5a2cb95a7fb6e0f2fb7940f5da9)) * image blurhash placeholder ([3ca9b5a](https://github.com/RSSNext/follow/commit/3ca9b5a65978e854dafdfe73d81c873379c82c42)) * image error ui ([#2124](https://github.com/RSSNext/follow/issues/2124)) ([008cc98](https://github.com/RSSNext/follow/commit/008cc98f8a2624d4360e7c6bb8ba7176436f8579)) * immer object extensible ([6ad35ad](https://github.com/RSSNext/follow/commit/6ad35ad6712a68db9e231bf5733a2956ccecda90)) * import ([9d6e7d4](https://github.com/RSSNext/follow/commit/9d6e7d44363efc50a592e13e7c20aa6eca2e03d0)) +* improve image style ([8e0915a](https://github.com/RSSNext/follow/commit/8e0915a6f6eac3f68c382758c71dcc0a4e478687)) * improve Markdown rendering and UI adjustments in various components ([1439d87](https://github.com/RSSNext/follow/commit/1439d87f071dd6153519f56091e73f3fabf817b4)) * improve multi select behavior ([24017df](https://github.com/RSSNext/follow/commit/24017dfb3190c91969ec68d3d88544e051880469)) * improve perform for feed column ([#1708](https://github.com/RSSNext/follow/issues/1708)) ([1f349ed](https://github.com/RSSNext/follow/commit/1f349ed73e912825fb34877f5db9df13c6c6f879)) @@ -223,6 +234,7 @@ * md lint ([c8e556a](https://github.com/RSSNext/follow/commit/c8e556a3ac861cab4a4a7aff1aa2fa51aaca1f42)) * media item dot position on mobile ([c67248f](https://github.com/RSSNext/follow/commit/c67248ffc8d77cbdeac289f5ed398248dff41cb3)) * **media:** adjust inline media size and alignment for better display [#2251](https://github.com/RSSNext/follow/issues/2251) ([#2254](https://github.com/RSSNext/follow/issues/2254)) ([86b5712](https://github.com/RSSNext/follow/commit/86b57120fca3aadcead672fb6e9ea470045b4759)) +* missing runtime option, close [#2630](https://github.com/RSSNext/follow/issues/2630) ([500f0ba](https://github.com/RSSNext/follow/commit/500f0ba260556923beead33c67989bd05b3a1d4d)) * missing site url in feed selector ([ea677ac](https://github.com/RSSNext/follow/commit/ea677ac6a3a43489a9508a32ecb22fa38ecf4f27)) * missing translation in pitcure masonry ([902d681](https://github.com/RSSNext/follow/commit/902d68180d1cc872cbe4435efbcae108f0d732b5)) * mobile need login modal ([0fb16f2](https://github.com/RSSNext/follow/commit/0fb16f2352e9776731522204b838be59f66127a4)) @@ -241,6 +253,7 @@ * motion button motion style in mobile ([611d2cf](https://github.com/RSSNext/follow/commit/611d2cf0349be360aa86601ed4eb0522118bad49)) * multi select state ([f476483](https://github.com/RSSNext/follow/commit/f476483fe3b944371c0327495d53ec3d42006dda)) * nightly auto updater ([27b3bf4](https://github.com/RSSNext/follow/commit/27b3bf4f50badb8fac4b497d18a25002ed3b1981)) +* no password hint when enable 2fa ([dbd238a](https://github.com/RSSNext/follow/commit/dbd238a0f93abe13af5dd70c96d2922f89537fc4)) * not showing feed certification icon on the sidebar ([#1442](https://github.com/RSSNext/follow/issues/1442)) ([b395891](https://github.com/RSSNext/follow/commit/b395891b66a581254f24aae75d0d61869fb6fb33)) * omit cacheDimensions from img attributes in MediaImpl ([ec12b35](https://github.com/RSSNext/follow/commit/ec12b3538f42c8596c4e700ae2284a02b4d7791e)) * only remove background color on electron ([5d244d4](https://github.com/RSSNext/follow/commit/5d244d4a335ad448ab9596fd704d05867f1ce7c3)) @@ -255,6 +268,9 @@ * package export path for tsconfig ([#1690](https://github.com/RSSNext/follow/issues/1690)) ([00826ae](https://github.com/RSSNext/follow/commit/00826aecccac8dfcedba571ac02af1e3e1911c31)) * parse auth cookie ([626db9a](https://github.com/RSSNext/follow/commit/626db9a7edf0d42208861c31c2083ab89a6e32c9)) * pass a component for Trans ([7d38cb6](https://github.com/RSSNext/follow/commit/7d38cb6d2f814d3b6012b66ba6024c05b6edcf2d)) +* pass callbackURL, close [#2630](https://github.com/RSSNext/follow/issues/2630) ([85b00f7](https://github.com/RSSNext/follow/commit/85b00f79db988ba4352122dcb70b059f1ffccb95)) +* pass in otp code ([ac29a18](https://github.com/RSSNext/follow/commit/ac29a18135147de63ac0b58ceefd6a5ca111e8cf)) +* pass token when resetting password ([eb47ec2](https://github.com/RSSNext/follow/commit/eb47ec2ccaa9a4300ad8b5078bbf6c048d6f84a3)) * player cover height ([5486edd](https://github.com/RSSNext/follow/commit/5486eddd640bd5b72a174946ff804531e6e4b3d3)) * player margin safe ([1182497](https://github.com/RSSNext/follow/commit/1182497f6becb14a2954b079d9b47440ed071ef1)) * player show state ([7d034e0](https://github.com/RSSNext/follow/commit/7d034e0d355a02c14c368bb0f8a4737b5219cfc7)) @@ -262,6 +278,7 @@ * polling unread and add ua for electron api client ([549f10d](https://github.com/RSSNext/follow/commit/549f10d7ebb9e0eca9faa4d9cb27b7e448a8af0f)) * power icon align ([11059f6](https://github.com/RSSNext/follow/commit/11059f639ee955a0f10cbd97cb6eed85e335fed7)) * preferred title not working in entry column ([#1268](https://github.com/RSSNext/follow/issues/1268)) ([4bdf28e](https://github.com/RSSNext/follow/commit/4bdf28ea766242c74af051e36a9ef205f02eb874)) +* prefetch category ([e0d6746](https://github.com/RSSNext/follow/commit/e0d67465a8ba48ba84a5673effc5daf56b95aa28)) * prevent default click behavior in Media ([#1905](https://github.com/RSSNext/follow/issues/1905)) ([97dee6e](https://github.com/RSSNext/follow/commit/97dee6eda40e63dec2e66aa20da31a5d1ceed875)) * prevent default for cmd+k ([81d49f0](https://github.com/RSSNext/follow/commit/81d49f0893100de85a22d114765f76e7c9dea36c)) * prevent default scrolling behavior while using arrow keys to switch between entries ([#1447](https://github.com/RSSNext/follow/issues/1447)) ([ed5ee50](https://github.com/RSSNext/follow/commit/ed5ee50fe2676309e5451d73531baf59bbf0d746)) @@ -270,6 +287,7 @@ * prevent right cilck on content menu ([#1525](https://github.com/RSSNext/follow/issues/1525)) ([ca6428f](https://github.com/RSSNext/follow/commit/ca6428f21926524d08c8aae121e9c705a147540e)) * prevent withdrawal of zero amount to avoid unnecessary fees ([#1422](https://github.com/RSSNext/follow/issues/1422)) ([6584526](https://github.com/RSSNext/follow/commit/65845268f9940247d3b645b1588d1564ec0b4cff)) * **profile-menu:** limit max-char ([8a72a97](https://github.com/RSSNext/follow/commit/8a72a97c0ce145a65583fafe792ae99a634c52c3)) +* **Profile:** replace Fragment with View for better layout structure in SubscriptionList ([b2ffd5d](https://github.com/RSSNext/follow/commit/b2ffd5dd1acd634bcb6b0c07f441b3213e20f554)) * reduce timeline refresh, fixed [#1474](https://github.com/RSSNext/follow/issues/1474) ([6fc9d09](https://github.com/RSSNext/follow/commit/6fc9d09c586618efb2d1b62b062fa04e26dc7986)) * reduce upgrade toast duration and disable prompt on nightly version, fixed 1450 ([7f2ac96](https://github.com/RSSNext/follow/commit/7f2ac967ebc900e57b09bf4c945412e84943ebb2)) * refetch wallet data on mount ([2d11eb2](https://github.com/RSSNext/follow/commit/2d11eb2d92fb57222b14df987b57a75eb9262fc5)) @@ -291,17 +309,22 @@ * remove vercel header rewrite for assets ([79e6f48](https://github.com/RSSNext/follow/commit/79e6f483265216773e0ccf5ac0690d06300d3e80)) * remove wdyr in prod ([70e3b72](https://github.com/RSSNext/follow/commit/70e3b72b0ae88a722e2ff9e7d6027003f88829e2)) * replace Avatar component with UserAvatar in ranking and transaction sections ([#1759](https://github.com/RSSNext/follow/issues/1759)) ([52c3695](https://github.com/RSSNext/follow/commit/52c3695355ed3962d9ad53e61a612d88c54ab650)) +* reset tts when play again, close [#2054](https://github.com/RSSNext/follow/issues/2054) ([d6b3a8c](https://github.com/RSSNext/follow/commit/d6b3a8cdc5170bd6b7297cab38ac60d9250788aa)) * response error toast style ([7748588](https://github.com/RSSNext/follow/commit/77485886089e9faea54cf80a96a48a0bedd2a39e)) * restore BlurEffect in SearchHeader and enhance refresh control in search tabs ([180aa66](https://github.com/RSSNext/follow/commit/180aa667d50c18ed978e4b227b5f03347025775a)) * revalidate when switch from subscription startupScreen ([e63c12c](https://github.com/RSSNext/follow/commit/e63c12c27227341a2477eb06fa039e2b0a2a00e5)) * revert electron bump ([#1991](https://github.com/RSSNext/follow/issues/1991)) ([200415c](https://github.com/RSSNext/follow/commit/200415c77f52d11a43c2610c5c58c61fbbfb23f8)) * revert merge chunk ([4a9679b](https://github.com/RSSNext/follow/commit/4a9679bad109a786b80939ca9ead32f1505be186)) +* **rn-base:** fix `SafeNavigationScrollView` and impl blur effect header ([437a790](https://github.com/RSSNext/follow/commit/437a790994eb7c9a0546795c322ae7d7220bd081)) * **rn-baseline:** sync with uikit color and update list ([91f5340](https://github.com/RSSNext/follow/commit/91f53404071c609a77b8ff809ea2cbb7748cb1c5)) +* **rn-base:** Switch component flex ([7365eb5](https://github.com/RSSNext/follow/commit/7365eb5e38de5080d655cd49ed1080b73b949086)) * **rn-tabbar:** calc tab bar indicator position ([e625ada](https://github.com/RSSNext/follow/commit/e625adaf162cdd2962900d1104541f9cc6365af5)) * **rn:** adjust ui colors ([33d9e14](https://github.com/RSSNext/follow/commit/33d9e14d7c377c76dc349c1fc6ae901da2fe30c7)) * **rn:** check tab current index frequency ([fc3a3ce](https://github.com/RSSNext/follow/commit/fc3a3cef23532143853625a1af6cc2bbe3c28a3d)) * **rn:** delete subscribe in db persist ([e2c9459](https://github.com/RSSNext/follow/commit/e2c9459db8cc0137bb63ea83b1cd7f2cb2a3dab4)) * **rn:** discover form ([4f3d990](https://github.com/RSSNext/follow/commit/4f3d9902af372dd849f02a20dc1ae644d309fd73)) +* **rn:** flashlist insets and navigation padding ([041318a](https://github.com/RSSNext/follow/commit/041318ab7e3699da143fccdc60b6dc6645ffb100)) +* **rn:** follow feed modal style ([a03dcd9](https://github.com/RSSNext/follow/commit/a03dcd9ee9881281bb784fd6aef824134777875a)) * **rn:** hide tabbar when push to other setting page ([c47905b](https://github.com/RSSNext/follow/commit/c47905b70fb188acdae48f27a93822ccd20a944c)) * **rn:** login email ([8a1ff73](https://github.com/RSSNext/follow/commit/8a1ff735bd0451e2586b99299cf67fa25ad05c64)) * **rn:** login redirection ([9efbe79](https://github.com/RSSNext/follow/commit/9efbe79961b3dba138b9553d131b73c94c3a8cdf)) @@ -309,6 +332,7 @@ * rsshub link in mobile ([ac76cde](https://github.com/RSSNext/follow/commit/ac76cde0ca99e3f9ca842be84603f5bd6e5a0ad4)) * **rsshub:** adjust table cell width ([ca8d19d](https://github.com/RSSNext/follow/commit/ca8d19dc394d7f9907a40834abcdd0e14ddc2b47)) * scroll bar z index ([5057999](https://github.com/RSSNext/follow/commit/50579995367b871e84768c5983b3302f75f8e077)), closes [#1233](https://github.com/RSSNext/follow/issues/1233) +* scroll header height ([c9bae94](https://github.com/RSSNext/follow/commit/c9bae9404beb0be74ffc7cfb1165f926a2af7174)) * scroll out mark read logic ([eaecb25](https://github.com/RSSNext/follow/commit/eaecb252d322b5f2e8e89873523dfbe8d213848c)) * scroll out to mark read in mobile ([a44d598](https://github.com/RSSNext/follow/commit/a44d59820ba7e62b5db9de478f813cd9f287f670)) * scroll state for mobile float bar ([126206b](https://github.com/RSSNext/follow/commit/126206b995f47c17ed60c2a07296987dd0b8dc95)) @@ -343,6 +367,7 @@ * showArchivedButton in PictureMasonry ([07b075a](https://github.com/RSSNext/follow/commit/07b075ad4587919729790ca5747ba32d5e833cc1)), closes [#1583](https://github.com/RSSNext/follow/issues/1583) * sidebar copy feed url, fixed [#1361](https://github.com/RSSNext/follow/issues/1361) ([4e84196](https://github.com/RSSNext/follow/commit/4e841964e6573fa20ae214538b04dd0dc18a6f5e)) * smooth step ([f32cda6](https://github.com/RSSNext/follow/commit/f32cda6240d474a51bbaaf0efc1baf2fe5f36d03)) +* sort action button position and select status ([1ec6c87](https://github.com/RSSNext/follow/commit/1ec6c8718aab9f6da0c8543f28d3bf4a13c26044)) * **ssr-server:** fix hydrate data ([185bbe1](https://github.com/RSSNext/follow/commit/185bbe1dd9dd34335b3021766559338539b344a7)) * **ssr-server:** minify code result should await ([1c5cd04](https://github.com/RSSNext/follow/commit/1c5cd0484636f1415c99c17feb39af2584486ee8)) * **ssr-server:** try to hydrate date charset ([f21f3ee](https://github.com/RSSNext/follow/commit/f21f3ee33b82404ac6ffbecb2ef6542430ebbc3d)) @@ -354,6 +379,7 @@ * style for audio item ([7e4653f](https://github.com/RSSNext/follow/commit/7e4653f01cc987614843db06871b2d3bd30221f5)) * **style:** add missing sticky border ([cff217a](https://github.com/RSSNext/follow/commit/cff217aeead10622e0982a7668f7d14eab53e1a7)) * **styles:** radio group label margin ([c6deefc](https://github.com/RSSNext/follow/commit/c6deefc66167b7e8eb91bd565c2bac86eb8662a2)) +* support multiple route path, close [#2638](https://github.com/RSSNext/follow/issues/2638) ([bc88121](https://github.com/RSSNext/follow/commit/bc881218ade9fd9461e95034a84da8c3767aab3f)) * sw register ([5bbfb2d](https://github.com/RSSNext/follow/commit/5bbfb2d4e23fb49dde949cbeffe2a2c748e21595)) * sync active view after close sheet ([6f751a4](https://github.com/RSSNext/follow/commit/6f751a4a21796652d8cfc38b6209d7bfb4016ade)) * sync unread when fetch unread ([196b717](https://github.com/RSSNext/follow/commit/196b717a7fbdd362d9c2128223272c6616363bc5)) @@ -364,6 +390,7 @@ * **tip-modal:** radio cards align center ([6f041f9](https://github.com/RSSNext/follow/commit/6f041f9ef9099090d9f995d152a4adb32a8e8848)) * **toc:** fix text truncate in title line ([f9b1a61](https://github.com/RSSNext/follow/commit/f9b1a61c0185b449184b34df5f3a3869a4e722a4)) * **toc:** should focus when toc item clicked ([f51dfdd](https://github.com/RSSNext/follow/commit/f51dfddc9ef40f4a7f226f32f9357e03a04f6ee0)) +* **TOTPForm:** focus to code after fail ([8be6c13](https://github.com/RSSNext/follow/commit/8be6c13a768eedfabd4a03edca7049a23c72ce2c)) * translate form style ([6f3bb61](https://github.com/RSSNext/follow/commit/6f3bb61023dde1d58164425d8649c90bb4f680c6)), closes [#1184](https://github.com/RSSNext/follow/issues/1184) * **translations:** update zh-CN locale files for accuracy ([#1739](https://github.com/RSSNext/follow/issues/1739)) ([83c9f71](https://github.com/RSSNext/follow/commit/83c9f717dd7092dc4a4b1106961d746988066fd9)) * tray icon appears small and blurry on Windows, Close [#2077](https://github.com/RSSNext/follow/issues/2077) ([#2461](https://github.com/RSSNext/follow/issues/2461)) ([b4edc42](https://github.com/RSSNext/follow/commit/b4edc426df34549dbb870b13ab3a8ca949eedd6b)) @@ -388,6 +415,7 @@ * **ui:** resolve conflict between video progress bar and swiper drag … ([#1337](https://github.com/RSSNext/follow/issues/1337)) ([aa9206f](https://github.com/RSSNext/follow/commit/aa9206f5b1e3ea0c008f912ef22cdaa406546251)) * **ui:** use safe inset top to fix windows overlays, fixed [#1184](https://github.com/RSSNext/follow/issues/1184) ([dc85570](https://github.com/RSSNext/follow/commit/dc855703289ac98db76f4a57760fcd66047b8dd1)) * **ui:** user profile follow button style ([d629215](https://github.com/RSSNext/follow/commit/d629215305a0ec9323dea0db929582e9609a82f6)) +* unescape, close [#2276](https://github.com/RSSNext/follow/issues/2276) ([e7e19a5](https://github.com/RSSNext/follow/commit/e7e19a5aa8689098d53d5901b1d51b368e5111f4)) * update ([8dbd700](https://github.com/RSSNext/follow/commit/8dbd7003d3261d6a229ddfe627cb0bbd6bef217c)) * update class names for responsive design and modify zh-HK ([#1782](https://github.com/RSSNext/follow/issues/1782)) ([70b46f5](https://github.com/RSSNext/follow/commit/70b46f57bf476df15216efd440899798e0e1fa0b)) * update daily claim amount reference in tooltip ([#1487](https://github.com/RSSNext/follow/issues/1487)) ([3792c2d](https://github.com/RSSNext/follow/commit/3792c2d850d9fc3f96ea4591784b61c631ee7e86)) @@ -397,6 +425,7 @@ * update Japanese translations for user actions and login prompts ([#2188](https://github.com/RSSNext/follow/issues/2188)) ([88458bd](https://github.com/RSSNext/follow/commit/88458bd7a3e32854cd5b7b93f36c72f6cf3abac5)) * update linkedom to version 0.18.6 ([#2185](https://github.com/RSSNext/follow/issues/2185)) ([faebe6c](https://github.com/RSSNext/follow/commit/faebe6c819cd0742470f8aebe9be5f978d3827e6)) * update query key in SearchList component for improved data fetching ([77d73c2](https://github.com/RSSNext/follow/commit/77d73c2843c7d6e819177b67717da113dc81bac4)) +* update ScrollArea className for better width handling ([#2616](https://github.com/RSSNext/follow/issues/2616)) ([ca47409](https://github.com/RSSNext/follow/commit/ca47409a113b86dbc008c684ef19e14e544a4257)) * update SupportCreator component styles for better layout ([351f342](https://github.com/RSSNext/follow/commit/351f34289fab89f9866405f8910e6226cb88ec87)) * update tray icon path for windows and improve tray behavior ([#1511](https://github.com/RSSNext/follow/issues/1511)) ([3706874](https://github.com/RSSNext/follow/commit/3706874e42c215a84df71eae1c135a114be8985a)) * update type ([5958ec1](https://github.com/RSSNext/follow/commit/5958ec18d81030ae8f9bb579df613a18689ac929)) @@ -405,6 +434,7 @@ * update zh-CN translations and remove unused setting ([#2132](https://github.com/RSSNext/follow/issues/2132)) ([0dcfde5](https://github.com/RSSNext/follow/commit/0dcfde5ea40d688eaf8acc9f15f7a298421a12f0)) * **upgrade:** changelog container should w-full ([1551bf6](https://github.com/RSSNext/follow/commit/1551bf648c511cbf615f515b2e2d93077b0e42b4)) * use babel to resolve ([045d6c7](https://github.com/RSSNext/follow/commit/045d6c7d069f0d4a56c1e399cd3c2aa0e9bd2721)) +* use electron store ([#2644](https://github.com/RSSNext/follow/issues/2644)) ([9f30194](https://github.com/RSSNext/follow/commit/9f30194db59e6be9f418e2ec63d5aeef8f9aac38)) * use external link for login button ([d1975c2](https://github.com/RSSNext/follow/commit/d1975c20217290b2b7dc39866826c99f803dbd57)) * use replace for discover form navigation ([63602f2](https://github.com/RSSNext/follow/commit/63602f266390781a3552a14eefa35455f19c92b6)) * use turbo run concurrently task ([742f915](https://github.com/RSSNext/follow/commit/742f91517d87d136bc8dc6ee65008e9b6880d435)) @@ -435,7 +465,9 @@ * add confirmation for opening external apps ([#1618](https://github.com/RSSNext/follow/issues/1618)) ([08a1e76](https://github.com/RSSNext/follow/commit/08a1e76247b3c7ddeb7ef906a27f149e1a46e3d6)) * add cookie to api fetch ([f5e1d33](https://github.com/RSSNext/follow/commit/f5e1d33e2a42f1ce44788ec65d51d54f66056f29)) * add custom app delegate for tint color configuration ([#2579](https://github.com/RSSNext/follow/issues/2579)) ([6c28b4f](https://github.com/RSSNext/follow/commit/6c28b4f56ec2742b3e969a87750183e261f65d3d)) +* add default value for VITE_WEB_URL and remove VITE_IMGPROXY_URL ([8bbd8bf](https://github.com/RSSNext/follow/commit/8bbd8bf856c1a37e30978535aa597b44434fdf62)) * add entry conditions for actions ([53810ba](https://github.com/RSSNext/follow/commit/53810badc1a7b37be6fd5c187c7a97428e85405f)) +* add entry list ([c052749](https://github.com/RSSNext/follow/commit/c0527491624305dc397d3b0c16b95efa99900f91)) * add feed booster achievement with localization ([#1561](https://github.com/RSSNext/follow/issues/1561)) ([e769852](https://github.com/RSSNext/follow/commit/e7698526c2d51232cbdcb279aead6e473b7507a9)) * add follow user button in profile modal ([#1147](https://github.com/RSSNext/follow/issues/1147)) ([7c60d5e](https://github.com/RSSNext/follow/commit/7c60d5e91dd4a21872217427bd99fe8eae688ce1)) * add hydrate data type-safe helper ([cb6a65b](https://github.com/RSSNext/follow/commit/cb6a65b7cc1651d86b83b5b4089a7145cd59b0be)) @@ -466,9 +498,15 @@ * **app:** support cache limit and clean cache ([dee294d](https://github.com/RSSNext/follow/commit/dee294dda589ca9e2eaee8a7e55197635b6323c7)) * **auth:** add credential provider icon and update email translation in login flow ([d9a2638](https://github.com/RSSNext/follow/commit/d9a26387c5a5715dee6512a1d2f2aad92bf0e0eb)) * **auth:** enhance login modal with email login ([8bf9dd0](https://github.com/RSSNext/follow/commit/8bf9dd07e52e7188abfce7de990fb8b93d45711c)) +* basic entry data sync ([#2597](https://github.com/RSSNext/follow/issues/2597)) ([3479a89](https://github.com/RSSNext/follow/commit/3479a89b1faefc5a4bcac47d71716a80ede259ef)) +* basic masonry entry list and entry content view ([#2493](https://github.com/RSSNext/follow/issues/2493)) ([e569681](https://github.com/RSSNext/follow/commit/e569681198cabbfeb4c8133e421533c37b1fd96d)) * bigger font size in mobile ([3e9a92d](https://github.com/RSSNext/follow/commit/3e9a92d16a80139c851671748367f009a3af4de9)) +* bigger view selector ([973c0d2](https://github.com/RSSNext/follow/commit/973c0d214d13313372c4ced0c68ec3c85db4ef4b)) * bring rehypeUrlToAnchor back ([6f0cc4d](https://github.com/RSSNext/follow/commit/6f0cc4d566c9f2f552f0fedf1a8e570a817e0f56)), closes [#1373](https://github.com/RSSNext/follow/issues/1373) * checkLanguage utils ([225e470](https://github.com/RSSNext/follow/commit/225e470db84649bd23657d82b3c6a71b94cccc5f)) +* collection panel active button status ([a1676fc](https://github.com/RSSNext/follow/commit/a1676fc535430c3bd4c614a5261e3152e1bf2561)) +* collection panel active indicator ([c38677b](https://github.com/RSSNext/follow/commit/c38677bebf7e2874dc1d0c62f3a4333a988d033e)) +* collection panel styles ([9b5f4c2](https://github.com/RSSNext/follow/commit/9b5f4c27134e33fdc66a8158da2b3f8df1ffde99)) * copy button for ai summary ([b3ee572](https://github.com/RSSNext/follow/commit/b3ee5727e29d809092a8f4631d3e13c8d81095b9)) * copy profile email ([1e12588](https://github.com/RSSNext/follow/commit/1e1258811163d72ae36f29714eef5d50834c348b)) * customizable columns for masonry view, closed [#1749](https://github.com/RSSNext/follow/issues/1749) ([0e0ce84](https://github.com/RSSNext/follow/commit/0e0ce843235f01f33f4c5b9708aa67dac5901b46)) @@ -476,6 +514,7 @@ * disable more line clamp for translation ([3c5dba4](https://github.com/RSSNext/follow/commit/3c5dba4d7aee870d1594e39a6e185622dff46abe)) * discover rsshub card background use single color ([7eeea5e](https://github.com/RSSNext/follow/commit/7eeea5e694c142803a37564ef8886d4fc4d2dab4)) * **discover:** enhance RSSHub recommendations with filters ([#1481](https://github.com/RSSNext/follow/issues/1481)) ([eb70126](https://github.com/RSSNext/follow/commit/eb70126b8283b6e0b246f86751e588a37cb34902)) +* **discover:** implement localized search results ([#2623](https://github.com/RSSNext/follow/issues/2623)) ([166e095](https://github.com/RSSNext/follow/commit/166e09563df97b0d23b495dbec38162f37e63083)) * **discover:** implement searchable header and enhance UI with animated search bar ([2300996](https://github.com/RSSNext/follow/commit/2300996b87c2850f8f496bdd982e7ca8e5938d7f)) * **discover:** improve trending style and discover no image placeholer ([86be1a2](https://github.com/RSSNext/follow/commit/86be1a2e46d3298157cece0731e687a462f833d5)) * dnd ([#1471](https://github.com/RSSNext/follow/issues/1471)) ([c9333d5](https://github.com/RSSNext/follow/commit/c9333d5004c170955ab96b9f7f5a2825e1042271)) @@ -488,6 +527,7 @@ * enhance input fields for numeric entry ([00a0764](https://github.com/RSSNext/follow/commit/00a07647f830cb3cbb4acd5234d25d45d08298cb)) * enhance SocialMediaItem component with dynamic title styling and action bar positioning ([5d2fe70](https://github.com/RSSNext/follow/commit/5d2fe70b52a857c16ed7220fc36ecd5111f8cd4d)) * enhance tab layout and settings screen functionality ([f17446d](https://github.com/RSSNext/follow/commit/f17446d027f5528c1258a38de6cfc10d3fed43c8)) +* enhance tab screen with blur effect and update action buttons ([13cdee0](https://github.com/RSSNext/follow/commit/13cdee04dc6c99b875be2a5262ff941af59f83f2)) * enhance table with new translations and tooltip for descriptions ([#2471](https://github.com/RSSNext/follow/issues/2471)) ([99011eb](https://github.com/RSSNext/follow/commit/99011ebcf2cd3c4096520394537bb97b5ea08865)) * entry image gallery modal ([e0d3e17](https://github.com/RSSNext/follow/commit/e0d3e17da4ee17217d7b78871b546f43af87d893)) * export database ([85b4502](https://github.com/RSSNext/follow/commit/85b4502f9c113b8de73ccf4a167aa514a3c149ea)) @@ -499,7 +539,9 @@ * fold the long text content of social media ([e46b30a](https://github.com/RSSNext/follow/commit/e46b30a07fe74e1bacb234962b1542c849d2177d)) * folder mode option for export, close [#874](https://github.com/RSSNext/follow/issues/874) ([db3db14](https://github.com/RSSNext/follow/commit/db3db14e5dc5e4e7b132b2aa6b47d375eb789d3a)) * full width rsshub page ([f9c7e55](https://github.com/RSSNext/follow/commit/f9c7e55ef9411cb5021ffd81bf6aeb9bfe132ab3)) +* get video preview url from attachments ([127ccae](https://github.com/RSSNext/follow/commit/127ccae3f7698af3c33f0c4f2145480ca27024a0)) * hide trend ([2b92599](https://github.com/RSSNext/follow/commit/2b92599e18d3d33fd0371d4d3a5f3e3a6d94aeb6)) +* hideable header bottom ([b0012c1](https://github.com/RSSNext/follow/commit/b0012c1d913925c84aa969c3a13766fe7d90fe5b)) * html render for native ([#2346](https://github.com/RSSNext/follow/issues/2346)) ([313ad9b](https://github.com/RSSNext/follow/commit/313ad9b7db7bbcf47be78b127c866849a61b1c8d)) * **i18n:** added multiple text translations (zh-TW) ([#1621](https://github.com/RSSNext/follow/issues/1621)) ([a15f23a](https://github.com/RSSNext/follow/commit/a15f23a5c7bb697c75c7fecf8603612b2584baa8)) * **i18n:** discover categories and mark all read undo button ([#1506](https://github.com/RSSNext/follow/issues/1506)) ([06bdf6c](https://github.com/RSSNext/follow/commit/06bdf6cfb90b03e1624189ebc05a389495e8bedc)) @@ -511,6 +553,7 @@ * improve email verification display ([#2424](https://github.com/RSSNext/follow/issues/2424)) ([ebc6c4f](https://github.com/RSSNext/follow/commit/ebc6c4fdb6773f2b7d94b81b839a3a338787c4b3)) * **infra:** electron app can hot update renderer layer ([#1209](https://github.com/RSSNext/follow/issues/1209)) ([ca4751a](https://github.com/RSSNext/follow/commit/ca4751acd275579614a477d133ed643fca3fbf1a)) * integrate LoadingContainer ([834dff8](https://github.com/RSSNext/follow/commit/834dff8d91406eeb56b035e2da9f9d6e3a853850)) +* integrate react-native-uikit-colors for improved theming and UI consistency ([f947bd1](https://github.com/RSSNext/follow/commit/f947bd1d1ec2d91e05264c77c5c03f9de5fec6fb)) * integrate react-query for fetching unread feed items by view ([d4dd4fb](https://github.com/RSSNext/follow/commit/d4dd4fb68d5a1cebdaeeea1aff88c2fbe2fba5e9)) * **integration:** add outline integration ([#1229](https://github.com/RSSNext/follow/issues/1229)) ([0d0266b](https://github.com/RSSNext/follow/commit/0d0266b25189a74efdc63ce0062f3a379d4a0729)) * **integration:** Add readeck integration ([#1972](https://github.com/RSSNext/follow/issues/1972)) ([1ce3f5b](https://github.com/RSSNext/follow/commit/1ce3f5b8ba95b16ad1b12e702027cede3590491a)) @@ -521,12 +564,15 @@ * **locales:** enhance zh-HK locale with new user prompts ([#2556](https://github.com/RSSNext/follow/issues/2556)) ([6828606](https://github.com/RSSNext/follow/commit/6828606cc42445f46df9fddb9b547fd1e05e68f6)) * **locales:** enhance zh-HK translations ([#2208](https://github.com/RSSNext/follow/issues/2208)) ([2ecd89f](https://github.com/RSSNext/follow/commit/2ecd89ffde7a24580fb879192abdfa7ff95c6988)) * **locales:** update Japanese translations for RSSHub and related settings ([#2474](https://github.com/RSSNext/follow/issues/2474)) ([6ed05ce](https://github.com/RSSNext/follow/commit/6ed05cea8bff558930a94c0742abb3d350580e54)) +* **locales:** update Japanese translations for search results and two-factor authentication ([#2628](https://github.com/RSSNext/follow/issues/2628)) ([6fae018](https://github.com/RSSNext/follow/commit/6fae0189f2bdcc73991fcee94595d94712bbaa2b)) * **locales:** update zh-TW translations ([#2290](https://github.com/RSSNext/follow/issues/2290)) ([f734e6c](https://github.com/RSSNext/follow/commit/f734e6cfa3348f8906b48cbae8188531fd266e5e)) * **locales:** update zh-TW translations ([#2446](https://github.com/RSSNext/follow/issues/2446)) ([dbae887](https://github.com/RSSNext/follow/commit/dbae887df1fd23a92593682d74907d3851fdf183)) * **locales:** update zh-TW translations ([#2522](https://github.com/RSSNext/follow/issues/2522)) ([5780aea](https://github.com/RSSNext/follow/commit/5780aea3a4f1d2da1389a1140008a402498db82c)) +* **locales:** update zh-TW translations ([#2621](https://github.com/RSSNext/follow/issues/2621)) ([11828ea](https://github.com/RSSNext/follow/commit/11828ea9276e5cbbf77f4a4c5538fc865abb2872)) * manual action ([#1867](https://github.com/RSSNext/follow/issues/1867)) ([0eedbba](https://github.com/RSSNext/follow/commit/0eedbbadc263b474e2d4bfd5b6c498ac39c16c34)) * manually link social account ([fd373fb](https://github.com/RSSNext/follow/commit/fd373fb5271e4d9a31e37d49830d3fe3d4927922)) * **mark-all-button:** add countdown to auto-confirm message ([#1414](https://github.com/RSSNext/follow/issues/1414)) ([e1a5fc6](https://github.com/RSSNext/follow/commit/e1a5fc63f20c941140071789c9b67685da19ea5c)) +* merge actions for toggling state ([#2617](https://github.com/RSSNext/follow/issues/2617)) ([364d23f](https://github.com/RSSNext/follow/commit/364d23f7294826c4af4d8c2ff150862e33b21028)) * merge redirect page into login page ([2fa16b7](https://github.com/RSSNext/follow/commit/2fa16b75d376fe04472e6c91675c67e725da8633)) * migrate to better auth ([#1951](https://github.com/RSSNext/follow/issues/1951)) ([9102203](https://github.com/RSSNext/follow/commit/910220395631bcf86f56bfc2b2168ac95852444c)) * mobile app architecture and initial screens ([#2144](https://github.com/RSSNext/follow/issues/2144)) ([4b6a0fc](https://github.com/RSSNext/follow/commit/4b6a0fca2e3243061c7befc837e705262f17b664)) @@ -563,14 +609,26 @@ * reset feed ([#1419](https://github.com/RSSNext/follow/issues/1419)) ([9066758](https://github.com/RSSNext/follow/commit/9066758c322b8b31c1a9a137be017283fa92bea8)) * **rn-component:** implement toast manager ([950b5af](https://github.com/RSSNext/follow/commit/950b5af8ec0316875ed3ce5a99baaaecb56c6d37)) * **rn-component:** refactor context menu for ios ([4bae36a](https://github.com/RSSNext/follow/commit/4bae36ae70e5ce7c60eec385873f943976e798f1)) +* **rn-list:** manage list ([e3baee3](https://github.com/RSSNext/follow/commit/e3baee39865adb7960c07b648bcb3a22651d4af8)) +* **rn-list:** support list delete ([44c6fd0](https://github.com/RSSNext/follow/commit/44c6fd04c1c997c75a9bd7d39c7a02accd762d93)) +* **rn-modal:** apply modal header blur effect ([ccd1978](https://github.com/RSSNext/follow/commit/ccd19789064e31c3b1f979f516795172a2e787e6)) +* **rn-profile:** update profile share ([7c1fa69](https://github.com/RSSNext/follow/commit/7c1fa69d91fc0d1713051c541f788762f6cbbbdc)) * **rn-search:** impl search feeds and list view ([f747882](https://github.com/RSSNext/follow/commit/f747882565fd474c0bf9cbab7b4a08a033e6386f)) +* **rn-settings:** impl about page ([fd042e9](https://github.com/RSSNext/follow/commit/fd042e93cba16582e6029d680cf2bc2229ef9d5b)) +* **rn-settings:** impl data settings ([a031ac3](https://github.com/RSSNext/follow/commit/a031ac3f5ea70a11d6c3604f11b608f9155b165d)) +* **rn-settings:** impl gerenate settings ([203c253](https://github.com/RSSNext/follow/commit/203c253522be14016b335ae3e8598f39de809eb6)) +* **rn-settings:** impl ui settings ([3475b74](https://github.com/RSSNext/follow/commit/3475b740d5861d9024dadf27a9306d03dfb607f6)) +* **rn-settings:** Improve UI settings, modify the style of the setting lists ([eddc7cd](https://github.com/RSSNext/follow/commit/eddc7cde21d6a3252227899d77251ee752fc9f13)) * **rn/search:** implement search tabview ([0ab3ba9](https://github.com/RSSNext/follow/commit/0ab3ba9a3eff93cee0983928a66467a327a7d3b9)) * **rn:** add login teams ([aef9406](https://github.com/RSSNext/follow/commit/aef9406defdde43874945fd92ed422f53ed669fc)) * **rn:** adjust login page styles ([0fc90c7](https://github.com/RSSNext/follow/commit/0fc90c7c280e8d1eb170a5aca2374d1bd29d3b97)) * **rn:** feed form and subscribe ([f9d5d76](https://github.com/RSSNext/follow/commit/f9d5d7698c0a3b498684468abf4ce50b3c223390)) * **rn:** fix dismiss modal when follow done ([468a3e4](https://github.com/RSSNext/follow/commit/468a3e490a7c0c3424b721011f2dc72503ba479f)) * **rn:** follow modal form ([9beff37](https://github.com/RSSNext/follow/commit/9beff379f621e7756d55c4b6b7c0d3a9a6b1fecd)) +* **rn:** impl ios style SwipeableItem ([6025f8a](https://github.com/RSSNext/follow/commit/6025f8a6c142783757cf2d6d32f3f43c2330c00b)) +* **rn:** impl list setting pages ([c18da69](https://github.com/RSSNext/follow/commit/c18da69de1208f717fdb7fc4764d8057e72050e6)) * **rn:** impl markdown component for rn ([93b38a7](https://github.com/RSSNext/follow/commit/93b38a7c70dda2e934a424995bb07e24bdefd2ac)) +* **rn:** impl user profile page ([676f971](https://github.com/RSSNext/follow/commit/676f9718fba55f6e78c8c3477c3ab4f16d14ed4d)) * **rn:** implement feed drawer ([#2443](https://github.com/RSSNext/follow/issues/2443)) ([b581393](https://github.com/RSSNext/follow/commit/b581393c9aeccb15f1c3e7265273538eb055d140)) * **rn:** implement search list ([01122c9](https://github.com/RSSNext/follow/commit/01122c9480a56b5bd3a90d347d787f080ff6d754)) * **rn:** implements discover page ([#2385](https://github.com/RSSNext/follow/issues/2385)) ([66f97c0](https://github.com/RSSNext/follow/commit/66f97c0057f571717b3b33929baf5a13fc7e677c)) @@ -591,11 +649,13 @@ * rsshub logo ([7233a58](https://github.com/RSSNext/follow/commit/7233a58ca7d08635e3aab07c7b7dd6201d128425)) * rsshub status api ([38a6f99](https://github.com/RSSNext/follow/commit/38a6f990e922e0010ea48ea7be743f06cd7ed7ca)) * rsshub use modal ([5252f97](https://github.com/RSSNext/follow/commit/5252f97617d9ff31b99b4923f57b96b100436332)) +* **rsshub:** add minimum value to input field ([#2572](https://github.com/RSSNext/follow/issues/2572)) ([4d6a5a2](https://github.com/RSSNext/follow/commit/4d6a5a2acac43f5dee31623e76c78bc5c8e40043)) * Scroll to top when re-navigating to Discover page while already on it ([#2371](https://github.com/RSSNext/follow/issues/2371)) ([a59cf4a](https://github.com/RSSNext/follow/commit/a59cf4a4cffa51edd5e8da5008e38d8476535404)) * **search:** enhance search components with new styles and functionality ([0227427](https://github.com/RSSNext/follow/commit/0227427d295cf8f7e8a5b04ff396929b3d18e052)) * separate packaging for macOS x64 and arm64 architectures ([#1389](https://github.com/RSSNext/follow/issues/1389)) ([3e8de30](https://github.com/RSSNext/follow/commit/3e8de308a3b3a07c58ab3fd7d26aad5aa2328c99)) * set default unreadOnly to true ([8c8c765](https://github.com/RSSNext/follow/commit/8c8c765ff518b6ccc6457959fdf3fe8a4ddeee22)) * **settings:** clean web app service worker cache ([8ad40c0](https://github.com/RSSNext/follow/commit/8ad40c004ef2bf8924e2362729f42be83c09d102)) +* **settings:** enhance settings screen with animated header and blur effect ([0014aeb](https://github.com/RSSNext/follow/commit/0014aebd4e84b9ae440f8b9b2af838ccf7ad951d)) * show progress in searching ([e592e97](https://github.com/RSSNext/follow/commit/e592e97c9e0e6da8451c09b9b5f27612e6dbb971)), closes [#1457](https://github.com/RSSNext/follow/issues/1457) * smaller debug button ([3ef5dea](https://github.com/RSSNext/follow/commit/3ef5dea5d190ef81e91ae936f3d6c84898c569ac)) * **social:** improve image gallery grid ([5dc6d9e](https://github.com/RSSNext/follow/commit/5dc6d9ee227fa714f39957ff6e744e3079a3e57d)) @@ -623,6 +683,8 @@ * use FeedTitle ([73d2c30](https://github.com/RSSNext/follow/commit/73d2c30416ad3f2da626db003996c0fb036025ac)) * use non https debug host ([61d3ed4](https://github.com/RSSNext/follow/commit/61d3ed49b817997b8e7876efda2c0e29b08f9c4b)) * **ux:** support native space key to page down, fixed [#1121](https://github.com/RSSNext/follow/issues/1121) ([baa66fe](https://github.com/RSSNext/follow/commit/baa66feaf19416d2b9e5efe6b79f6af1b3966404)) +* view selector ([0c29f27](https://github.com/RSSNext/follow/commit/0c29f278e6ea42d36f6f9bc22ea368144e7361dc)) +* view selector in entry list ([d565cb8](https://github.com/RSSNext/follow/commit/d565cb80c53ffc14e51f7bab27d721610b40de79)) * web push ([cd32115](https://github.com/RSSNext/follow/commit/cd3211587109d0bf3e762df128356708fcea24b1)) * withdraw as rss3 ([5af9cf5](https://github.com/RSSNext/follow/commit/5af9cf5ec7767ea440b85afbc8ad46dd283c4dc6)) * zen mode and hide extra badge ([7ba07ad](https://github.com/RSSNext/follow/commit/7ba07adff1e7cd3292cc308f3e70803fe11fb8ce)) @@ -636,6 +698,7 @@ * enable router navigation transition ([24e1aea](https://github.com/RSSNext/follow/commit/24e1aead5e9bbb98b59194166fa4fd07eb167353)) * **external:** hydrate auth providers ([e0661ff](https://github.com/RSSNext/follow/commit/e0661ff2b9cc76f1a86ba6f293c0c37b5ad8d789)) * **external:** hydrate auth providers ([efcbecb](https://github.com/RSSNext/follow/commit/efcbecbd94dc7009364f59c8945d08dc3ecc47b0)) +* improve header blur effect ([527f6ac](https://github.com/RSSNext/follow/commit/527f6ac8b5efdbf17c189bc82bee197bb9c25370)) * lazy show action, reduce lcp time ([fcf775c](https://github.com/RSSNext/follow/commit/fcf775c976591258f83dea6e34ca3161b539b15e)) * modify some animations to CSS animations ([9ec3fe5](https://github.com/RSSNext/follow/commit/9ec3fe562bf3527ad4279a9a57c0b0bb5934dba1)) * optimize dnd re-render ([12bd659](https://github.com/RSSNext/follow/commit/12bd6594585fda9f7b83daad7f6eebae3059d985)) @@ -649,6 +712,7 @@ ### Reverts +* Revert "chore: update" ([8a13db9](https://github.com/RSSNext/follow/commit/8a13db9d6d8169ff14ae597068e74375a2dcc1aa)) * Revert "docs: fix video preview" ([8499079](https://github.com/RSSNext/follow/commit/8499079e503ad8cfc35e390755cec159f9eb3b7a)) * Revert "build: use pnpm catalogs" ([37164a3](https://github.com/RSSNext/follow/commit/37164a3674fa0bdf5b10919e788142a3d1b1cce3)) * Revert "perf: reduce the number of items rendered on the first render" ([9e45d04](https://github.com/RSSNext/follow/commit/9e45d0441ef16fb334af555c22276f7d77a72733)), closes [#1659](https://github.com/RSSNext/follow/issues/1659) diff --git a/apps/main/package.json b/apps/main/package.json index d7aab971b..5d268aa7a 100644 --- a/apps/main/package.json +++ b/apps/main/package.json @@ -37,6 +37,7 @@ "electron-context-menu": "4.0.4", "electron-log": "5.2.4", "electron-squirrel-startup": "1.0.1", + "electron-store": "^10.0.0", "electron-updater": "^6.3.9", "es-toolkit": "1.29.0", "fast-folder-size": "2.3.0", @@ -53,6 +54,7 @@ "vscode-languagedetection": "npm:@vscode/vscode-languagedetection@^1.0.22" }, "devDependencies": { + "@follow/types": "workspace:*", "@types/js-yaml": "4.0.9", "@types/node": "^22.10.1", "electron": "33.2.0", diff --git a/apps/main/preload/index.ts b/apps/main/preload/index.ts index fad6d2b9b..cc0f2290b 100644 --- a/apps/main/preload/index.ts +++ b/apps/main/preload/index.ts @@ -18,8 +18,8 @@ const detectingWindows11 = () => { if (!isWindows) return false const release = os.release() - const majorVersion = Number.parseInt(release.split(".")[0]) - const buildNumber = Number.parseInt(release.split(".")[2]) + const majorVersion = Number.parseInt(release.split(".")[0]!) + const buildNumber = Number.parseInt(release.split(".")[2]!) return majorVersion === 10 && buildNumber >= 22000 } diff --git a/apps/main/src/env.ts b/apps/main/src/env.ts index 62638dde0..37e2b9c7f 100644 --- a/apps/main/src/env.ts +++ b/apps/main/src/env.ts @@ -28,8 +28,8 @@ const detectingWindows11 = () => { if (!isWindows) return false const release = os.release() - const majorVersion = Number.parseInt(release.split(".")[0]) - const buildNumber = Number.parseInt(release.split(".")[2]) + const majorVersion = Number.parseInt(release.split(".")[0]!) + const buildNumber = Number.parseInt(release.split(".")[2]!) return majorVersion === 10 && buildNumber >= 22000 } diff --git a/apps/main/src/index.ts b/apps/main/src/index.ts index 47e54b5e0..7104401e3 100644 --- a/apps/main/src/index.ts +++ b/apps/main/src/index.ts @@ -5,7 +5,6 @@ import { env } from "@follow/shared/env" import { imageRefererMatches, selfRefererMatches } from "@follow/shared/image" import { parse } from "cookie-es" import { app, BrowserWindow, session } from "electron" -import type { Cookie } from "electron/main" import squirrelStartup from "electron-squirrel-startup" import { DEVICE_ID } from "./constants/system" @@ -77,7 +76,7 @@ function bootstrap() { mainWindow = createMainWindow() // restore cookies - const cookies = store.get("cookies") as Cookie[] + const cookies = store.get("cookies") if (cookies) { Promise.all( cookies.map((cookie) => { @@ -109,7 +108,7 @@ function bootstrap() { userAgent = userAgent.replace(/\s?Electron\/[\d.]+/, "") userAgent = userAgent.replace(/\s?Follow\/[\d.a-zA-Z-]+/, "") } - details.requestHeaders["User-Agent"] = userAgent + details.requestHeaders["User-Agent"] = userAgent! // set referer and origin if (selfRefererMatches.some((item) => details.url.startsWith(item))) { diff --git a/apps/main/src/init.ts b/apps/main/src/init.ts index 2358554fa..a9cb7eb26 100644 --- a/apps/main/src/init.ts +++ b/apps/main/src/init.ts @@ -20,7 +20,7 @@ import { initializeSentry } from "./sentry" import { router } from "./tipc" import { createMainWindow, getMainWindow } from "./window" -if (process.argv.length === 3 && process.argv[2].startsWith("follow-dev:")) { +if (process.argv.length === 3 && process.argv[2]!.startsWith("follow-dev:")) { process.env.NODE_ENV = "development" } const isDev = process.env.NODE_ENV === "development" @@ -36,7 +36,7 @@ export const initializeAppStage1 = () => { if (process.defaultApp) { if (process.argv.length >= 2) { app.setAsDefaultProtocolClient(APP_PROTOCOL, process.execPath, [ - path.resolve(process.argv[1]), + path.resolve(process.argv[1]!), ]) } } else { @@ -150,7 +150,7 @@ const registerPushNotifications = async () => { debug: true, firebase: JSON.parse(env.VITE_FIREBASE_CONFIG), persistentIds: persistentIds || [], - credentials: credentials || null, + credentials: credentials || undefined, bundleId: "is.follow", chromeId: "is.follow", }) diff --git a/apps/main/src/lib/proxy.ts b/apps/main/src/lib/proxy.ts index bc3aaf28b..38ef651b9 100644 --- a/apps/main/src/lib/proxy.ts +++ b/apps/main/src/lib/proxy.ts @@ -25,7 +25,7 @@ export const setProxyConfig = (inputProxy: string) => { } export const getProxyConfig = () => { - const proxyConfig = store.get("proxy") as string | undefined + const proxyConfig = store.get("proxy") if (!proxyConfig) { return } @@ -40,7 +40,7 @@ const normalizeProxyUri = (userProxy: string) => { return } // Only use the first proxy if there are multiple urls - const firstInput = userProxy.split(",")[0] + const firstInput = userProxy.split(",")[0]! try { const proxyUrl = new URL(firstInput) diff --git a/apps/main/src/lib/store.ts b/apps/main/src/lib/store.ts index bdde93ca6..edb1abf0c 100644 --- a/apps/main/src/lib/store.ts +++ b/apps/main/src/lib/store.ts @@ -1,39 +1,27 @@ -import { resolve } from "node:path" +import type { Credentials } from "@eneris/push-receiver/dist/types" +import type { Cookie } from "electron" +import Store from "electron-store" -import { app } from "electron" -import { JSONFileSyncPreset } from "lowdb/node" - -let db: { - data: Record - write: () => void - read: () => void -} - -const createOrGetDb = () => { - if (!db) { - db = JSONFileSyncPreset(resolve(app.getPath("userData"), "db.json"), {}) as typeof db - } - return db +// @keep-sorted +type StoreData = { + "notifications-credentials"?: Credentials | null + "notifications-persistent-ids"?: string[] | null + appearance?: "light" | "dark" | "system" | null + betterAuthSessionCookie?: string | null + cacheSizeLimit?: number | null + cookies?: Cookie[] | null + minimizeToTray?: boolean | null + proxy?: string | null + user?: string | null + windowState?: { + height: number + width: number + x: number + y: number + } | null } +export const store = new Store({ name: "db" }) export enum StoreKey { CacheSizeLimit = "cacheSizeLimit", } - -export const store = { - get: (key: string) => { - const db = createOrGetDb() - - return db.data[key] as any - }, - set: (key: string, value: any) => { - const db = createOrGetDb() - db.data[key] = value - db.write() - }, - delete: (key: string) => { - const db = createOrGetDb() - delete db.data[key] - db.write() - }, -} diff --git a/apps/main/src/lib/tray.ts b/apps/main/src/lib/tray.ts index 60c83612b..d459cf6a7 100644 --- a/apps/main/src/lib/tray.ts +++ b/apps/main/src/lib/tray.ts @@ -54,7 +54,7 @@ const destroyAppTray = () => { const DEFAULT_MINIMIZE_TO_TRAY = isMacOS ? false : true -export const getTrayConfig = (): boolean => store.get("minimizeToTray") ?? DEFAULT_MINIMIZE_TO_TRAY +export const getTrayConfig = () => store.get("minimizeToTray") ?? DEFAULT_MINIMIZE_TO_TRAY export const setTrayConfig = (input: boolean) => { store.set("minimizeToTray", input) diff --git a/apps/main/src/lib/user.ts b/apps/main/src/lib/user.ts index 46719e0fb..0a61e5c3f 100644 --- a/apps/main/src/lib/user.ts +++ b/apps/main/src/lib/user.ts @@ -8,7 +8,7 @@ import { store } from "./store" const BetterAuthKey = "betterAuthSessionCookie" export const setBetterAuthSessionCookie = (cookie: string) => store.set(BetterAuthKey, cookie) -export const getBetterAuthSessionCookie = (): string | null => store.get(BetterAuthKey) +export const getBetterAuthSessionCookie = () => store.get(BetterAuthKey) export const cleanBetterAuthSessionCookie = () => store.set(BetterAuthKey, null) const UserKey = "user" diff --git a/apps/main/src/lib/utils.ts b/apps/main/src/lib/utils.ts index 12b3d133d..2eda0e595 100644 --- a/apps/main/src/lib/utils.ts +++ b/apps/main/src/lib/utils.ts @@ -7,7 +7,7 @@ export function refreshBound(window: BrowserWindow, timeout = 0) { setTimeout(() => { // FIXME: workaround for theme bug in full screen mode const size = window?.getSize() - window?.setSize(size[0] + 1, size[1] + 1) - window?.setSize(size[0], size[1]) + window?.setSize(size[0]! + 1, size[1]! + 1) + window?.setSize(size[0]!, size[1]!) }, timeout) } diff --git a/apps/main/src/modules/language-detection/index.ts b/apps/main/src/modules/language-detection/index.ts index 9e683d5f0..f54a56c17 100644 --- a/apps/main/src/modules/language-detection/index.ts +++ b/apps/main/src/modules/language-detection/index.ts @@ -73,7 +73,7 @@ export const detectCodeStringLanguage = async function* (codeString: string) { logger.debug("no model results", codeString) return } - const firstModelResult = adjustLanguageConfidence(modelResults[0]) + const firstModelResult = adjustLanguageConfidence(modelResults[0]!) if (firstModelResult.confidence < expectedRelativeConfidence) { logger.debug("first model result confidence is less than expected relative confidence") return diff --git a/apps/main/src/tipc/reader.ts b/apps/main/src/tipc/reader.ts index 06b04b476..aa98d7d5d 100644 --- a/apps/main/src/tipc/reader.ts +++ b/apps/main/src/tipc/reader.ts @@ -29,14 +29,32 @@ export const readerRoute = { .input<{ id: string text: string + voice: string }>() - .action(async ({ input }) => { - const { id, text } = input - + .action(async ({ input, context: { sender } }) => { + const { id, text, voice } = input if (!text) { return null } + const window = BrowserWindow.fromWebContents(sender) + if (!window) return + + // It's ok to set voice every time, because it will be cached by msedge-tts + await tts + .setMetadata(voice, OUTPUT_FORMAT.WEBM_24KHZ_16BIT_MONO_OPUS) + .catch((error: unknown) => { + console.error("Failed to set voice", error) + if (error instanceof Error) { + return callWindowExpose(window).toast.error(error.message, { + duration: 1000, + }) + } + return callWindowExpose(window).toast.error("Failed to set voice", { + duration: 1000, + }) + }) + const filePath = path.join(app.getPath("userData"), `${id}.webm`) if (fs.existsSync(filePath)) { return filePath @@ -62,25 +80,6 @@ export const readerRoute = { } }), - setVoice: t.procedure.input().action(async ({ input, context: { sender } }) => { - const window = BrowserWindow.fromWebContents(sender) - if (!window) return - - await tts - .setMetadata(input, OUTPUT_FORMAT.WEBM_24KHZ_16BIT_MONO_OPUS) - .catch((error: unknown) => { - console.error("Failed to set voice", error) - if (error instanceof Error) { - return callWindowExpose(window).toast.error(error.message, { - duration: 1000, - }) - } - return callWindowExpose(window).toast.error("Failed to set voice", { - duration: 1000, - }) - }) - }), - detectCodeStringLanguage: t.procedure .input<{ codeString: string }>() .action(async ({ input }) => { diff --git a/apps/main/src/updater/custom-github-provider.ts b/apps/main/src/updater/custom-github-provider.ts index b1e6ca348..567b9dfb0 100644 --- a/apps/main/src/updater/custom-github-provider.ts +++ b/apps/main/src/updater/custom-github-provider.ts @@ -87,7 +87,7 @@ export class CustomGitHubProvider extends BaseGitHubProvider { if (hrefElement === null) continue // This Release's Tag - const hrefTag = hrefElement[1] + const hrefTag = hrefElement[1]! // Get Channel from this release's tag // If it is null, we believe it is stable version const hrefChannel = (semver.prerelease(hrefTag)?.[0] as string) || "stable" diff --git a/apps/main/src/updater/hot-updater.ts b/apps/main/src/updater/hot-updater.ts index 68b7e6d79..4c02b89ef 100644 --- a/apps/main/src/updater/hot-updater.ts +++ b/apps/main/src/updater/hot-updater.ts @@ -40,7 +40,7 @@ const getLatestReleaseTag = async () => { // Search the top nightly release const nightlyRelease = json.find((item) => item.prerelease) - if (!nightlyRelease) return json[0].tag_name + if (!nightlyRelease) return json[0]!.tag_name return nightlyRelease.tag_name } } diff --git a/apps/main/src/window.ts b/apps/main/src/window.ts index aa6b15eb7..e854e5a57 100644 --- a/apps/main/src/window.ts +++ b/apps/main/src/window.ts @@ -222,12 +222,7 @@ export function createWindow( } export const windowStateStoreKey = "windowState" export const createMainWindow = () => { - const windowState = store.get(windowStateStoreKey) as { - height: number - width: number - x: number - y: number - } | null + const windowState = store.get(windowStateStoreKey) const primaryDisplay = screen.getPrimaryDisplay() const { workArea } = primaryDisplay diff --git a/apps/main/tsconfig.json b/apps/main/tsconfig.json index 83e899f20..7195126e3 100644 --- a/apps/main/tsconfig.json +++ b/apps/main/tsconfig.json @@ -3,11 +3,13 @@ "compilerOptions": { "composite": true, "outDir": "dist", - "types": ["electron-vite/node"], + "types": ["electron-vite/node", "@follow/types/vite"], "moduleResolution": "Bundler", "noImplicitReturns": false, "noUnusedLocals": false, "noUnusedParameters": false, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, "baseUrl": ".", "paths": { "@pkg": ["../../package.json"], diff --git a/apps/mobile/app.config.ts b/apps/mobile/app.config.ts index ea2d31647..fd4a0d113 100644 --- a/apps/mobile/app.config.ts +++ b/apps/mobile/app.config.ts @@ -2,12 +2,14 @@ import { resolve } from "node:path" import type { ConfigContext, ExpoConfig } from "expo/config" +import PKG from "./package.json" + // const roundedIconPath = resolve(__dirname, "../../resources/icon.png") const iconPath = resolve(__dirname, "./assets/icon.png") const adaptiveIconPath = resolve(__dirname, "./assets/adaptive-icon.png") - export default ({ config }: ConfigContext): ExpoConfig => ({ ...config, + extra: { eas: { projectId: "a6335b14-fb84-45aa-ba80-6f6ab8926920", @@ -23,7 +25,7 @@ export default ({ config }: ConfigContext): ExpoConfig => ({ name: "Follow", slug: "follow", - version: "1.0.0", + version: process.env.NODE_ENV === "development" ? "dev" : PKG.version, orientation: "portrait", icon: iconPath, scheme: "follow", @@ -50,6 +52,13 @@ export default ({ config }: ConfigContext): ExpoConfig => ({ favicon: iconPath, }, plugins: [ + [ + "expo-document-picker", + { + iCloudContainerEnvironment: "Production", + }, + ], + "expo-localization", [ "expo-router", { @@ -65,6 +74,8 @@ export default ({ config }: ConfigContext): ExpoConfig => ({ }, }, ], + "expo-build-properties", + "expo-sqlite", [ "expo-font", { @@ -89,6 +100,7 @@ export default ({ config }: ConfigContext): ExpoConfig => ({ }, ], "expo-apple-authentication", + "expo-av", [require("./scripts/with-follow-assets.js")], [require("./scripts/with-follow-app-delegate.js")], "expo-secure-store", diff --git a/apps/mobile/global.d.ts b/apps/mobile/global.d.ts index 8e9d706bf..9aed8ba26 100644 --- a/apps/mobile/global.d.ts +++ b/apps/mobile/global.d.ts @@ -1,7 +1,8 @@ import type { DOMProps } from "expo/dom" import type { FC } from "react" +import type WebView from "react-native-webview" declare global { - export type WebComponent

= FC

+ export type WebComponent

= FC

> } export {} diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 3899f1b20..b5cdae33b 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@follow/mobile", - "version": "1.0.0", + "version": "0.1.0", "private": true, "main": "src/main.tsx", "scripts": { @@ -11,10 +11,12 @@ "ios:device": "expo run:ios --device", "lint": "expo lint", "start": "expo start --dev-client", + "typecheck": "tsc --noEmit", "web": "expo start --web" }, "dependencies": { "@better-auth/expo": "1.1.9-beta.1", + "@expo/react-native-action-sheet": "4.1.0", "@expo/vector-icons": "^14.0.2", "@follow/components": "workspace:*", "@follow/constants": "workspace:*", @@ -24,8 +26,6 @@ "@follow/utils": "workspace:*", "@gorhom/portal": "1.0.14", "@hookform/resolvers": "3.9.1", - "@infinite-list/data-model": "2.2.10", - "@infinite-list/react-native": "2.2.10", "@react-native-picker/picker": "2.9.0", "@react-navigation/bottom-tabs": "^7.0.0", "@react-navigation/drawer": "^7.1.1", @@ -35,30 +35,34 @@ "better-auth": "1.1.9-beta.1", "cookie-es": "^1.2.2", "dayjs": "1.11.13", + "dnum": "^2.14.0", "es-toolkit": "1.29.0", - "expo": "52.0.18", - "expo-apple-authentication": "~7.1.2", - "expo-blur": "~14.0.1", - "expo-build-properties": "^0.13.1", - "expo-clipboard": "~7.0.0", - "expo-constants": "~17.0.3", - "expo-dev-client": "^5.0.9", - "expo-file-system": "~18.0.6", - "expo-font": "~13.0.1", - "expo-haptics": "~14.0.0", - "expo-image": "~2.0.3", - "expo-linear-gradient": "~14.0.1", - "expo-linking": "~7.0.3", - "expo-router": "4.0.11", + "expo": "52.0.27", + "expo-apple-authentication": "~7.1.3", + "expo-av": "~15.0.2", + "expo-blur": "~14.0.3", + "expo-build-properties": "^0.13.2", + "expo-clipboard": "~7.0.1", + "expo-constants": "~17.0.4", + "expo-dev-client": "^5.0.10", + "expo-document-picker": "~13.0.2", + "expo-file-system": "~18.0.7", + "expo-font": "~13.0.3", + "expo-haptics": "~14.0.1", + "expo-image": "~2.0.4", + "expo-linear-gradient": "~14.0.2", + "expo-linking": "~7.0.4", + "expo-localization": "~16.0.1", + "expo-router": "4.0.17", "expo-secure-store": "^14.0.1", - "expo-sharing": "~13.0.0", - "expo-splash-screen": "~0.29.18", - "expo-sqlite": "15.0.3", - "expo-status-bar": "~2.0.0", - "expo-symbols": "~0.2.0", - "expo-system-ui": "~4.0.6", - "expo-updates": "~0.26.10", - "expo-web-browser": "~14.0.1", + "expo-sharing": "~13.0.1", + "expo-splash-screen": "~0.29.21", + "expo-sqlite": "15.0.6", + "expo-status-bar": "~2.0.1", + "expo-symbols": "~0.2.1", + "expo-system-ui": "~4.0.7", + "expo-updates": "~0.26.13", + "expo-web-browser": "~14.0.2", "hono": "4.6.13", "immer": "10.1.1", "jotai": "2.10.3", @@ -68,25 +72,28 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-hook-form": "7.54.0", - "react-native": "0.76.5", + "react-native": "0.77.0", "react-native-bouncy-checkbox": "4.1.2", + "react-native-color-matrix-image-filters": "^7.0.2", "react-native-context-menu-view": "1.16.0", - "react-native-gesture-handler": "~2.20.2", + "react-native-gesture-handler": "~2.22.0", "react-native-image-colors": "2.4.0", "react-native-ios-context-menu": "3.1.0", - "react-native-ios-utilities": "5.1.0", + "react-native-ios-utilities": "5.1.1", "react-native-keyboard-controller": "^1.15.0", - "react-native-pager-view": "6.6.1", - "react-native-reanimated": "~3.16.5", + "react-native-pager-view": "6.5.1", + "react-native-reanimated": "~3.16.7", "react-native-root-siblings": "5.0.1", - "react-native-safe-area-context": "4.12.0", - "react-native-screens": "~4.1.0", + "react-native-safe-area-context": "5.1.0", + "react-native-screens": "~4.5.0", "react-native-svg": "15.8.0", + "react-native-uikit-colors": "0.1.2", "react-native-web": "~0.19.13", - "react-native-webview": "13.12.5", - "swiftui-react-native": "6.3.3", + "react-native-webview": "13.13.1", + "shiki": "1.24.1", "tailwindcss": "3.4.16", "usehooks-ts": "3.1.0", + "zeego": "2.0.4", "zod": "3.24.1", "zustand": "5.0.2" }, @@ -101,5 +108,17 @@ "expo-drizzle-studio-plugin": "0.1.1", "postcss": "8.4.49", "react-test-renderer": "18.3.1" + }, + "expo": { + "install": { + "exclude": [ + "react-native@~0.77.0", + "react-native-reanimated@~3.16.7", + "react-native-gesture-handler@~2.22.0", + "react-native-screens@~4.5.0", + "react-native-safe-area-context@~5.1.0", + "react-native-webview@~13.12.5" + ] + } } } diff --git a/apps/mobile/src/atoms/settings/data.ts b/apps/mobile/src/atoms/settings/data.ts new file mode 100644 index 000000000..b601933b2 --- /dev/null +++ b/apps/mobile/src/atoms/settings/data.ts @@ -0,0 +1,18 @@ +import type { DataSettings } from "@/src/interfaces/settings/data" + +import { createSettingAtom } from "./internal/helper" + +export const createDefaultSettings = (): DataSettings => ({ + sendAnonymousData: true, +}) + +export const { + useSettingKey: useDataSettingKey, + useSettingSelector: useDataSettingSelector, + useSettingKeys: useDataSettingKeys, + setSetting: setDataSetting, + clearSettings: clearDataSettings, + initializeDefaultSettings: initializeDefaultDataSettings, + getSettings: getDataSettings, + useSettingValue: useDataSettingValue, +} = createSettingAtom("data", createDefaultSettings) diff --git a/apps/mobile/src/atoms/settings/general.ts b/apps/mobile/src/atoms/settings/general.ts new file mode 100644 index 000000000..756503704 --- /dev/null +++ b/apps/mobile/src/atoms/settings/general.ts @@ -0,0 +1,44 @@ +import type { GeneralSettings } from "@/src/interfaces/settings/general" + +import { createSettingAtom } from "./internal/helper" + +const createDefaultSettings = (): GeneralSettings => ({ + // App + + language: "en", + translationLanguage: "zh-CN", + + // Data control + + sendAnonymousData: true, + + autoGroup: true, + + // view + unreadOnly: true, + // mark unread + scrollMarkUnread: true, + + renderMarkUnread: false, + // UX + groupByDate: true, + autoExpandLongSocialMedia: false, + + // Secure + jumpOutLinkWarn: true, + // TTS + voice: "en-US-AndrewMultilingualNeural", +}) + +export const { + useSettingKey: useGeneralSettingKey, + useSettingSelector: useGeneralSettingSelector, + useSettingKeys: useGeneralSettingKeys, + setSetting: setGeneralSetting, + clearSettings: clearGeneralSettings, + initializeDefaultSettings: initializeDefaultGeneralSettings, + getSettings: getGeneralSettings, + useSettingValue: useGeneralSettingValue, + + settingAtom: __generalSettingAtom, +} = createSettingAtom("general", createDefaultSettings) diff --git a/apps/mobile/src/atoms/settings/internal/helper.ts b/apps/mobile/src/atoms/settings/internal/helper.ts new file mode 100644 index 000000000..d6d37fce4 --- /dev/null +++ b/apps/mobile/src/atoms/settings/internal/helper.ts @@ -0,0 +1,160 @@ +import { useRefValue } from "@follow/hooks" +import { createAtomHooks } from "@follow/utils" +import type { SetStateAction, WritableAtom } from "jotai" +import { atom as jotaiAtom, useAtomValue } from "jotai" +import { atomWithStorage, selectAtom } from "jotai/utils" +import { useMemo } from "react" +import { shallow } from "zustand/shallow" + +import { JotaiPersistSyncStorage } from "@/src/lib/jotai" + +const getStorageNS = (settingKey: string) => `follow-rn-${settingKey}` +type Nullable = T | null | undefined + +export const createSettingAtom = ( + settingKey: string, + createDefaultSettings: () => T, +) => { + const atom = atomWithStorage( + getStorageNS(settingKey), + createDefaultSettings(), + JotaiPersistSyncStorage, + { + getOnInit: true, + }, + ) as WritableAtom], void> + + const [, , useSettingValue, , getSettings, setSettings] = createAtomHooks(atom) + + const initializeDefaultSettings = () => { + const currentSettings = getSettings() + const defaultSettings = createDefaultSettings() + if (typeof currentSettings !== "object") setSettings(defaultSettings) + const newSettings = { ...defaultSettings, ...currentSettings } + setSettings(newSettings) + } + + const selectAtomCacheMap = {} as Record, any> + + const noopAtom = jotaiAtom(null) + + const useMaybeSettingKey = >(key: Nullable) => { + // @ts-expect-error + let selectedAtom: Record[T] | null = null + if (key) { + selectedAtom = selectAtomCacheMap[key] + if (!selectedAtom) { + selectedAtom = selectAtom(atom, (s) => s[key]) + selectAtomCacheMap[key] = selectedAtom + } + } else { + selectedAtom = noopAtom + } + + return useAtomValue(selectedAtom) as ReturnType[T] + } + + const useSettingKey = >(key: T) => { + return useMaybeSettingKey(key) as ReturnType[T] + } + + function useSettingKeys< + T extends keyof ReturnType, + K1 extends T, + K2 extends T, + K3 extends T, + K4 extends T, + K5 extends T, + K6 extends T, + K7 extends T, + K8 extends T, + K9 extends T, + K10 extends T, + >(keys: [K1, K2?, K3?, K4?, K5?, K6?, K7?, K8?, K9?, K10?]) { + return [ + useMaybeSettingKey(keys[0]), + useMaybeSettingKey(keys[1]), + useMaybeSettingKey(keys[2]), + useMaybeSettingKey(keys[3]), + useMaybeSettingKey(keys[4]), + useMaybeSettingKey(keys[5]), + useMaybeSettingKey(keys[6]), + useMaybeSettingKey(keys[7]), + useMaybeSettingKey(keys[8]), + useMaybeSettingKey(keys[9]), + ] as [ + ReturnType[K1], + ReturnType[K2], + ReturnType[K3], + ReturnType[K4], + ReturnType[K5], + ReturnType[K6], + ReturnType[K7], + ReturnType[K8], + ReturnType[K9], + ReturnType[K10], + ] + } + + const useSettingSelector = < + T extends keyof ReturnType, + S extends ReturnType, + R = S[T], + >( + selector: (s: S) => R, + ): R => { + const stableSelector = useRefValue(selector) + + return useAtomValue( + // @ts-expect-error + useMemo(() => selectAtom(atom, stableSelector.current, shallow), [stableSelector]), + ) + } + + const setSetting = >( + key: K, + value: ReturnType[K], + ) => { + const updated = Date.now() + setSettings({ + ...getSettings(), + [key]: value, + + updated, + }) + } + + const clearSettings = () => { + setSettings(createDefaultSettings()) + } + + Object.defineProperty(useSettingValue, "select", { + value: useSettingSelector, + }) + + return { + useSettingKey, + useSettingSelector, + setSetting, + clearSettings, + initializeDefaultSettings, + + useSettingValue, + useSettingKeys, + getSettings, + + settingAtom: atom, + } as { + useSettingKey: typeof useSettingKey + useSettingSelector: typeof useSettingSelector + setSetting: typeof setSetting + clearSettings: typeof clearSettings + initializeDefaultSettings: typeof initializeDefaultSettings + useSettingValue: typeof useSettingValue & { + select: T>>(key: T) => Awaited + } + useSettingKeys: typeof useSettingKeys + getSettings: typeof getSettings + settingAtom: typeof atom + } +} diff --git a/apps/mobile/src/atoms/settings/ui.ts b/apps/mobile/src/atoms/settings/ui.ts new file mode 100644 index 000000000..7d3b4bd11 --- /dev/null +++ b/apps/mobile/src/atoms/settings/ui.ts @@ -0,0 +1,36 @@ +import type { UISettings } from "@/src/interfaces/settings/ui" + +import { createSettingAtom } from "./internal/helper" + +export const createDefaultSettings = (): UISettings => ({ + // Subscription + + hideExtraBadge: false, + + subscriptionShowUnreadCount: true, + thumbnailRatio: "square", + + // Content + readerRenderInlineStyle: false, + codeHighlightThemeLight: "github-light", + codeHighlightThemeDark: "github-dark", + guessCodeLanguage: true, + hideRecentReader: false, + customCSS: "", + + // View + + pictureViewFilterNoImage: false, +}) + +export const { + useSettingKey: useUISettingKey, + useSettingSelector: useUISettingSelector, + useSettingKeys: useUISettingKeys, + setSetting: setUISetting, + clearSettings: clearUISettings, + initializeDefaultSettings: initializeDefaultUISettings, + getSettings: getUISettings, + useSettingValue: useUISettingValue, + settingAtom: __uiSettingAtom, +} = createSettingAtom("ui", createDefaultSettings) diff --git a/apps/mobile/src/components/common/AnimatedComponents.tsx b/apps/mobile/src/components/common/AnimatedComponents.tsx index 602341839..6da5b5c47 100644 --- a/apps/mobile/src/components/common/AnimatedComponents.tsx +++ b/apps/mobile/src/components/common/AnimatedComponents.tsx @@ -1,3 +1,4 @@ +import { Image as ExpoImage } from "expo-image" import { Animated, FlatList, Pressable, ScrollView, TouchableOpacity } from "react-native" import Reanimated from "react-native-reanimated" @@ -5,6 +6,7 @@ export const AnimatedScrollView = Animated.createAnimatedComponent(ScrollView) export const AnimatedFlatList = Animated.createAnimatedComponent(FlatList) export const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity) +export const ReAnimatedExpoImage = Reanimated.createAnimatedComponent(ExpoImage) export const ReAnimatedPressable = Reanimated.createAnimatedComponent(Pressable) export const ReAnimatedScrollView = Reanimated.createAnimatedComponent(ScrollView) export const ReAnimatedTouchableOpacity = Reanimated.createAnimatedComponent(TouchableOpacity) diff --git a/apps/mobile/src/components/common/Balance.tsx b/apps/mobile/src/components/common/Balance.tsx new file mode 100644 index 000000000..4d08e09b2 --- /dev/null +++ b/apps/mobile/src/components/common/Balance.tsx @@ -0,0 +1,69 @@ +import { cn, toScientificNotation } from "@follow/utils" +import { Text } from "react-native" + +export const Balance = ({ + children, + + className, + precision = 2, +}: { + /** The token balance in wei. */ + children: bigint + + className?: string + precision?: number +}) => { + const n = BigInt(children || 0n) + const formatted = format(n, { digits: precision, trailingZeros: true }) + + return {formatted} +} + +function format( + value: bigint, + options: + | number + | { + digits?: number + compact?: boolean + trailingZeros?: boolean + locale?: string + decimalsRounding?: "ROUND_HALF" | "ROUND_UP" | "ROUND_DOWN" + signDisplay?: "auto" | "always" | "exceptZero" | "negative" | "never" + } = {}, +): string { + // Normalize options + const opts = typeof options === "number" ? { digits: options } : options + const { + digits, + compact = false, + trailingZeros = false, + locale = "en-US", + + signDisplay = "auto", + } = opts + + // Convert bigint to number for formatting + const num = Number(value) / 1e18 // Assuming 18 decimals (wei to ether conversion) + + if (compact) { + return new Intl.NumberFormat(locale, { + notation: "compact", + maximumFractionDigits: digits, + minimumFractionDigits: trailingZeros ? digits : 0, + signDisplay, + }).format(num) + } + + // For very large or small numbers, use scientific notation + if (Math.abs(num) > 1e9 || (Math.abs(num) < 1e-9 && num !== 0)) { + return toScientificNotation(num.toString(), 10) + } + + return new Intl.NumberFormat(locale, { + maximumFractionDigits: digits, + minimumFractionDigits: trailingZeros ? digits : 0, + signDisplay, + useGrouping: true, + }).format(num) +} diff --git a/apps/mobile/src/components/common/BlurEffect.tsx b/apps/mobile/src/components/common/BlurEffect.tsx new file mode 100644 index 000000000..aff6b96ef --- /dev/null +++ b/apps/mobile/src/components/common/BlurEffect.tsx @@ -0,0 +1,34 @@ +import { StyleSheet } from "react-native" +import { useColor } from "react-native-uikit-colors" + +import { ThemedBlurView } from "@/src/components/common/ThemedBlurView" + +const node = ( + +) +export const BlurEffect = () => { + return node +} + +const InternalBlurEffectWithBottomBorder = () => { + const border = useColor("opaqueSeparator") + return ( + + ) +} + +export const BlurEffectWithBottomBorder = () => diff --git a/apps/mobile/src/components/common/FollowWebView.tsx b/apps/mobile/src/components/common/FollowWebView.tsx index 474f2fba2..2bfbd02e6 100644 --- a/apps/mobile/src/components/common/FollowWebView.tsx +++ b/apps/mobile/src/components/common/FollowWebView.tsx @@ -1,14 +1,13 @@ import { callWebviewExpose } from "@follow/shared" -import { parseSafeUrl, transformVideoUrl } from "@follow/utils" import * as Linking from "expo-linking" import type { RefObject } from "react" import { useCallback, useEffect, useState } from "react" import { Platform } from "react-native" -import type { WebViewNavigation, WebViewProps } from "react-native-webview" +import type { WebViewProps } from "react-native-webview" import { WebView } from "react-native-webview" +import { useWebViewNavigation } from "@/src/hooks/useWebViewNavigation" import { signOut } from "@/src/lib/auth" -import { useOpenLink } from "@/src/lib/hooks/use-open-link" const presetUri = Platform.select({ ios: "rn-web/index.html", @@ -16,8 +15,6 @@ const presetUri = Platform.select({ default: "https://app.follow.is", }) -const allowHosts = new Set(["app.follow.is"]) - interface FollowWebViewProps extends WebViewProps { customUrl?: string } @@ -80,32 +77,6 @@ export const FollowWebView = ({ ) } -const useWebViewNavigation = ({ webViewRef }: { webViewRef: RefObject }) => { - const openLink = useOpenLink() - - const onNavigationStateChange = useCallback( - (newNavState: WebViewNavigation) => { - const { url: urlStr } = newNavState - const url = parseSafeUrl(urlStr) - if (!url) return - if (url.protocol === "file:") return - if (allowHosts.has(url.host)) return - - webViewRef.current?.stopLoading() - - const formattedUrl = transformVideoUrl({ url: urlStr }) - if (formattedUrl) { - openLink(formattedUrl) - return - } - openLink(urlStr) - }, - [openLink, webViewRef], - ) - - return { onNavigationStateChange } -} - // We only need to handle deep link at the first time the app is opened let lastInitialUrl: string | null = null const useDeepLink = ({ diff --git a/apps/mobile/src/components/common/HeaderBlur.tsx b/apps/mobile/src/components/common/HeaderBlur.tsx deleted file mode 100644 index 06f8f0159..000000000 --- a/apps/mobile/src/components/common/HeaderBlur.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { StyleSheet } from "react-native" - -import { ThemedBlurView } from "@/src/components/common/ThemedBlurView" - -const node = ( - -) -export const BlurEffect = () => { - return node -} diff --git a/apps/mobile/src/components/common/ModalSharedComponents.tsx b/apps/mobile/src/components/common/ModalSharedComponents.tsx index f6dcc3160..af3df0adc 100644 --- a/apps/mobile/src/components/common/ModalSharedComponents.tsx +++ b/apps/mobile/src/components/common/ModalSharedComponents.tsx @@ -30,16 +30,16 @@ const ModalHeaderCloseButtonImpl = () => { ) } -export interface ModalHeaderShubmitButtonProps { +export interface ModalHeaderSubmitButtonProps { isValid: boolean onPress: () => void isLoading?: boolean } -export const ModalHeaderShubmitButton = ({ +export const ModalHeaderSubmitButton = ({ isValid, onPress, isLoading, -}: ModalHeaderShubmitButtonProps) => { +}: ModalHeaderSubmitButtonProps) => { return } @@ -47,8 +47,9 @@ const ModalHeaderShubmitButtonImpl = ({ isValid, onPress, isLoading, -}: ModalHeaderShubmitButtonProps) => { +}: ModalHeaderSubmitButtonProps) => { const label = useColor("label") + return ( {isLoading ? ( diff --git a/apps/mobile/src/components/common/SafeModalScrollView.tsx b/apps/mobile/src/components/common/SafeModalScrollView.tsx new file mode 100644 index 000000000..85a5692c1 --- /dev/null +++ b/apps/mobile/src/components/common/SafeModalScrollView.tsx @@ -0,0 +1,28 @@ +/** + * @description only for iOS modal + * + * ``` + * Set screen options: + * + headerTransparent: true, + * + headerBackground: BlurEffectWithBottomBorder, + * ``` + */ +import { useHeaderHeight } from "@react-navigation/elements" +import type { KeyboardAwareScrollViewProps } from "react-native-keyboard-controller" +import { KeyboardAwareScrollView } from "react-native-keyboard-controller" +import { useSafeAreaInsets } from "react-native-safe-area-context" + +interface SafeModalScrollViewProps extends KeyboardAwareScrollViewProps {} +export const SafeModalScrollView = (props: SafeModalScrollViewProps) => { + const headerHeight = useHeaderHeight() + const insets = useSafeAreaInsets() + return ( + + {props.children} + + ) +} diff --git a/apps/mobile/src/components/common/SafeNavigationScrollView.tsx b/apps/mobile/src/components/common/SafeNavigationScrollView.tsx index 089e8f3d8..5b3c50486 100644 --- a/apps/mobile/src/components/common/SafeNavigationScrollView.tsx +++ b/apps/mobile/src/components/common/SafeNavigationScrollView.tsx @@ -1,20 +1,170 @@ import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs" -import { useHeaderHeight } from "@react-navigation/elements" -import type { FC } from "react" +import { Header, useHeaderHeight } from "@react-navigation/elements" +import type { NativeStackNavigationOptions } from "@react-navigation/native-stack" +import { router, Stack, useNavigation } from "expo-router" +import type { FC, PropsWithChildren } from "react" +import { createContext, useContext, useEffect, useMemo, useRef } from "react" import type { ScrollViewProps } from "react-native" -import { ScrollView, View } from "react-native" +import { + Animated as RNAnimated, + StyleSheet, + TouchableOpacity, + useAnimatedValue, + View, +} from "react-native" +import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated" +import type { ReanimatedScrollEvent } from "react-native-reanimated/lib/typescript/hook/commonTypes" import { useSafeAreaInsets } from "react-native-safe-area-context" +import { useColor } from "react-native-uikit-colors" -export const SafeNavigationScrollView: FC = ({ children, ...props }) => { - const headerHeight = useHeaderHeight() - const tabBarHeight = useBottomTabBarHeight() +import { useDefaultHeaderHeight } from "@/src/hooks/useDefaultHeaderHeight" +import { MingcuteLeftLineIcon } from "@/src/icons/mingcute_left_line" + +import { AnimatedScrollView } from "./AnimatedComponents" +import { ThemedBlurView } from "./ThemedBlurView" + +type SafeNavigationScrollViewProps = Omit & { + withHeaderBlur?: boolean + onScroll?: (e: ReanimatedScrollEvent) => void + + // For scroll view content adjustment behavior + withTopInset?: boolean + withBottomInset?: boolean +} & PropsWithChildren +export const NavigationContext = createContext<{ + scrollY: RNAnimated.Value +} | null>(null) + +export const SafeNavigationScrollView: FC = ({ + children, + + withHeaderBlur = true, + onScroll, + + withBottomInset = false, + withTopInset = false, + + ...props +}) => { const insets = useSafeAreaInsets() + const tabBarHeight = useBottomTabBarHeight() + const headerHeight = useHeaderHeight() + + const scrollY = useAnimatedValue(0) return ( - - - {children} - - + ({ scrollY }), [scrollY])}> + {withHeaderBlur && } + + + {children} + + + + ) +} + +export const NavigationBlurEffectHeader = ({ + blurThreshold = 0, + headerHideableBottomHeight = 50, + headerHideableBottom, + ...props +}: NativeStackNavigationOptions & { + blurThreshold?: number + headerHideableBottomHeight?: number + headerHideableBottom?: () => React.ReactNode +}) => { + const label = useColor("label") + + const canBack = useNavigation().canGoBack() + + const { scrollY } = useContext(NavigationContext)! + + const border = useColor("opaqueSeparator") + + const opacityAnimated = useSharedValue(0) + + const originalDefaultHeaderHeight = useDefaultHeaderHeight() + const largeDefaultHeaderHeight = originalDefaultHeaderHeight + headerHideableBottomHeight + + const largeHeaderHeight = useSharedValue(largeDefaultHeaderHeight) + + const lastScrollY = useRef(0) + + useEffect(() => { + const id = scrollY.addListener(({ value }) => { + opacityAnimated.value = Math.max(0, Math.min(1, (value + blurThreshold) / 10)) + if (headerHideableBottom && value > 0) { + if (value > lastScrollY.current) { + largeHeaderHeight.value = withTiming(originalDefaultHeaderHeight) + } else { + largeHeaderHeight.value = withTiming(largeDefaultHeaderHeight) + } + lastScrollY.current = value + } + }) + + return () => { + scrollY.removeListener(id) + } + }, [ + blurThreshold, + scrollY, + headerHideableBottom, + largeHeaderHeight, + originalDefaultHeaderHeight, + largeDefaultHeaderHeight, + opacityAnimated, + ]) + + const style = useAnimatedStyle(() => ({ + opacity: opacityAnimated.value, + ...StyleSheet.absoluteFillObject, + borderBottomWidth: StyleSheet.hairlineWidth, + borderBottomColor: border, + })) + + const hideableBottom = headerHideableBottom?.() + + return ( + ( + + + + ), + headerTransparent: true, + + headerLeft: canBack + ? () => ( + router.back()}> + + + ) + : undefined, + + header: headerHideableBottom + ? ({ options }) => { + return ( + + + {options.headerBackground?.()} + +

null} /> + {hideableBottom} + + ) + } + : undefined, + + ...props, + }} + /> ) } diff --git a/apps/mobile/src/components/common/SwipeableItem.tsx b/apps/mobile/src/components/common/SwipeableItem.tsx new file mode 100644 index 000000000..9adeed507 --- /dev/null +++ b/apps/mobile/src/components/common/SwipeableItem.tsx @@ -0,0 +1,302 @@ +import { useTypeScriptHappyCallback } from "@follow/hooks" +import { impactAsync, ImpactFeedbackStyle } from "expo-haptics" +import { atom, useAtomValue, useSetAtom } from "jotai" +import { selectAtom } from "jotai/utils" +import * as React from "react" +import { Animated, StyleSheet, Text, View } from "react-native" +import { RectButton, Swipeable } from "react-native-gesture-handler" + +interface Action { + label: string + icon?: React.ReactNode + backgroundColor?: string + onPress?: () => void + color?: string +} + +interface SwipeableItemProps { + children: React.ReactNode + leftActions?: Action[] + rightActions?: Action[] + disabled?: boolean + + swipeRightToCallAction?: boolean +} + +const styles = StyleSheet.create({ + absoluteFill: { + ...StyleSheet.absoluteFillObject, + }, + actionContainer: { + flex: 1, + justifyContent: "center", + alignItems: "center", + }, + animatedContainer: { + position: "absolute", + top: 0, + bottom: 0, + }, + actionsWrapper: { + flexDirection: "row", + }, + actionText: { + color: "#fff", + }, +}) + +const rectButtonWidth = 74 + +export const SwipeableItem: React.FC = ({ + children, + leftActions, + rightActions, + disabled, + + swipeRightToCallAction, +}) => { + const itemRef = React.useRef(null) + + const endDragCallerRef = React.useRef<() => void>(() => {}) + + const renderLeftActions = (progress: Animated.AnimatedInterpolation) => { + const width = leftActions?.length ? leftActions.length * rectButtonWidth : rectButtonWidth + + return ( + <> + + + {leftActions?.map((action, index) => { + const trans = progress.interpolate({ + inputRange: [0, 1], + outputRange: [-rectButtonWidth * (leftActions?.length ?? 1), 0], + }) + + return ( + + + {action.icon} + + {action.label} + + + + ) + })} + + + ) + } + + const renderRightActions = (progress: Animated.AnimatedInterpolation) => { + const width = rightActions?.length ? rightActions.length * rectButtonWidth : rectButtonWidth + + return ( + <> + + + {rightActions?.map((action, index) => { + return ( + + ) + })} + + + ) + } + + const id = React.useId() + const { swipeableOpenedId } = React.useContext(SwipeableGroupContext) + + const setAtom = useSetAtom(swipeableOpenedId) + const isOpened = useAtomValue( + React.useMemo( + () => selectAtom(swipeableOpenedId, (value) => value === id), + [id, swipeableOpenedId], + ), + ) + + React.useEffect(() => { + if (!isOpened) { + itemRef.current?.close() + } + }, [isOpened]) + + return ( + { + setAtom(id) + }} + leftThreshold={37} + rightThreshold={37} + enableTrackpadTwoFingerGesture + useNativeAnimations + onEnded={useTypeScriptHappyCallback(() => { + if (swipeRightToCallAction && endDragCallerRef.current) { + endDragCallerRef.current() + } + }, [swipeRightToCallAction, endDragCallerRef])} + renderLeftActions={leftActions?.length ? renderLeftActions : undefined} + renderRightActions={rightActions?.length ? renderRightActions : undefined} + overshootLeft={leftActions?.length ? leftActions?.length >= 1 : undefined} + overshootRight={rightActions?.length ? rightActions?.length >= 1 : undefined} + overshootFriction={swipeRightToCallAction ? 1 : 10} + > + {children} + + ) +} + +const SwipeableGroupContext = React.createContext({ + swipeableOpenedId: atom(""), +}) + +export const SwipeableGroupProvider = ({ children }: { children: React.ReactNode }) => { + const ctx = React.useMemo( + () => ({ + swipeableOpenedId: atom(""), + }), + [], + ) + + return {children} +} + +const rightActionThreshold = -100 +const RightRectButton = React.memo( + ({ + index, + action, + length = 1, + progress, + swipeRightToCallAction, + endDragCallerRef, + }: { + progress: Animated.AnimatedInterpolation + index: number + action: Action + length: number + swipeRightToCallAction?: boolean + endDragCallerRef: React.MutableRefObject<() => void> + }) => { + const trans = React.useMemo( + () => + progress.interpolate({ + inputRange: [0, 1, 1.2], + outputRange: [rectButtonWidth * length, 0, -40], + }), + [progress, length], + ) + const parallaxX = React.useMemo( + () => + progress.interpolate({ + inputRange: [0, 1, 1.2], + outputRange: [0, 0, 10], + }), + [progress], + ) + + const hapticOnce = React.useRef(false) + + React.useEffect(() => { + if (!swipeRightToCallAction) return + const id = trans.addListener(({ value }) => { + if (value <= rightActionThreshold) { + if (hapticOnce.current) return + hapticOnce.current = true + impactAsync(ImpactFeedbackStyle.Light) + endDragCallerRef.current = () => { + action.onPress?.() + } + } else { + hapticOnce.current = false + endDragCallerRef.current = () => {} + } + }) + + return () => { + trans.removeListener(id) + } + }, [action, endDragCallerRef, swipeRightToCallAction, trans]) + + return ( + + + {action.icon} + + {action.label} + + + + ) + }, +) diff --git a/apps/mobile/src/components/common/ThemedBlurView.tsx b/apps/mobile/src/components/common/ThemedBlurView.tsx index 806c3bdf8..f917ab97b 100644 --- a/apps/mobile/src/components/common/ThemedBlurView.tsx +++ b/apps/mobile/src/components/common/ThemedBlurView.tsx @@ -5,10 +5,12 @@ import { forwardRef } from "react" export const ThemedBlurView = forwardRef(({ tint, ...rest }, ref) => { const { colorScheme } = useColorScheme() + return ( ) diff --git a/apps/mobile/src/components/ui/dropdown/DropdownMenu.tsx b/apps/mobile/src/components/ui/dropdown/DropdownMenu.tsx new file mode 100644 index 000000000..97ae11779 --- /dev/null +++ b/apps/mobile/src/components/ui/dropdown/DropdownMenu.tsx @@ -0,0 +1,54 @@ +import type { NativeSyntheticEvent } from "react-native" +import type { ContextMenuOnPressNativeEvent } from "react-native-context-menu-view" +import ContextMenu from "react-native-context-menu-view" + +interface DropdownMenuAction { + title: string + actions?: DropdownMenuAction[] + selected?: boolean +} + +interface DropdownMenuSelector { + label: string + value: T +} + +export function DropdownMenu({ + options, + currentValue, + handleChangeValue, + handlePress, + children, +}: { + options: DropdownMenuSelector[] | DropdownMenuAction[] + currentValue?: T + handleChangeValue?: (value: T) => void + handlePress?: (e: NativeSyntheticEvent) => void + children: React.ReactNode +}) { + const isActionMenu = options.every((option) => "title" in option) + return ( + ({ + title: option.label, + selected: option.value === currentValue, + disabled: option.value === currentValue, + })) + } + onPress={(e) => { + if (!isActionMenu) { + const { index } = e.nativeEvent + handleChangeValue?.(options[index]!.value) + } + handlePress?.(e) + }} + > + {children} + + ) +} diff --git a/apps/mobile/src/components/ui/form/PickerIos.tsx b/apps/mobile/src/components/ui/form/PickerIos.tsx index 5c871f276..bf8cbe5ea 100644 --- a/apps/mobile/src/components/ui/form/PickerIos.tsx +++ b/apps/mobile/src/components/ui/form/PickerIos.tsx @@ -11,7 +11,7 @@ import { useEventCallback } from "usehooks-ts" import { MingcuteDownLineIcon } from "@/src/icons/mingcute_down_line" import { useColor } from "@/src/theme/colors" -import { BlurEffect } from "../../common/HeaderBlur" +import { BlurEffect } from "../../common/BlurEffect" interface PickerIosProps { options: { label: string; value: T }[] @@ -33,7 +33,7 @@ export function PickerIos({ const [currentValue, setCurrentValue] = useState(() => { if (!value) { - return options[0].value + return options[0]!.value } return value }) diff --git a/apps/mobile/src/components/ui/form/Select.tsx b/apps/mobile/src/components/ui/form/Select.tsx index d2810a1ec..acc228176 100644 --- a/apps/mobile/src/components/ui/form/Select.tsx +++ b/apps/mobile/src/components/ui/form/Select.tsx @@ -2,12 +2,12 @@ import { cn } from "@follow/utils" import { useEffect, useMemo, useState } from "react" import type { StyleProp, ViewStyle } from "react-native" import { Text, View } from "react-native" -import ContextMenu from "react-native-context-menu-view" import { useEventCallback } from "usehooks-ts" import { MingcuteDownLineIcon } from "@/src/icons/mingcute_down_line" import { accentColor } from "@/src/theme/colors" +import { DropdownMenu } from "../dropdown/DropdownMenu" import { FormLabel } from "./Label" interface SelectProps { @@ -31,7 +31,7 @@ export function Select({ }: SelectProps) { const [currentValue, setCurrentValue] = useState(() => { if (!value) { - return options[0].value + return options[0]!.value } return value }) @@ -52,36 +52,47 @@ export function Select({ onValueChange(currentValue) }, []) - return ( - - {!!label && } - - {/* Trigger */} - ({ - title: option.label, - selected: option.value === currentValue, - }))} - onPress={(e) => { - const { index } = e.nativeEvent - handleChangeValue(options[index].value) - }} + const Trigger = ( + + options={options.map((option) => ({ + label: option.label, + value: option.value, + }))} + currentValue={currentValue} + handleChangeValue={handleChangeValue} + > + - - {valueToLabelMap.get(currentValue)} - - - + {valueToLabelMap.get(currentValue)} + + + - + + + ) + + if (!label) { + return Trigger + } + + return ( + + + + + {Trigger} ) } diff --git a/apps/mobile/src/components/ui/form/Switch.tsx b/apps/mobile/src/components/ui/form/Switch.tsx index 7d179faef..20fa0a280 100644 --- a/apps/mobile/src/components/ui/form/Switch.tsx +++ b/apps/mobile/src/components/ui/form/Switch.tsx @@ -1,9 +1,9 @@ import { forwardRef } from "react" -import type { StyleProp, SwitchProps, ViewStyle } from "react-native" -import { Switch, Text, View } from "react-native" - -import { accentColor } from "@/src/theme/colors" +import type { StyleProp, ViewStyle } from "react-native" +import { Text, View } from "react-native" +import type { SwitchProps, SwitchRef } from "../switch/Switch" +import { Switch } from "../switch/Switch" import { FormLabel } from "./Label" interface Props { @@ -12,19 +12,26 @@ interface Props { label?: string description?: string + + size?: "sm" | "default" } -export const FormSwitch = forwardRef( - ({ wrapperClassName, wrapperStyle, label, description, ...rest }, ref) => { +export const FormSwitch = forwardRef( + ({ wrapperClassName, wrapperStyle, label, description, size = "default", ...rest }, ref) => { + const Trigger = + + if (!label) { + return Trigger + } return ( - {!!label && } + {!!description && ( {description} )} - + {Trigger} ) }, diff --git a/apps/mobile/src/components/ui/form/TextField.tsx b/apps/mobile/src/components/ui/form/TextField.tsx index 2ee4ca30b..fd04e30ea 100644 --- a/apps/mobile/src/components/ui/form/TextField.tsx +++ b/apps/mobile/src/components/ui/form/TextField.tsx @@ -7,25 +7,36 @@ import { accentColor } from "@/src/theme/colors" import { FormLabel } from "./Label" -interface TextFieldProps { +interface BaseFieldProps { wrapperClassName?: string wrapperStyle?: StyleProp - label?: string description?: string required?: boolean + + inputPostfixElement?: React.ReactNode } -export const TextField = forwardRef( +const BaseField = forwardRef( ( - { className, style, wrapperClassName, wrapperStyle, label, description, required, ...rest }, + { + className, + style, + wrapperClassName, + wrapperStyle, + label, + description, + required, + inputPostfixElement, + ...rest + }, ref, ) => { return ( - <> - {!!label && } + + {!!label && } {!!description && ( - {description} + {description} )} ( + {inputPostfixElement} - + ) }, ) +export const TextField = forwardRef((props, ref) => ( + +)) + +interface NumberFieldProps extends BaseFieldProps { + value?: number + onChangeNumber?: (value: number) => void + defaultValue?: number +} + +export const NumberField = forwardRef< + TextInput, + Omit & + NumberFieldProps +>(({ value, onChangeNumber, defaultValue, ...rest }, ref) => ( + onChangeNumber?.(Math.min(Number(text), Number.MAX_SAFE_INTEGER))} + defaultValue={defaultValue?.toString()} + /> +)) + const styles = StyleSheet.create({ textField: { fontSize: 16, diff --git a/apps/mobile/src/components/ui/grouped/GroupedList.tsx b/apps/mobile/src/components/ui/grouped/GroupedList.tsx index 5f566ce9f..4f3534185 100644 --- a/apps/mobile/src/components/ui/grouped/GroupedList.tsx +++ b/apps/mobile/src/components/ui/grouped/GroupedList.tsx @@ -5,26 +5,47 @@ import { Fragment } from "react" import type { ViewProps } from "react-native" import { Pressable, StyleSheet, Text, View } from "react-native" -import { RightCuteReIcon } from "@/src/icons/right_cute_re" +import { MingcuteRightLine } from "@/src/icons/mingcute_right_line" import { useColor } from "@/src/theme/colors" -export const GroupedInsetListCard: FC = ({ children }) => { +type GroupedInsetListCardProps = { + showSeparator?: boolean +} + +export const GroupedInsetListCard: FC< + PropsWithChildren & ViewProps & GroupedInsetListCardProps +> = ({ children, className, showSeparator = true, ...props }) => { return ( - - {React.Children.map(children, (child, index) => { - const isLast = index === React.Children.count(children) - 1 - return ( - - {child} - {!isLast && ( - - )} - - ) - })} + + {showSeparator + ? React.Children.map(children, (child, index) => { + const isLast = index === React.Children.count(children) - 1 + + if (child === null) return null + const isNavigationLink = + React.isValidElement(child) && + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + (child.type as Function).name === GroupedInsetListNavigationLink.name + + return ( + + {child} + {!isLast && ( + + )} + + ) + }) + : children} ) } @@ -41,9 +62,15 @@ export const GroupedInsetListSectionHeader: FC<{ ) } -export const GroupedInsetListItem: FC = ({ children, ...props }) => { +export const GroupedInsetListBaseCell: FC = ({ + children, + ...props +}) => { return ( - + {children} ) @@ -53,24 +80,141 @@ export const GroupedInsetListNavigationLink: FC<{ label: string icon?: React.ReactNode onPress: () => void -}> = ({ label, icon, onPress }) => { - const tertiaryLabelColor = useColor("tertiaryLabel") + disabled?: boolean +}> = ({ label, icon, onPress, disabled }) => { + const rightIconColor = useColor("tertiaryLabel") return ( - + {({ pressed }) => ( - - + + {icon} - {label} + {label} - - + + - + )} ) } + +export const GroupedInsetListNavigationLinkIcon: FC< + { + backgroundColor: string + } & PropsWithChildren +> = ({ backgroundColor, children }) => { + return ( + + {children} + + ) +} + +export const GroupedInsetListCell: FC<{ + label: string + description?: string + children?: React.ReactNode +}> = ({ label, description, children }) => { + return ( + + + {label} + {!!description && ( + {description} + )} + + + {children} + + ) +} + +export const GroupedInsetListActionCell: FC<{ + label: string + description?: string + onPress: () => void + disabled?: boolean +}> = ({ label, description, onPress, disabled }) => { + const rightIconColor = useColor("tertiaryLabel") + return ( + + {({ pressed }) => ( + + + {label} + {!!description && ( + {description} + )} + + + + + + + )} + + ) +} + +export const GroupedInsetButtonCell: FC<{ + label: string + onPress: () => void + disabled?: boolean + style?: "destructive" | "primary" +}> = ({ label, onPress, disabled, style = "primary" }) => { + return ( + + {({ pressed }) => ( + + + + {label} + + + + )} + + ) +} + +export const GroupedInformationCell: FC<{ + title: string + description?: string + icon?: React.ReactNode + iconBackgroundColor?: string +}> = ({ title, description, icon, iconBackgroundColor }) => { + return ( + + {!!icon && ( + + {icon} + + )} + {title} + {!!description && ( + + {description} + + )} + + ) +} diff --git a/apps/mobile/src/components/ui/icon/fallback-icon.tsx b/apps/mobile/src/components/ui/icon/fallback-icon.tsx index 50f303550..7131e4fdc 100644 --- a/apps/mobile/src/components/ui/icon/fallback-icon.tsx +++ b/apps/mobile/src/components/ui/icon/fallback-icon.tsx @@ -2,8 +2,9 @@ import { getBackgroundGradient, isCJKChar } from "@follow/utils" import { Image } from "expo-image" import { LinearGradient } from "expo-linear-gradient" import { useMemo, useState } from "react" -import type { StyleProp, TextStyle, ViewStyle } from "react-native" +import type { DimensionValue, StyleProp, TextStyle, ViewStyle } from "react-native" import { StyleSheet, Text, View } from "react-native" +import { useColor } from "react-native-uikit-colors" export const FallbackIcon = ({ title, @@ -13,14 +14,16 @@ export const FallbackIcon = ({ style, textClassName, textStyle, + gray, }: { title: string url?: string - size: number + size: DimensionValue className?: string style?: StyleProp textClassName?: string textStyle?: StyleProp + gray?: boolean }) => { const colors = useMemo(() => getBackgroundGradient(title || url || ""), [title, url]) const sizeStyle = useMemo(() => ({ width: size, height: size }), [size]) @@ -28,7 +31,7 @@ export const FallbackIcon = ({ const [, , , bgAccent, bgAccentLight, bgAccentUltraLight] = colors const renderedText = useMemo(() => { - const isCJK = isCJKChar(title[0]) + const isCJK = isCJKChar(title[0]!) return ( {isCJK ? title[0] : title.slice(0, 2)} @@ -36,10 +39,14 @@ export const FallbackIcon = ({ ) }, [title, textStyle, textClassName]) + const grayColor = useColor("gray2") + return ( diff --git a/apps/mobile/src/components/ui/loading/index.tsx b/apps/mobile/src/components/ui/loading/index.tsx index 65f7f7e78..67dea6b23 100644 --- a/apps/mobile/src/components/ui/loading/index.tsx +++ b/apps/mobile/src/components/ui/loading/index.tsx @@ -20,7 +20,7 @@ export const LoadingIndicator: FC< color?: string className?: string } & PropsWithChildren -> = ({ size = 60, color, children, className }) => { +> = ({ size = 36, color, children, className }) => { const rotateValue = useSharedValue(0) const rotation = useDerivedValue(() => { diff --git a/apps/mobile/src/components/ui/pressable/item-pressable.tsx b/apps/mobile/src/components/ui/pressable/item-pressable.tsx index e507c2846..3b8e3c300 100644 --- a/apps/mobile/src/components/ui/pressable/item-pressable.tsx +++ b/apps/mobile/src/components/ui/pressable/item-pressable.tsx @@ -1,8 +1,8 @@ +import { useTypeScriptHappyCallback } from "@follow/hooks" import { cn, composeEventHandlers } from "@follow/utils" -import { memo, useEffect, useState } from "react" +import { Fragment, memo, useEffect, useState } from "react" import type { Pressable } from "react-native" -import { StyleSheet } from "react-native" -import { +import Animated, { Easing, interpolateColor, useAnimatedStyle, @@ -49,13 +49,20 @@ export const ItemPressable: typeof Pressable = memo(({ children, ...props }) => onPressOut={composeEventHandlers(props.onPressOut, () => setIsPressing(false))} onHoverIn={composeEventHandlers(props.onHoverIn, () => setIsPressing(true))} onHoverOut={composeEventHandlers(props.onHoverOut, () => setIsPressing(false))} - className={cn( - // isPressing ? "bg-system-fill" : "bg-secondary-system-grouped-background", - props.className, - )} - style={StyleSheet.flatten([colorStyle, props.style])} + className={cn(props.className, "bg-secondary-system-background relative")} + style={props.style} > - {children} + {useTypeScriptHappyCallback( + (props) => { + return ( + + + {typeof children === "function" ? children(props) : children} + + ) + }, + [children, colorStyle], + )} ) }) diff --git a/apps/mobile/src/components/ui/switch/Switch.tsx b/apps/mobile/src/components/ui/switch/Switch.tsx new file mode 100644 index 000000000..fe22f8373 --- /dev/null +++ b/apps/mobile/src/components/ui/switch/Switch.tsx @@ -0,0 +1,159 @@ +import { forwardRef, useEffect, useImperativeHandle } from "react" +import type { SwitchChangeEvent } from "react-native" +import { Pressable, StyleSheet, View } from "react-native" +import Animated, { + interpolate, + interpolateColor, + useAnimatedStyle, + useSharedValue, + withSpring, + withTiming, +} from "react-native-reanimated" + +import { accentColor, useColor } from "@/src/theme/colors" + +export interface SwitchProps { + onChange?: ((event: SwitchChangeEvent) => Promise | void) | null | undefined + + /** + * Invoked with the new value when the value changes. + */ + onValueChange?: ((value: boolean) => Promise | void) | null | undefined + + /** + * The value of the switch. If true the switch will be turned on. + * Default value is false. + */ + value?: boolean | undefined + + size?: "sm" | "default" +} + +export type SwitchRef = { + value: boolean +} +export const Switch = forwardRef( + ({ value, onValueChange, onChange, size = "default" }, ref) => { + const progress = useSharedValue(value ? 1 : 0) + const scale = useSharedValue(1) + const translateX = useSharedValue(0) + + const onTouchStart = () => { + scale.value = withSpring(1.1) + if (value) { + translateX.value = withSpring(size === "sm" ? -4 : -7) + } + } + + const onTouchEnd = () => { + scale.value = withSpring(1) + translateX.value = withSpring(0) + } + + useImperativeHandle(ref, () => ({ + value: !!value, + })) + + const activeBgColor = accentColor + const inactiveBgColor = useColor("secondarySystemFill") + + const toggleStyle = useAnimatedStyle(() => { + const backgroundColor = interpolateColor( + progress.value, + [0, 1], + [inactiveBgColor, activeBgColor], + ) + + return { + backgroundColor, + } + }) + + const circleStyle = useAnimatedStyle(() => { + const marginLeft = interpolate(progress.value, [0, 1], size === "sm" ? [2, 20] : [2.3, 22]) + + const width = interpolate(scale.value, [1, 1.1], size === "sm" ? [18, 21] : [27.8, 35]) + + return { + marginLeft, + width, + transform: [{ translateX: translateX.value }, { translateY: -0.4 }, { scale: scale.value }], + } + }) + + useEffect(() => { + // Update progress when value changes + if (value && progress.value === 0) { + progress.value = withTiming(1) + } else if (!value && progress.value === 1) { + progress.value = withTiming(0) + } + }, [progress, value]) + + return ( + + { + onValueChange?.(!value) + onChange?.({ target: { value: !value } as any } as SwitchChangeEvent) + }} + > + + + + + + ) + }, +) + +const styles = StyleSheet.create({ + container: { display: "flex", justifyContent: "space-between" }, + toggleContainer: { + width: 52, + height: 32.7, + borderRadius: 4000, + justifyContent: "center", + }, + toggleContainerSm: { + width: 40, + height: 24, + borderRadius: 4000, + justifyContent: "center", + }, + toggleWheelStyle: { + height: 28.5, + backgroundColor: "#ffffff", + borderRadius: 200, + shadowColor: "#515151", + shadowOffset: { + width: 0, + height: 0, + }, + shadowOpacity: 0.2, + shadowRadius: 2.5, + elevation: 1.5, + }, + toggleWheelStyleSm: { + height: 20, + backgroundColor: "#ffffff", + borderRadius: 200, + shadowColor: "#515151", + shadowOffset: { + width: 0, + height: 0, + }, + shadowOpacity: 0.2, + shadowRadius: 2.5, + elevation: 1.5, + }, +}) diff --git a/apps/mobile/src/components/ui/tabview/TabBar.tsx b/apps/mobile/src/components/ui/tabview/TabBar.tsx index 046cdc39c..36e4ddb49 100644 --- a/apps/mobile/src/components/ui/tabview/TabBar.tsx +++ b/apps/mobile/src/components/ui/tabview/TabBar.tsx @@ -20,7 +20,7 @@ import type { import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native" import Animated, { useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated" -import { accentColor } from "@/src/theme/colors" +import { accentColor, useColor } from "@/src/theme/colors" import type { Tab } from "./types" @@ -110,20 +110,39 @@ export const TabBar = forwardRef( useEffect(() => { if (tabWidths.length > 0) { indicatorPosition.value = withSpring(tabPositions[currentTab] || 0, springConfig) + } + }, [currentTab, indicatorPosition, tabPositions, tabWidths.length]) - if (tabRef.current) { - const x = currentTab > 0 ? tabPositions[currentTab - 1] + tabWidths[currentTab - 1] : 0 + const tabBarScrollX = useRef(0) + useEffect(() => { + // If the current tab is not within the visible range of the scrollview, then scroll the scrollview to the visible area. + if (tabRef.current && tabPositions[currentTab] !== undefined && tabWidths[currentTab]) { + const tabPosition = tabPositions[currentTab] + const tabWidth = tabWidths[currentTab] - const isCurrentTabVisible = - sharedPagerOffsetX.value < tabPositions[currentTab] && - sharedPagerOffsetX.value + tabWidths[currentTab] > tabPositions[currentTab] + // Get the current scroll position and visible width of the ScrollView + const scrollView = tabRef.current + const currentScrollX = tabBarScrollX.current - if (!isCurrentTabVisible) { - tabRef.current.scrollTo({ x, y: 0, animated: true }) - } + const visibleWidth = tabBarWidth + + // Check if the tab is outside the visible area + const isTabOutsideView = + tabPosition < currentScrollX || // tab is to the left of visible area + tabPosition + tabWidth > currentScrollX + visibleWidth // tab is to the right + + if (isTabOutsideView) { + // Add some padding to ensure the tab isn't right at the edge + const padding = 16 + + scrollView.scrollTo({ + x: Math.max(0, tabPosition - padding), + animated: true, + }) } } - }, [currentTab, indicatorPosition, sharedPagerOffsetX.value, tabPositions, tabWidths]) + }, [currentTab, sharedPagerOffsetX.value, tabPositions, tabWidths, tabBarWidth]) + const handleTabItemLayout = useCallback((event: LayoutChangeEvent, index: number) => { const { width, x } = event.nativeEvent.layout setTabWidths((prev) => { @@ -146,17 +165,17 @@ export const TabBar = forwardRef( // Interpolate between current and next tab positions const xPosition = - tabPositions[currentIndex] + - (tabPositions[nextIndex] - tabPositions[currentIndex]) * progress + tabPositions[currentIndex]! + + (tabPositions[nextIndex]! - tabPositions[currentIndex]!) * progress // Interpolate between current and next tab widths const width = - tabWidths[currentIndex] + (tabWidths[nextIndex] - tabWidths[currentIndex]) * progress + tabWidths[currentIndex]! + (tabWidths[nextIndex]! - tabWidths[currentIndex]!) * progress return { transform: [{ translateX: Math.max(xPosition, 0) }], width, - backgroundColor: tabs[currentTab].activeColor || accentColor, + backgroundColor: tabs[currentTab]!.activeColor || accentColor, } }) @@ -165,6 +184,9 @@ export const TabBar = forwardRef( onLayout={(event) => { setTabBarWidth(event.nativeEvent.layout.width) }} + onScroll={(event) => { + tabBarScrollX.current = event.nativeEvent.contentOffset.x + }} showsHorizontalScrollIndicator={false} className={cn( "border-tertiary-system-background relative shrink-0 grow-0", @@ -210,9 +232,12 @@ const styles = StyleSheet.create({ }) const TabItemInner = ({ tab, isSelected }: { tab: Tab; isSelected: boolean }) => { + const gray = useColor("gray") return ( - {tab.name} + + {tab.name} + ) } diff --git a/apps/mobile/src/components/ui/toast/manager.tsx b/apps/mobile/src/components/ui/toast/manager.tsx index 8c10e7f61..1f49c4293 100644 --- a/apps/mobile/src/components/ui/toast/manager.tsx +++ b/apps/mobile/src/components/ui/toast/manager.tsx @@ -64,14 +64,14 @@ export class ToastManager { } private scheduleDismiss(index: number) { - const props = this.propsMap[index] + const props = this.propsMap[index]! if (props.duration === Infinity) { return } setTimeout(async () => { - await this.toastRefs[index].dimiss() + await this.toastRefs[index]!.dimiss() this.remove(index) }, props.duration) } diff --git a/apps/mobile/src/components/ui/typography/HtmlWeb.tsx b/apps/mobile/src/components/ui/typography/HtmlWeb.tsx index d152110cb..be5c0bb14 100644 --- a/apps/mobile/src/components/ui/typography/HtmlWeb.tsx +++ b/apps/mobile/src/components/ui/typography/HtmlWeb.tsx @@ -4,11 +4,47 @@ import "@follow/components/assets/tailwind.css" import type { HtmlProps } from "@follow/components" import { Html } from "@follow/components" +import { useEffect } from "react" + +function useSize(callback: (size: [number, number]) => void) { + useEffect(() => { + const lastSize = [document.body.clientWidth, document.body.clientHeight] as [number, number] + + // Observe window size changes + const observer = new ResizeObserver((entries) => { + for (const entry of entries) { + const { width, height } = entry.contentRect + + if ( + width.toFixed(0) !== lastSize[0].toFixed(0) || + height.toFixed(0) !== lastSize[1].toFixed(0) + ) { + lastSize[0] = width + lastSize[1] = height + callback([width, height]) + } + } + }) + + observer.observe(document.body) + + callback([document.body.clientWidth, document.body.clientHeight]) + + return () => { + observer.disconnect() + } + }, [callback]) +} export default function HtmlWeb({ content, dom, + onLayout, ...options -}: { dom?: import("expo/dom").DOMProps } & HtmlProps) { +}: { + dom?: import("expo/dom").DOMProps + onLayout: (size: [number, number]) => void +} & HtmlProps) { + useSize(onLayout) return } diff --git a/apps/mobile/src/components/ui/typography/Markdown.tsx b/apps/mobile/src/components/ui/typography/Markdown.tsx new file mode 100644 index 000000000..2baf6552c --- /dev/null +++ b/apps/mobile/src/components/ui/typography/Markdown.tsx @@ -0,0 +1,41 @@ +import type { FC } from "react" +import { useRef } from "react" +import { Linking } from "react-native" +import type { WebView } from "react-native-webview" + +import MarkdownWeb from "./MarkdownWeb" + +export const Markdown: FC<{ + value: string + style?: React.CSSProperties + className?: string + + webViewProps?: import("expo/dom").DOMProps +}> = ({ value, style, className, webViewProps }) => { + const ref = useRef(null) + + return ( + { + const { type, url } = JSON.parse(event.nativeEvent.data) + if (type === "openLinkInModal") { + Linking.openURL(url) + } + }, + injectedJavaScriptBeforeContentLoaded: `window.openLinkInModal = (url) => { + window.ReactNativeWebView.postMessage(JSON.stringify({ + type: "openLinkInModal", + url, + })) + }`, + }} + /> + ) +} diff --git a/apps/mobile/src/components/ui/typography/MarkdownWeb.tsx b/apps/mobile/src/components/ui/typography/MarkdownWeb.tsx index f6ad599be..03b86c0fa 100644 --- a/apps/mobile/src/components/ui/typography/MarkdownWeb.tsx +++ b/apps/mobile/src/components/ui/typography/MarkdownWeb.tsx @@ -8,19 +8,58 @@ import { useDarkMode } from "usehooks-ts" import { useCSSInjection } from "@/src/theme/web" -const MarkdownWeb: WebComponent<{ value: string; style?: React.CSSProperties }> = ({ - value, - style, -}) => { +declare const window: { + openLinkInModal: (url: string) => void +} +/** + * @internal + */ +const MarkdownWeb: WebComponent<{ + value: string + style?: React.CSSProperties + className?: string +}> = ({ value, style, className }) => { useCSSInjection() const { isDarkMode } = useDarkMode() return (
- {useMemo(() => parseMarkdown(value).content, [value])} +