Compare commits

...

1223 commits
1.5.4 ... main

Author SHA1 Message Date
Thomas Ricouard f40aeb9cac Add followers count widget 2024-05-17 14:22:00 +02:00
Thomas Ricouard 1578896b3e Immersive short modal 2024-05-17 13:56:03 +02:00
Thomas Ricouard ba3d8b1882 Composer: disable predictive type on all platforms 2024-05-17 13:55:55 +02:00
Thomas Ricouard 04af087c4b Bump version to 1.10.41 2024-05-16 07:05:17 +02:00
Thomas Ricouard a9398c25af fix #2064 2024-05-15 10:52:41 +02:00
Thomas Ricouard 13d721912b Add lists widget 2024-05-15 09:27:35 +02:00
Thomas Ricouard e3d4e693d2 More improvement to alt edit 2024-05-15 08:30:57 +02:00
Thomas Ricouard 86c053344b Improve media alt edit 2024-05-15 08:28:05 +02:00
Thomas Ricouard a996aace80 Add translate for image alt 2024-05-14 19:43:52 +02:00
Jesús Jiménez Sánchez 18a1d17230
Update ES localization (#2076) 2024-05-14 19:37:40 +02:00
Thomas Ricouard 69cb9a20f9 Add native translate for media description edit + profile bio 2024-05-14 19:36:25 +02:00
Thomas Ricouard bab2b4be9c Fix localization 2024-05-14 12:20:25 +02:00
Thomas Ricouard bb005386df Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2024-05-13 22:20:45 +02:00
Thomas Ricouard c77bb992b4 Update OpenAI models to gpt-4o 2024-05-13 22:20:43 +02:00
Paul Schuetz 7caf00d07d
Resolve escaped characters in a status (#2071)
* Resolve escaped characters in a status

Escaped characters are now returned to their original form for
HTMLString.asRawText.

* Unescape the markdown version too

The HTMLString.asMarkdown string is now also unescaped, & and
similar are resolved.

* Fix a internal fallback

If one of the unescape(...) commands fails, the original, unescaped
text is used instead of an empty string.
2024-05-13 21:32:38 +02:00
Thomas Ricouard 6ed760a775 Bump version to 1.10.40 2024-05-13 20:20:24 +02:00
Thomas Ricouard ecd149b3d2 Fix a crash in quote post editor on macOS 2024-05-13 19:26:48 +02:00
Xabi 9aaf0b2350
Update EU localisation (#2062)
Round 2
2024-05-13 13:28:24 +02:00
Cthulhux 2d6cce6b01
de: translated one more string (#2063) 2024-05-13 13:27:58 +02:00
Paul Schuetz 48faddebea
Implement Apple Translate (#2065)
* Implement a first version of Apple's Translation

The user can now choose between his instance's server, DeepL (with API
key) and Apple's Translation framework. A translation is cleared if
the translation type is changed. The strings aren't yet written, but
the translations settings view's inconsistent background is now fixed.

* Transfer the old "always_use_deepl" setting

The "always_use_deepl"-setting is now deleted, but its content is
transferred to the equivalent value in "preferred_translation_type".

* Show the user if the DeepL-API key is still stored

The user is now shown a prompt if they've switched away from
.useDeepl, but there's still an API key stored. The API key is not
deleted if the user doesn't instruct the app to do so, so this change
makes it more transparent, since a user might not expect the key to
be stored and might not want this to be the case.

* Localize Labels

The labels for the buttons and options are now localized. "DeepL API Key" is written consistently (with uppercase Key)

* Run all the strings through localization

The strings "DeepL" and "Apple Translate" are now also saved in
localizable.strings and addressed through keys. They were taken
directly previously, which was inconsistent.

* Fix storage

The selected value for preferredTranslationType wasn't stored, the
synchronization between UserPreferences and Storage is now in place.

* Hide Apple Translate if not yet on iOS 17.4

The Apple Translate option is hidden if the user hasn't updated their
phone to at least iOS 17.4. If the Apple Translate option is selected
but the user has downgraded to before iOS 17.4, the standard instance
option is selected.

* Consistently show Apple Translate

Apple Translate was previously only shown if the standard translate
button was visible, that is now fixed. It's now attached to the
StatusRowView, which is always present.

* Animate the removal of translations

The reset of a translation when the translation type is changed is now
animated, which is important for iPad users if they've translated a
post in the sidebar.

* Add support for the Mac Catalyst build

The Mac Catalyst Version doesn't allow the import of the api, so
compiler flags now check if the import isn't allowed and then remove
all references to Apple Translate.

* Swift Format

* Revert "Run all the strings through localization"

This reverts commit 86c5099662.

# Conflicts:
#	Packages/Env/Sources/Env/TranslationType.swift

* Remove the DeepL fallback

The DeepL fallback for the instance translation service is removed,
error messages are shown if a translation fails.

* Allow for the use of an User API Key as fallback

The DeepL fallback is reinstated if the user has put in their own API
Key

* Make the localization keys clear strings

* Make Apple and the instance a fallback

Apple Translate is now a fallback for both other translation types,
the instance service is a fallback for DeepL.
2024-05-13 13:27:21 +02:00
Thomas Ricouard a8039df22d Don't open link on secondary column 2024-05-13 09:27:24 +02:00
Thomas Ricouard e21ec0bd1f Add expanded sidebar layout 2024-05-08 11:51:28 +02:00
Thomas Ricouard 9c42a3d7cc Add copy button for alt text 2024-05-08 11:03:25 +02:00
Thomas Ricouard 54a16b2c9a Fix unboost icon 2024-05-08 11:00:40 +02:00
Thomas Ricouard a6f3068728 Add accounts list placeholder 2024-05-08 10:59:31 +02:00
Thomas Ricouard f04258ec04 Revert "Delete unused functions in TimelineDatasource.swift (#2037)"
This reverts commit e9a2d3e151.
2024-05-08 10:50:22 +02:00
Cthulhux 8468e51c17
de: Update Localizable.xcstrings (#2057)
(Not entirely sure whether to translate "TimelineFilter" et al.)
2024-05-08 10:39:09 +02:00
Noah Martin e9a2d3e151
Delete unused functions in TimelineDatasource.swift (#2037) 2024-05-08 10:38:36 +02:00
Igor Camilo 1f56fa1b9b
Add tooltip to sidebar buttons. (#2040) 2024-05-08 10:38:27 +02:00
Jerry Zhang ccad00a094
Update Simplified Chinese localization (#2052)
* Update Simplified Chinese localization

* Fix

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2024-05-08 10:32:26 +02:00
Thomas Ricouard 51fecb01f5 Bump version to 1.10.39 2024-05-06 09:25:36 +02:00
Thomas Ricouard c29de44d8c Widget: Mentions only allow large size 2024-05-06 09:20:01 +02:00
Thomas Ricouard 1d79832544 Bump version to 1.10.38 2024-05-06 08:41:33 +02:00
Thomas Ricouard a37316c56f Lint 2024-05-06 08:38:37 +02:00
Thomas Ricouard 189e10f2b4 Widget: Add mentions widget 2024-05-06 08:37:58 +02:00
Thomas Ricouard 24d5ecd119 Shortcuts: Fix image 2024-05-05 21:13:34 +02:00
Thomas Ricouard ee6f003073 Widget: Improve text size 2024-05-05 20:03:12 +02:00
Thomas Ricouard 7328c00006 Widget: Remove optional parameters 2024-05-05 19:41:04 +02:00
Thomas Ricouard a6fd8d1137 Widget: Renaming 2024-05-05 19:37:06 +02:00
Thomas Ricouard ea31cda3c2 Widget: Add Hashtag widget 2024-05-05 19:31:28 +02:00
Thomas Ricouard 8ab7b5ac69 Fix app group 2024-05-05 19:03:25 +02:00
Thomas Ricouard 7aebe530dd Widget: More UI refinements 2024-05-05 18:29:48 +02:00
Thomas Ricouard a2afd4f58f Fix widget bundle identifier 2024-05-05 18:16:20 +02:00
Thomas Ricouard 88218cd6ec Style fix 2024-05-05 18:10:32 +02:00
Thomas Ricouard c4dee39efe More fix for timeline widget 2024-05-05 18:06:47 +02:00
Thomas Ricouard 73651cb7f1 Polish on timeline widget 2024-05-05 17:47:08 +02:00
Thomas Ricouard dd1615f0e3 Fix widget entitlements 2024-05-05 17:30:09 +02:00
Thomas Ricouard 6bd14e0f8d Don't embed widgets on visionOS 2024-05-05 13:34:22 +02:00
Thomas Ricouard 1ca4a74ff0 Initial widget support 2024-05-05 13:12:19 +02:00
Thomas Ricouard c3edabb183 Lint 2024-05-04 13:19:19 +02:00
Thomas Ricouard ba4cc899f8 Add inline post Intent 2024-05-04 13:12:43 +02:00
Thomas Ricouard 5a93184c6d Rename Intent 2024-05-04 11:34:51 +02:00
Thomas Ricouard 66754ecc7c Fix editor progress bar 2024-05-04 11:27:52 +02:00
Thomas Ricouard e857439a02 Bump version to 1.10.37 2024-05-03 16:25:30 +02:00
Jesús Jiménez Sánchez ed620e86ca
Update ES localization (#2048)
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2024-05-03 16:21:40 +02:00
Cthulhux 936bc96ff7
de:Update Localizable.xcstrings (#2051)
Time for a few new strings

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2024-05-03 16:19:32 +02:00
Xabi 37b441a43d
Update EU localisation (#2049)
Added recent strings
2024-05-03 16:18:28 +02:00
Thomas Ricouard 07af494dcb Allow text connect 2024-05-02 12:05:48 +02:00
Thomas Ricouard 49a5c6a56a Add more shortcuts 2024-05-02 11:37:38 +02:00
Thomas Ricouard 4e4d903c44 Add AppIntent service + post to Mastodon intent 2024-05-02 09:32:19 +02:00
Thomas Ricouard abcd4cc321 Add muted and blocked accounts list 2024-05-02 08:43:58 +02:00
Euigyom Kim 6a7df1065d
Fix scrolling issue on emoji picker (#2032)
* Fix scrolling issue in emoji picker

* Fix design on emoji section header
2024-04-22 16:38:31 +02:00
Thomas Ricouard c0b855ea55 Bump version to 1.10.36 2024-04-21 15:07:48 +02:00
Thomas Ricouard 4c3047b0b9 Fix packages 2024-04-19 06:56:48 -07:00
Thomas Ricouard 899b92e390 Revert "Fix StatusRowContentView invade SwipeActions area (#2007)"
This reverts commit 3782300b27.
2024-04-19 06:46:56 -07:00
Thomas Ricouard e71c55b488 Bump version to 1.10.35 2024-04-19 06:46:49 -07:00
Thomas Ricouard 361b5f1d84 Fix tests 2024-04-17 11:11:22 -07:00
Thomas Ricouard ad61600328 Fix localizations 2024-04-17 11:05:21 -07:00
Thomas Ricouard 5f1f71068c Update packages 2024-04-17 10:55:00 -07:00
tkgka 3782300b27
Fix StatusRowContentView invade SwipeActions area (#2007)
* Fix StatusRowContentView invade SwipeActions area

* ./ add padding inside StatusRowMediaPreviewView
2024-04-17 10:54:46 -07:00
Andrzej Rózga 7d47834903
Polish localization update (#2029) 2024-04-07 09:16:47 +02:00
Jesús Jiménez Sánchez 65a83fa636
Update ES localization (#2028) 2024-04-07 09:16:41 +02:00
Nathan Reed 8038e8e6af
Improve deep link handling on cold start (#2026)
Previously, if the app was not already running when the Safari action extension was used to open a post in the app, the post would open in the in-app Safari instead of using the Ice Cubes UI.
The action extension only worked well if Ice Cubes was already running but backgrounded when it was used.
This was because of the `hasConnection(with:)` check used to ensure that the current server has a federation relationship with the server the post is on.
Early in app launch, the list of federated peers has not come back from the API request yet, so `hasConnection(with:)` was always returning `false`.

To fix, issue a request to fetch the peers as part of the URL handling process, before checking `hasConnection(with:)` to make the final navigation decision.
As an optimization, only do this if `hasConnection(with:)` returns `false` initially -- if it returns `true`, we already know a connection exists so no need to check again.
2024-04-02 08:26:58 +02:00
Ahnaf Mahmud eb82a67671
Update menu bar and copyright (#2025)
* Update menu bar

* Update copyright
2024-04-02 08:25:52 +02:00
Ege Sucu bc5bb8272a
TR language updated & Changes Reviewed (#2023) 2024-03-29 10:24:44 +01:00
Xabi d2ead5b6d1
Update EU localisation (#2017)
newest strings
2024-03-28 15:32:06 +01:00
Jerry Zhang d22370959c
Update Simplified Chinese localization (#2018)
* Update Simplified Chinese localization

* fix SC localization
2024-03-28 15:31:59 +01:00
Alessio Mason 2c9b841f30
Latest Italian localizations (#2020) 2024-03-28 15:31:39 +01:00
Cthulhux 2e3cf4aace
de: translated the new filters (#2022) 2024-03-28 15:31:31 +01:00
Thomas Ricouard 7de563a6eb Fix packages 2024-03-27 09:17:33 +01:00
Thomas Ricouard 3aae2e6623 bump version to 1.10.34 2024-03-27 09:04:13 +01:00
Thomas Ricouard 5c32c24ae5 Add supports for notifications filter API 2024-03-26 15:49:43 +01:00
Roddy Munro bb56047ee2
Add SwiftPolyglot to validate localizations (#2011)
* Add step to validate translations on PRs without errors

* Move workflow

* Get specific release of SwiftPolyglot
2024-03-25 08:48:44 +01:00
sh95014 924ada6606
Update zh_Hant loc (#2013)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations

* improve translation of "by" in "filtered by"

* update zh-Hant localization

* update Hant localization

* Update zh_Hant

* improve status.poll.closes-in

* Update zh_Hant

* Custom layout for App Store links

* update zh-Hant

* update zh_Hant

* update zh_Hant

* update zh_Hant

* update zh_Hant

* update zh_Hant

* update zh_Hant
2024-03-25 08:47:21 +01:00
Jerry Zhang e6f96d1899
Update Simplified Chinese localization (#2005) 2024-03-14 09:45:11 +01:00
Thomas Ricouard 058500f91e Swiftformat . 2024-03-11 09:05:52 +01:00
Thomas Ricouard fd3d9fc2bc Add missing localization 2024-03-11 09:02:32 +01:00
Thomas Ricouard 9a7e6b7cb0 Various fixes for Xcode 15.3 2024-03-11 08:59:29 +01:00
Max von Webel bc2a09891a
Added a "Moved To" Button to accounts that moved to other instances (#2001)
* added moved information to Account model

* Added "Moved To" button to account details for accounts that have moved
2024-03-11 08:57:35 +01:00
Ahnaf Mahmud 7c343eb4e9
Update visionOS availability (#1999) 2024-03-11 08:56:50 +01:00
Thai D. V 15d7d1dabd
handle edge cases for StatusRowCardView (#1985) 2024-02-26 11:50:10 +01:00
Xabi f4ec69a37f
Update EU localisation (#1986) 2024-02-26 11:49:32 +01:00
Thomas Ricouard 732a253c7a More EN locale fix 2024-02-26 09:17:59 +01:00
Thomas Ricouard 9c67af8451 Fix EN locale 2024-02-26 09:16:16 +01:00
Thomas Ricouard b56da94a7c Add more sheets to shared + link to filters in timeline top filters 2024-02-21 09:45:29 +01:00
Alessio Mason e612fbdf7c
Italian localization fix (#1982)
* General Italian localization overhaul

* Quick IT fix

* Another quick IT fix

* Italian localization fix
2024-02-17 19:26:14 +01:00
Cthulhux f46a0cee17
de: two more missing strings (#1975)
While using the app, I found that I had not seen two strings. Probably they were marked "translated" too early. Sorry! Here they are.
2024-02-16 08:50:41 +01:00
Andrzej Rózga 4a90d979e3
Polish localization update (#1976)
* Polish localization update

* pl: two more missing strings
2024-02-16 08:50:34 +01:00
Jerry Zhang 9e4323f317
Update Simplified Chinese localization (#1974) 2024-02-14 13:34:19 +01:00
Thomas Ricouard 24ce872849 Add previews + refactor placeholder view 2024-02-14 13:34:06 +01:00
Thomas Ricouard 1f858414d8 format . 2024-02-14 12:48:14 +01:00
Thomas Ricouard 2d988d48c1 Remove some button from status row 2024-02-14 10:48:17 +01:00
Thomas Ricouard 21d9fd7b59 Bump version to 1.10.33 2024-02-14 07:37:15 +01:00
Thomas Ricouard cca6472a32 Update to Nuke 12.4.0 2024-02-13 18:51:00 +01:00
Thomas Ricouard c769e80bb6 Add preview for status row 2024-02-13 18:50:51 +01:00
Thomas Ricouard 2986d2b177 Fix env 2024-02-13 17:21:33 +01:00
sh95014 29312d1be2
select a contrasting color for label of "show sensitive content" button (#1965)
* Custom layout for App Store links

* select a contrasting color for label of "show sensitive content" button

fix https://github.com/Dimillian/IceCubesApp/issues/1932

* move contrasting color to Theme and cache computed var
2024-02-13 11:33:59 +01:00
Cthulhux 9ddf0e65fc
Update Localizable.xcstrings (#1969) 2024-02-13 07:50:05 +01:00
Thomas Ricouard bc74a50a6a Fix some English strings 2024-02-12 07:22:28 +01:00
sh95014 d55d6a0371
Use horizontal link preview card for Apple Podcasts as well (#1966)
* Custom layout for App Store links

* generalize the logic to include links known to be associated with square icons

- such as Apple Music and Spotify

* show Apple Podcasts in horizontal link preview
2024-02-12 07:18:18 +01:00
sh95014 773fdc318b
Plurals for various strings (#1968)
fix https://github.com/Dimillian/IceCubesApp/issues/1936
2024-02-12 07:18:08 +01:00
Thomas Ricouard 7423aba92a Fix crash on visionOS in AboutView 2024-02-11 18:59:34 +01:00
Thomas Ricouard 77aa50ef19 Fix #1873 2024-02-11 18:52:58 +01:00
Thomas Ricouard dfc213a19a Remove spacer 2024-02-11 18:45:38 +01:00
Andrzej Rózga 20900f573f
Polish localization update (#1958) 2024-02-11 11:14:44 +01:00
Ege Sucu 046a41e8ef
TR Localizations are Updated & some are formatted (#1957) 2024-02-11 11:14:36 +01:00
Thomas Ricouard fcd56ab7a0 Fix #1960 2024-02-11 11:13:03 +01:00
Thomas Ricouard 923927cddd Cleanup 2024-02-11 11:12:34 +01:00
Thomas Ricouard 219703ecc7 Refactor to NextPageView + handle next page loading failure 2024-02-11 10:58:51 +01:00
Thomas Ricouard 0739264005 Fix background 2024-02-10 12:16:32 +01:00
Thomas Ricouard 6f8bec4737 Add localization 2024-02-10 11:34:49 +01:00
Thomas Ricouard d8e6e6cfb1 Share Sheet: set cursor before shared content 2024-02-10 11:32:58 +01:00
Thomas Ricouard e7bc857231 News trending links experience 2024-02-10 11:26:22 +01:00
Thomas Ricouard 35d249f7c9 Bump to 1.10.32 2024-02-10 09:57:56 +01:00
Thomas Ricouard 7b7e65bf31
Update LICENSE 2024-02-10 08:53:49 +01:00
Thomas Ricouard 9542002534 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2024-02-06 19:19:54 +01:00
Thomas Ricouard 3020d831e4 Various fixes 2024-02-06 19:19:53 +01:00
Thomas Ricouard a0e022b8de Fix #1948 2024-02-06 17:32:42 +01:00
Thomas Ricouard b9b3d0e727 Enhance visionOS support 2024-02-06 15:17:20 +01:00
Jerry Zhang 4bf476daea
Update Simplified Chinese localization (#1947) 2024-02-06 13:30:00 +01:00
Ege Sucu d1fd97794a
Updated TR Localization (#1945) 2024-02-06 13:29:54 +01:00
Thomas Ricouard f14ca6e529 Various visionOS fixes 2024-02-06 09:15:22 +01:00
Thomas Ricouard 75bb4f43dd More fix for #1943 2024-02-05 14:24:29 +01:00
Thomas Ricouard cfd6eed159 Fix #1943 2024-02-05 08:59:27 +01:00
Thomas Ricouard d10adf1fd9 Update packages 2024-02-05 08:56:38 +01:00
Thomas Ricouard 3b07d56b1d Bump version to 1.10.31 2024-02-05 08:56:03 +01:00
Thomas Ricouard b4dbda8722 Migrate EmojiText API 2024-02-05 08:55:24 +01:00
David Walter 827765f251
EmojiText 4.0.0 (#1941) 2024-02-05 08:49:29 +01:00
Chanhwi Joo e7702e1ad0
Update Korean localization (#1942) 2024-02-05 08:49:14 +01:00
Thomas Ricouard 70f58aa08d Fix #1939 2024-02-04 12:02:14 +01:00
Thomas Ricouard cf81054366 Fix isCompact 2024-02-02 18:39:39 +01:00
Thomas Ricouard f67163e4b0 Cleanup print + use OSLog 2024-02-02 18:26:24 +01:00
Thomas Ricouard 9bd967cddf Fix #1938 2024-02-02 08:53:59 +01:00
Thomas Ricouard 551e6b1412
Delete .github/workflows directory 2024-01-31 10:30:04 +01:00
Thomas Ricouard 1c76d50bde
Create ios.yml 2024-01-31 10:27:51 +01:00
Thomas Ricouard 2a6afb4092 Card title limit to two lines instead of one 2024-01-31 07:57:59 +01:00
Thomas Ricouard b348f37f1a Add block confirmation 2024-01-31 07:56:50 +01:00
sh95014 de757c58f8
update zh_Hant (#1934)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations

* improve translation of "by" in "filtered by"

* update zh-Hant localization

* update Hant localization

* Update zh_Hant

* improve status.poll.closes-in

* Update zh_Hant

* Custom layout for App Store links

* update zh-Hant

* update zh_Hant

* update zh_Hant

* update zh_Hant
2024-01-30 09:22:32 +01:00
Thai D. V 7268b5a38e
Improve StatusPollView (#1929)
* fix `StatusPollView`

* fix text alignment
2024-01-30 09:22:20 +01:00
Thomas Ricouard b8cf446406 Bump version to 1.10.30 2024-01-29 08:59:35 +01:00
Thomas Ricouard 6e497fae5b Adjust action buttons size 2024-01-29 08:48:24 +01:00
Thai D. V 586e4f525e
Fix timeline media size (#1928)
* fix layout for post with 1 media item

* fix corner radius

* Fixes

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2024-01-28 17:32:16 +01:00
Thomas Ricouard 7f689bbb9c Bump version to 1.10.29 2024-01-27 10:32:30 +01:00
Thomas Ricouard 9dfd9c27c7 Fix actions button on macOS 2024-01-27 10:31:25 +01:00
Thomas Ricouard 9cf16b2f30 Fix memory leak related to video #1925 2024-01-27 10:20:12 +01:00
Thomas Ricouard 1299202bba Fix #1927 2024-01-27 09:52:27 +01:00
Thomas Ricouard f16f0d514b Fix Swift strict concurrency warnings 2024-01-26 13:01:23 +01:00
Thomas Ricouard 096996c242 Video: Increase compression when in extension 2024-01-24 16:56:35 +01:00
Thomas Ricouard c7bd5a1d94 Cache Account display name 2024-01-24 16:22:44 +01:00
Thomas Ricouard 20f4eb9c71 Remove section 2024-01-24 13:38:46 +01:00
Thomas Ricouard 74590542bc Custom emojis, botom sheet only 2024-01-24 09:25:34 +01:00
Thomas Ricouard 49b1b0e96c Bump version to 1.10.28 2024-01-24 08:11:32 +01:00
Thomas Ricouard 3eec5c0eec new top / bottom bar 2024-01-23 08:51:58 +01:00
Thomas Ricouard 016e4d5d57 Refactor CancelToolbarItem 2024-01-23 08:13:45 +01:00
Thomas Ricouard ba071eb4c8 Fix status menu on Catalyst 2024-01-23 06:55:12 +01:00
Thomas Ricouard d2014d3aec Fix #1918 2024-01-23 06:32:58 +01:00
Thomas Ricouard 621f0d0864 Play video on a separate window on macOS 2024-01-22 22:04:28 +01:00
Thomas Ricouard eeff60bf98 Add quick look for videos 2024-01-22 21:54:28 +01:00
Thomas Ricouard 245d35db82 Fix buttons touch zone 2024-01-22 21:20:43 +01:00
Thai D. V 62eeba5334
use default frame for preview images that API returns incorrect (width: 0, height: 0) (#1915) 2024-01-22 13:58:01 +01:00
Thomas Ricouard 46b8fbde29 New status row context menu 2024-01-22 09:14:45 +01:00
Thomas Ricouard 9a8568d3fa Fix notifications layout 2024-01-22 09:05:22 +01:00
Thomas Ricouard a6ccdc029b Timeline filter: Add ControlGroup 2024-01-22 06:38:56 +01:00
Le-Roy Karunaratne ed9a4a598d
Resolve #359 Optional Missing Alt-Text warning (#1895)
* Resolve #359 Optional Missing Alt-Text warning

Add toggle in settings to require alt text (default off)
If setting is enabled, posting show an error if any attached media is missing alt text

* Re-localized strings
2024-01-22 06:28:03 +01:00
Thai D. V 13af2d7e3f
fix indentation lines (#1914) 2024-01-22 06:27:56 +01:00
Thomas Ricouard 2b446833da Notifications: Full media size + autoplay 2024-01-21 19:46:29 +01:00
Thomas Ricouard 0b96b76641 Bump version to 1.10.27 2024-01-21 19:26:57 +01:00
Thomas Ricouard 78eee1e855 Fix status embed 2024-01-21 18:49:45 +01:00
Thomas Ricouard b7937e3580 Fix language sheet 2024-01-21 18:27:55 +01:00
Thomas Ricouard 9320b2f114 Fix local timeline -> home switch 2024-01-21 17:05:05 +01:00
Thomas Ricouard ad7bc999d3 Fix alternate icon 2024-01-21 12:11:36 +01:00
Thomas Ricouard b41fd2d6ce Bump version to 1.10.26 2024-01-21 12:02:37 +01:00
Thomas Ricouard a79a181d6f Content Filter view: Blurred background 2024-01-21 11:22:07 +01:00
Thomas Ricouard fb944f9c48 Editor: Cleanup focus state 2024-01-21 11:13:47 +01:00
Thomas Ricouard 3c82af0273 Custom emojis: blurred background 2024-01-21 11:13:38 +01:00
Thomas Ricouard 3577254f08 VisionOS: Disable theming 2024-01-21 11:13:25 +01:00
Thomas Ricouard abff6218a4 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2024-01-21 10:49:46 +01:00
Thomas Ricouard 1be9a7b941 Fix custom emojis loading 2024-01-21 10:49:40 +01:00
Cthulhux 18381e22e2
de: tab 1-5 were untranslated (#1908) 2024-01-21 10:45:19 +01:00
Jerry Zhang e2273c436a
Update SC Localization (#1909) 2024-01-21 10:45:12 +01:00
Ege Sucu 2296dd4658
Stale localization string removed (#1910) 2024-01-21 10:45:07 +01:00
Thai D. V 92662665b9
fix divide by zero (#1911) 2024-01-21 10:45:00 +01:00
Thomas Ricouard 17387626b8 New App Icon 2024-01-21 09:31:50 +01:00
Thomas Ricouard e00fd49d89 fix movie supported type 2024-01-20 19:41:44 +01:00
Thomas Ricouard 97798b2c35 Refactor NSItemProvider handler 2024-01-20 19:17:59 +01:00
Thomas Ricouard 90a2a19bb1 Fill poll view 2024-01-20 08:55:12 +01:00
Thomas Ricouard 21d54cc546 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2024-01-20 07:31:46 +01:00
Thomas Ricouard 76638911ee Bump version to 1.10.25 2024-01-20 07:31:39 +01:00
Thai D. V 0b7fed2e9a
Fix Preview Image Size of StatusRowCardView. (#1904)
* fix preview image size and text spacing

* Fix bg

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2024-01-19 17:48:52 +01:00
Ghulam Mustafa 328ee2d090
Fix #1885 blank options on profile page on macos (#1906) 2024-01-19 17:48:20 +01:00
Thomas Ricouard ebdd5b9feb Fix #1905 2024-01-19 12:35:41 +01:00
Thai D. V f79117eff1
fix StatusRowCardView layout (#1901) 2024-01-19 09:01:40 +01:00
Thomas Ricouard 709dd79e25 Fix for visionOS + Remove shimmer 2024-01-19 08:51:29 +01:00
Thai D. V bf7cdc3712
add scroll bar in StatusRowMediaPreviewView for macOS version (#1896) 2024-01-18 06:43:40 +01:00
Alessio Mason f12d0600f7
General Italian localization overhaul (#1897)
* General Italian localization overhaul

* Quick IT fix

* Another quick IT fix
2024-01-18 06:42:03 +01:00
emmanuel b6f11e4e08
Update README.md (#1898) 2024-01-18 06:41:55 +01:00
Thai D. V 76a8f45478
hide context indicator for statuses inside StatusDetailView (#1899) 2024-01-18 06:41:40 +01:00
Thomas Ricouard e03747aa45 Fix hover effect 2024-01-16 20:55:55 +01:00
Thomas Ricouard 8568d6cc59 Bump to 1.10.24 2024-01-16 19:59:35 +01:00
Thomas Ricouard 1a0b52d268 VisionOS Fixes 2024-01-16 19:32:36 +01:00
Thomas Ricouard 0dea624060 VisionOS fixes 2024-01-16 18:43:09 +01:00
Thomas Ricouard a4927fd30c VisionOS fixes 2024-01-15 21:15:40 +01:00
Thomas Ricouard b8be6b79af Bump to 1.10.23 2024-01-15 17:37:33 +01:00
Thomas Ricouard ddaf4f9fde UI Fixes 2024-01-15 15:03:34 +01:00
Thomas Ricouard d9f115ba67 Editor: Fix lag 2024-01-15 15:03:28 +01:00
Jesús Jiménez Sánchez a8f8933e11
Update Spanish translation (#1889) 2024-01-15 10:45:46 +01:00
Yusuke Arakawa 35f6dc8d14
ja: Update Localizable.xcstrings (#1890) 2024-01-15 10:45:32 +01:00
Cthulhux 70eea46aef
de: Update Localizable.xcstrings (#1887) 2024-01-14 10:52:16 +01:00
Thomas Durand 788fab930b
Using AsyncButton from button kit to improve following and related buttons (#1888) 2024-01-14 10:51:54 +01:00
Ahnaf Mahmud 7c8ea23ae9
Correct platform name depending on device (#1883) 2024-01-13 17:51:32 +01:00
Ege Sucu 54dd7521c0
TR Localization Update #1878 (#1880) 2024-01-13 17:50:38 +01:00
Andrzej Rózga 5eccb5c294
Polish localization update (#1882) 2024-01-13 17:50:32 +01:00
Ahnaf Mahmud 254962c5c0
Correct English UK localisation (#1884) 2024-01-13 17:50:26 +01:00
Thomas Ricouard a737c61d15 Add window default size 2024-01-13 15:50:20 +01:00
Thomas Ricouard 27da37e9ec Fix #1859 2024-01-13 08:48:29 +01:00
Thomas Ricouard 6d12f2528d Fix #1873 2024-01-13 08:39:51 +01:00
Eric 231b622f4e
Added toggleable button to show/hide poll results + animations (#1877)
* Added toggleable button to show/hide poll results

* Animations and localizations

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2024-01-13 08:30:25 +01:00
Jerry Zhang 73a02db57f
Update SC Localization (#1876) 2024-01-13 07:12:22 +01:00
Xabi ab69a0683b
Update EU localisation (#1872) 2024-01-12 19:52:27 +01:00
Thomas Ricouard 34d8d8bb46 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2024-01-12 07:04:55 +01:00
Thomas Ricouard 79d062f168 Bump version to 1.10.22 2024-01-12 07:04:49 +01:00
Cthulhux 49e47f3dfd
de: translated timeline content filter (#1864) 2024-01-12 07:04:13 +01:00
Andrzej Rózga c55259efbb
Polish localization update (#1865) 2024-01-12 07:04:04 +01:00
Ico Davids 99c8ea6f99
Updated NL translations (#1866) 2024-01-12 07:03:57 +01:00
sh95014 a11b6ac2a5
update zh_Hant (#1867)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations

* improve translation of "by" in "filtered by"

* update zh-Hant localization

* update Hant localization

* Update zh_Hant

* improve status.poll.closes-in

* Update zh_Hant

* Custom layout for App Store links

* update zh-Hant

* update zh_Hant

* update zh_Hant
2024-01-12 07:03:49 +01:00
Thomas Ricouard 8c68aa711d Content filter detent 2024-01-11 20:02:48 +01:00
Thomas Ricouard 68b7d469f5 Remove some Spacer() 2024-01-11 19:53:21 +01:00
Thomas Ricouard fab23cbafc Cleanup 2024-01-11 18:56:06 +01:00
Thomas Ricouard 2f5307bfc7 Add timeline content filter 2024-01-11 18:55:35 +01:00
Cthulhux 801b6c5682
de: Update Localizable.xcstrings (#1860)
.. new string
2024-01-11 08:13:21 +01:00
Andrzej Rózga 802eae750d
Polish localization update (#1861) 2024-01-11 08:13:13 +01:00
Thomas Ricouard afa31411e1 Bump version to 1.10.21 2024-01-11 08:13:02 +01:00
Thomas Ricouard af2a69fdb1 Fix image sizing 2024-01-10 16:50:18 +01:00
Thomas Ricouard 0da8228e61 Followed Tags + Lists tab. + sidebar customization 2024-01-10 13:26:55 +01:00
Thomas Ricouard 6246d7b0a5 Fill tab only if selected 2024-01-10 08:56:35 +01:00
Thomas Ricouard b6c3b07ad6 Post context menu sound + haptic feedback + correct icons 2024-01-10 08:48:28 +01:00
Chanhwi Joo 71495181c6
Update Korean localization (#1858) 2024-01-10 07:28:43 +01:00
Henrik Nyh d3558b761a
Fix "status.action.delete.confirm.message" capitalisation (#1854)
Skipped be (Belarusian) since I wasn't sure about that one, and AI couldn't make up its mind…
2024-01-10 07:28:37 +01:00
Thomas Ricouard f758b672f1 Fix #1855 2024-01-10 07:28:08 +01:00
Thomas Ricouard 1c1a612d56 Bump version to 1.10.20 2024-01-09 19:11:06 +01:00
Thomas Ricouard 8ea3fa73e5 Fix #1851 (both) 2024-01-09 19:06:54 +01:00
Thomas Ricouard 5c1f113c54 Add a progress indicator when posting a new post 2024-01-09 16:17:34 +01:00
Thomas Ricouard b7e8f63e86 Multi window visionOS support 2024-01-09 13:28:57 +01:00
Thomas Ricouard e7864f7089 Add following search fix #1846 2024-01-09 13:28:51 +01:00
Thomas Ricouard 3a173a8cae Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2024-01-09 10:32:56 +01:00
Thomas Ricouard b2be3778c1 Prevent video sleep in full screen 2024-01-09 10:32:50 +01:00
Cthulhux bda192fdc4
de: Update Localizable.xcstrings (#1839) 2024-01-09 10:32:42 +01:00
Ege Sucu adca09dfcb
TR Localization Updated (#1847) 2024-01-09 10:32:34 +01:00
Jerry Zhang 3e67113c19
Update Simplified Chinese localization (#1850) 2024-01-09 10:32:25 +01:00
Thomas Ricouard a4cdc6fc18 Don't show count when it's 0 2024-01-09 09:16:01 +01:00
Thomas Ricouard c847de8f47 Fix #1849 2024-01-09 09:02:06 +01:00
Thomas Ricouard 7ac9a750cb More fixes 2024-01-09 08:44:51 +01:00
Thomas Ricouard c86d627cee VisionOS fixes 2024-01-09 08:12:22 +01:00
Thomas Ricouard 916c0d9831 Bump version to 1.10.19 2024-01-09 08:12:18 +01:00
Thomas Ricouard 14b25830ff Editor fixes 2024-01-08 21:21:37 +01:00
Thomas Ricouard 556eb15fb4 Button fixes 2024-01-08 21:21:32 +01:00
Thomas Ricouard 8e8713886a Bigger tap area for buttons 2024-01-08 21:21:22 +01:00
Thomas Ricouard e79ead5efe visionOS fix 2024-01-08 21:21:14 +01:00
Thomas Ricouard 5d24c4d2e8 Fix #1836 2024-01-08 18:22:44 +01:00
Thomas Ricouard e725b6be4d Create new lists from timeline home menu even if no lists 2024-01-08 18:22:32 +01:00
Thomas Ricouard 6af0c36740 Fix #1840 2024-01-08 18:22:10 +01:00
Thomas Ricouard 4ebe486816 Fix #1841 2024-01-08 12:43:45 +01:00
Thomas Ricouard 753a0574b1 Fix #1842 2024-01-08 12:38:40 +01:00
Thomas Ricouard 9e1b1780c9 Fix invalid images 2024-01-08 12:19:25 +01:00
Thomas Ricouard 738180665e Fix tests 2024-01-07 19:02:22 +01:00
Clemens Beck 334b09ebe3
Feature: Use tagGroup icon in timeline quick access feature (#1834)
* Use tagGroup icon in timeline quick access feature

* Make tagGroup symbol optional
2024-01-07 18:38:45 +01:00
Ege Sucu 6f42ed8de0
Latest localization changes reviewed (#1837) 2024-01-07 18:38:18 +01:00
Thomas Ricouard c09f9727f1 More video tweaks 2024-01-07 18:33:13 +01:00
Thomas Ricouard cd63c9ddff Mute video by default 2024-01-07 18:14:12 +01:00
Thomas Ricouard c4c86e1434 Fix audio session 2024-01-07 17:52:28 +01:00
Thomas Ricouard 2c7ca2ca81 Add new setting to mute video 2024-01-07 17:33:37 +01:00
Thomas Ricouard 7a7066baa4 More fixes to video 2024-01-07 16:49:49 +01:00
Thomas Ricouard 71d12aec15 No play button in video compact mode 2024-01-07 16:33:20 +01:00
Thomas Ricouard d378341914 Don't autoplay in compact mode 2024-01-07 16:32:36 +01:00
Thomas Ricouard 5ca5dfbd24 better video player 2024-01-07 15:29:59 +01:00
Thomas Ricouard 5ce4d0b41d
Create dependabot.yml 2024-01-07 13:11:23 +01:00
Thomas Ricouard 75987d74aa Fix extensions recent tags 2024-01-07 12:52:45 +01:00
Thomas Ricouard 6aae6f7e40 Fix timeline when resuming from marker 2024-01-07 11:59:15 +01:00
Thomas Ricouard e6c2146217 Bump version to 1.10.18 2024-01-07 11:08:31 +01:00
Thomas Ricouard 6e981a99fc Various fixes 2024-01-07 10:35:11 +01:00
Thomas Ricouard 27ce7fe916 Editor toolbar icons 2024-01-07 09:47:55 +01:00
Thomas Ricouard d952601528 Fix crash on macOS 2024-01-07 09:37:18 +01:00
Thomas Ricouard 34a482f01f More layout rework for the composer 2024-01-07 07:03:39 +01:00
Thomas Ricouard 8e8737b040 Move lang in the editor 2024-01-06 22:26:12 +01:00
Thomas Ricouard a80d36227e Allow video to play sound full screen 2024-01-06 22:08:41 +01:00
Thomas Ricouard ca9dd5b469 Layout adjustments to the editor 2024-01-06 20:02:16 +01:00
Thomas Ricouard 7eb382c052 Status -> StatusKit 2024-01-06 19:27:26 +01:00
Thomas Ricouard d65510493a Namespace StatusEditor 2024-01-06 18:43:26 +01:00
Ege Sucu 9ade571f53
Fixed the "Substitution x was never referenced." (#1831)
* Fixed the "Substitution x was never referenced."

* Fixed other locations not getting proper plurals
2024-01-06 14:52:38 +01:00
Thomas Ricouard c24403094c Naming 2024-01-06 14:49:07 +01:00
Thomas Ricouard 36cc3d5207 ProxyRepresentation -> DataRepresentation 2024-01-06 14:24:52 +01:00
Thomas Ricouard 9329bdf19b Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2024-01-06 14:19:54 +01:00
Ege Sucu 0058ce36b7
Translated the last added string (#1830) 2024-01-06 14:19:38 +01:00
Thomas Ricouard 8a3c540967 Fix typo 2024-01-06 14:19:28 +01:00
Thomas Ricouard e5bb521502 composer tweaks 2024-01-06 12:54:51 +01:00
Thomas Ricouard 6435b40a51 Add followed tags to tag suggestion 2024-01-06 12:32:23 +01:00
Thomas Ricouard 1297331407 Fix more warnings 2024-01-06 11:24:41 +01:00
Thomas Ricouard 8c8c551686 Fix warnings + better recently used tags 2024-01-06 11:21:07 +01:00
Thomas Ricouard bb55154b75 Split/Refactor editor autocomplete 2024-01-06 10:52:04 +01:00
Thomas Ricouard e4f7a6954b Split settings view + add recently used tags list 2024-01-06 10:51:47 +01:00
Thomas Ricouard 73882b0806 Bump version to 1.10.17 2024-01-06 09:55:23 +01:00
Ege Sucu e473981841
Turkish content is improved & added missing ones. (#1827) 2024-01-06 09:31:49 +01:00
Thomas Ricouard 0916a80a2e Fix status layout 2024-01-06 06:57:46 +01:00
Thomas Ricouard a0ff3596cb Revert bottom status padding to 12 2024-01-05 22:48:11 +01:00
Thomas Ricouard f401d4094d Fix tag follow button 2024-01-05 21:28:46 +01:00
Thomas Ricouard ef204cf6fd Bump version to 1.10.16 2024-01-05 21:27:06 +01:00
Thomas Ricouard 91f0df0f26 Status actions: Bigger tap target 2024-01-05 20:33:47 +01:00
Thomas Ricouard a3f29aa15b Add gesture to close the suggested tags 2024-01-05 19:32:17 +01:00
Thomas Ricouard b3af5f1c45 Fix layout issue in the composer 2024-01-05 19:25:27 +01:00
Thomas Ricouard 0501ce9828 Fix poll for current account 2024-01-05 19:10:31 +01:00
Thomas Ricouard bfc1f61e4b Add access to profile from account selector 2024-01-05 18:57:02 +01:00
Pavlo Shadov 8152db745d
Fix the "About" button's label in Accounts Selector view (#1826)
* Fix the key used for About in Accounts Selector view

* Improve the translation for the word "Application" in Ukrainian
2024-01-05 18:17:11 +01:00
Thomas Ricouard 1f6e8e8d18 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2024-01-05 18:04:17 +01:00
Thomas Ricouard d07427b919 Add detent support for composer 2024-01-05 18:04:15 +01:00
Chanhwi Joo f674c2fa46
Update Korean localization (#1824) 2024-01-05 15:47:13 +01:00
Thomas Ricouard fcf00796b8 Show recent tags inline with just the # char 2024-01-05 12:13:52 +01:00
Thomas Ricouard d94e816d63 Dismiss tag on select 2024-01-05 11:35:32 +01:00
Thomas Ricouard f428118fa0 Recently used tags 2024-01-05 10:57:26 +01:00
Pavlo Shadov 3e968525ac
Update Ukrainian localization (#1817)
* Remove empty string

* Update and add missing localizations

* Revert empty string removal

* Mark "parent view for EditTagGroupView" as translated

* Remove the text dedicated only for Preview
2024-01-05 08:51:53 +01:00
sh95014 e6a4bd383c
shift the square.and.pencil icon so that the square is visually centered in the background rectangle (#1819) 2024-01-05 08:50:51 +01:00
sh95014 72b4a92bfe
update zh_Hant (#1820)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations

* improve translation of "by" in "filtered by"

* update zh-Hant localization

* update Hant localization

* Update zh_Hant

* improve status.poll.closes-in

* Update zh_Hant

* Custom layout for App Store links

* update zh-Hant

* update zh_Hant
2024-01-05 08:50:35 +01:00
Jesús Jiménez Sánchez e61a2a32e4
Add missing Spanish translations (#1822) 2024-01-05 08:50:21 +01:00
Thomas Ricouard 6bb6a02912 Add a new custom Post tab for the tabbar 2024-01-05 08:36:06 +01:00
Thomas Ricouard c0a78ef007 Bump version to 1.10.15 2024-01-04 21:47:20 +01:00
Thomas Ricouard 80a22e55fa Fix sidebar bottom egde 2024-01-04 21:28:45 +01:00
Thomas Ricouard c3adb37da0 More fixes for slideover mode 2024-01-04 21:24:22 +01:00
Thomas Ricouard d399c18a82 Bump version to 1.10.14 2024-01-04 17:48:29 +01:00
Thomas Ricouard 3d29c9e600 Fix account swap for favorites and bookmarks 2024-01-04 16:53:10 +01:00
Thomas Ricouard 9ec9c94c9a DM reply now open on a window on macOS 2024-01-04 16:52:58 +01:00
Thomas Ricouard 60ade66251 Sidebar fixes 2024-01-04 16:42:03 +01:00
Thomas Ricouard 469b99f3c9 Sidebar is now backed by TabView + restore slideover tabbar transition 2024-01-04 16:21:15 +01:00
Thomas Ricouard fd190378c6 Timeline: Add spacing between loader and unread count 2024-01-04 15:34:40 +01:00
Thomas Ricouard 6e9bff575d Fix #1821 2024-01-04 14:08:24 +01:00
Thomas Ricouard 3a3cae21b0 Fix #1376 for real 2024-01-04 13:19:36 +01:00
Thomas Ricouard 3229bf0cb5 Timeline: Add indicator when loading new posts 2024-01-04 12:56:46 +01:00
Thomas Ricouard c43d1d0dda Bump version to 1.10.13 2024-01-04 07:48:58 +01:00
Thomas Ricouard e733dc3f2a iPad hotfix: Disable tabbar slideover 2024-01-04 07:47:59 +01:00
Thomas Ricouard 0e9a006483 Optimize images 2024-01-03 20:53:48 +01:00
Xabi 8459224ab1
Update EU localisation (#1813)
New strings, standardisation and fixes
2024-01-03 16:48:25 +01:00
Cthulhux d46d47f97d
de: updated fast refresh disclaimer, fixed english grammar ;-) (#1816) 2024-01-03 16:48:19 +01:00
Jerry Zhang 6babd50d6e
Update Simplified Chinese localization (#1814)
* Update SC Localization

* fix: wrong order in tabs SC translation

Co-Authored-By: nixzhu <zhuhongxu@gmail.com>

---------

Co-authored-by: nixzhu <zhuhongxu@gmail.com>
2024-01-03 16:48:06 +01:00
Thomas Ricouard 72f3af7255 Bump version to 1.10.12 2024-01-03 16:47:46 +01:00
Thomas Ricouard 2eb15b48d4 Don't cache non filterable timeline 2024-01-03 14:59:28 +01:00
Thomas Ricouard ad4995ad70 Catalyst: Fix mention window 2024-01-03 13:40:53 +01:00
Thomas Ricouard 75a61cb534 Fix for status card 2024-01-03 13:22:21 +01:00
Thomas Ricouard 1bdd31e848 Timeline: Fixes 2024-01-03 12:33:06 +01:00
Thomas Ricouard 2e23b08b88 Cache and restore position on all timelines 2024-01-03 11:34:50 +01:00
Thomas Ricouard 6854df4b89 Better fast refresh disclaimer 2024-01-03 10:54:48 +01:00
Thomas Ricouard 73323f8460 Allow quote post preview + link preview fix #1812 2024-01-03 09:23:28 +01:00
Thomas Ricouard f39005c118 Timeline: Tag heeader now tappable 2024-01-03 09:16:24 +01:00
Thomas Ricouard 326d6e5d50 Bump version to 1.10.11 2024-01-03 06:44:27 +01:00
Thomas Ricouard 6cc14f8249 Better UX for avatar / header selection 2024-01-02 21:50:11 +01:00
Thomas Ricouard 1eb33466ca Edit profile: Update avatar & header 2024-01-02 21:16:27 +01:00
Thomas Ricouard f699c33dfb Make status action button areas bigger 2024-01-02 19:35:14 +01:00
Thomas Ricouard f6b7b9807f Fix #1808 2024-01-02 18:55:36 +01:00
Hao Song 245f13d59f
Fix settings done button logic (#1809)
* Fix settings done button logic

With the new customizable tab bar, "Settings" can be rendered directly
as the root view of a tab bar entry instead of as a "modal" presented
from the root view. The "Done" button to dismiss the modal should be
hidden if `isModal` is `false`.

* Hide Settings secondary column button for iPad when presented as a modal
2024-01-02 18:50:50 +01:00
Andrea Draghetti 442a7938ca
Improved the Italian translation (#1810) 2024-01-02 15:16:07 +01:00
sh95014 c4de2d6784
zh-Hant localization (#1804)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations

* improve translation of "by" in "filtered by"

* update zh-Hant localization

* update Hant localization

* Update zh_Hant

* improve status.poll.closes-in

* Update zh_Hant

* Custom layout for App Store links

* update zh-Hant
2024-01-02 15:16:00 +01:00
Thomas Ricouard 632b3f5734 Statuses: Cleanup viewId 2024-01-02 14:06:53 +01:00
Thomas Ricouard 924e1b6057 Bump version to 1.10.10 2024-01-02 13:54:26 +01:00
Thomas Ricouard 983c22886a Rework icons order 2024-01-02 13:29:21 +01:00
Thomas Ricouard f19ab2b130 Increase contrast on the unread counter 2024-01-02 12:14:53 +01:00
Thomas Ricouard 13e87b41e9 Fix list not updating in the quick access pills 2024-01-02 11:54:17 +01:00
Thomas Ricouard c4b85679a2 StatusRow: Light cleanup 2024-01-02 08:58:20 +01:00
Thomas Ricouard 0c13cbd61f Filters: Add current editing keyword on save 2024-01-01 21:29:38 +01:00
Thomas Ricouard aee6459bcf Status detail: Don't cancel the task 2024-01-01 21:29:28 +01:00
Thomas Ricouard f235ebb720 Remove the double # in quick access pills 2024-01-01 21:29:12 +01:00
Thomas Ricouard 47436daaf2 Proper fix for looping timeline 2024-01-01 21:29:03 +01:00
Thomas Ricouard 1e7c25993a Fix timeline filtering + looping 2024-01-01 21:06:10 +01:00
Thomas Ricouard 6f1896caf3 Bump version to 1.10.9 2024-01-01 19:33:28 +01:00
Thomas Ricouard 4fee875fa7 Fix timeline top padding 2024-01-01 19:06:14 +01:00
Thomas Ricouard e41dcd6976 Fix timeline tag group filter 2024-01-01 19:00:23 +01:00
Thomas Ricouard bd51dfc0b6 Fix safe area on media viewer 2024-01-01 18:31:55 +01:00
Thomas Ricouard ce845cd6b3 Better timeline top pin view 2024-01-01 18:23:03 +01:00
Thomas Ricouard f0061b36ca Account: Show nav bar title for main, followers, following 2024-01-01 17:29:15 +01:00
Thomas Ricouard 8ee5da319c Reflect edit / post / delete status better 2024-01-01 16:46:34 +01:00
Thomas Ricouard 8c72b627df Fix scroll to id 2024-01-01 14:16:42 +01:00
Thomas Ricouard b10ee3091c Make edit stickier 2024-01-01 14:13:25 +01:00
Thomas Ricouard b93df71431 Don't resize images if same size 2024-01-01 11:39:32 +01:00
Thomas Ricouard b6317d7324 Add tests for Router 2024-01-01 09:48:53 +01:00
Thomas Ricouard 7222d530dd Fix url router 2024-01-01 09:23:06 +01:00
Thomas Ricouard b4757621f2 Only show the new icon card on iPad / macOS 2023-12-31 13:43:13 +01:00
Thomas Ricouard 9b70519798 Fix sensitive content transition 2023-12-31 13:28:27 +01:00
Thomas Ricouard a85c701f50 Fix #1639 2023-12-31 13:17:09 +01:00
Thomas Ricouard 7add850fe6 Rename timeline related files 2023-12-31 11:18:42 +01:00
Thomas Ricouard acccdb8041 Load new posts per 100 instead of 200 2023-12-31 08:11:53 +01:00
Thomas Ricouard 3a721d3280 Bump version to 1.10.8 2023-12-30 19:09:25 +01:00
Xabi e694dd5529
Update EU localisation (#1801)
The following strings were marked as translated even if they were not:
- tabs customizations
- first tab
- second tab
- fourth tab
- fifth tab

Is there a way to sort strings by date on Xcode?
2023-12-30 16:16:43 +01:00
Thomas Ricouard 0497191acf Add icons for all filters 2023-12-30 16:16:19 +01:00
Thomas Ricouard 781121d1d4 Add more tests 2023-12-30 15:40:04 +01:00
Thomas Ricouard fe66acbd39 Timeline: Add pills quick access 2023-12-30 14:54:09 +01:00
Thomas Ricouard 631707a798 Refactor TimelineView 2023-12-30 12:30:02 +01:00
Thomas Ricouard 6ea4888ae5 Add more timeline tests 2023-12-30 09:51:34 +01:00
Thomas Ricouard b0cc02541e Fix modelTests 2023-12-30 09:16:18 +01:00
Thomas Ricouard 8a2861b37f Add stream tests 2023-12-30 09:08:19 +01:00
Thomas Ricouard 176e4feaf8 Move tabbar label settings 2023-12-30 07:34:47 +01:00
Thomas Ricouard b4013e39c0 Fix DM view 2023-12-29 18:56:50 +01:00
Thomas Ricouard c328c6c0be Refactor App level to App + App View -> Slideover = phone layout on iPad 2023-12-29 18:50:53 +01:00
Thomas Ricouard 84898c3b8e Fix #1798 2023-12-29 18:16:23 +01:00
Thomas Ricouard 2bdef66da0 Actions buttons: Bigger tap area 2023-12-29 17:57:37 +01:00
Thomas Ricouard bb39f07503 Bump to 1.10.7 2023-12-29 17:06:37 +01:00
Thomas Ricouard 6359349a40 VisionOS fix 2023-12-29 17:06:27 +01:00
Thomas Ricouard c9dc24d02a visionOS icon 2023-12-29 16:29:48 +01:00
Thomas Ricouard 59bd8a437a Update macOS icon 2023-12-29 16:14:35 +01:00
Thomas Ricouard 67969f595a Fix About view crash on macOS 2023-12-29 14:21:12 +01:00
Thomas Ricouard 59c0b841c2 Update readme 2023-12-29 13:00:17 +01:00
Thomas Ricouard f39f9e1363 Add more features to the readme 2023-12-29 12:31:34 +01:00
Thomas Ricouard 5209ab80fc New readme images and content 2023-12-29 12:03:46 +01:00
Thomas Ricouard 89c060aeea WIP New readme 2023-12-29 11:52:12 +01:00
Thomas Ricouard 1a366c7bd7 New default icon 2023-12-29 09:40:20 +01:00
Thomas Ricouard d04f6d34ce Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-12-29 08:01:11 +01:00
Thomas Ricouard 4ba8d004d1 Add Threads themes 2023-12-29 08:01:09 +01:00
Thomas Ricouard 83e752ce63 Bump version to 1.10.6 2023-12-29 07:34:30 +01:00
Cthulhux 32119e67c1
de: Update Localizable.xcstrings (#1791)
More string translations.. :-)

Note: you forgot to set "needs_review" for some of them this time.
2023-12-29 07:33:10 +01:00
Xabi 52d726f9b4
Update EU localisation (#1793)
Translated strings that needed review
2023-12-29 07:33:04 +01:00
Thomas Ricouard 19715bb1f6 Fix local / trending tab showing federated timeline 2023-12-29 07:32:33 +01:00
Thomas Ricouard 7b484fc8e1 Add loading indicator on profile 2023-12-28 22:18:13 +01:00
Thomas Ricouard dac9fc55e9 Scale share button 2023-12-28 22:03:24 +01:00
Thomas Ricouard dcd63cfd54 Fix #1789 2023-12-28 21:57:55 +01:00
Thomas Ricouard a1093c8052 Animate favorite / boost count update 2023-12-28 21:57:41 +01:00
Thomas Ricouard 01cd65e6ac Bump version to 1.10.5 2023-12-28 21:49:50 +01:00
Thomas Ricouard f761fa7117 Bump version to 1.10.4 2023-12-28 16:15:30 +01:00
Thomas Ricouard 6850fcd928 Add support / about shortcuts in account selector bottom sheet 2023-12-28 16:03:16 +01:00
Thomas Ricouard b6370aef98 Fix about icons 2023-12-28 15:44:40 +01:00
Thomas Ricouard b83f7e9a55 Fix notifications reload 2023-12-28 13:48:50 +01:00
Thomas Ricouard 00e35be2d5 Fix counter 2023-12-28 13:14:11 +01:00
Thomas Ricouard f3043b608c Better date pre compute 2023-12-28 12:31:16 +01:00
Thomas Ricouard 8f0548f45d Optimize timeline 2023-12-28 12:26:09 +01:00
Thomas Ricouard fa4603e77c Fix notifications locked type 2023-12-28 12:03:01 +01:00
Thomas Ricouard a09b2fa95e monospacedDigit 2023-12-28 11:56:23 +01:00
Thomas Ricouard d0c2cd4520 Better unread counter + animation 2023-12-28 11:54:41 +01:00
Thomas Ricouard 5c2148104c Add Tabs customization on iOS 2023-12-28 11:26:00 +01:00
Thomas Ricouard b0ba6c15da Add favorites / bookmarks tab on macOS / iPadOS 2023-12-28 09:37:02 +01:00
Thomas Ricouard f79580f746 Bump version to 1.10.3 2023-12-28 07:58:38 +01:00
Thomas Ricouard e0563122a7 Layout fix & tweak 2023-12-28 07:55:17 +01:00
Cthulhux aa41f24de9
de: Update Localizable.xcstrings (#1781)
new string..
2023-12-28 07:49:01 +01:00
Jerry Zhang 506a158fa4
Update Simplified Chinese Localization (#1782)
* Update SC Localization

* Fix: refresh timeline SC localization

Co-Authored-By: nixzhu <zhuhongxu@gmail.com>

---------

Co-authored-by: nixzhu <zhuhongxu@gmail.com>
2023-12-28 07:48:55 +01:00
Jerry Zhang 82d0e3e576
Update GB Localization (#1783) 2023-12-28 07:48:49 +01:00
Thomas Ricouard d065ae6aa8 Add settings to toggle between share and bookmark button 2023-12-28 07:48:35 +01:00
Thomas Ricouard 44dbd379ba Further layout tweaks 2023-12-27 19:28:16 +01:00
Thomas Ricouard d300bee96f Bump to version 1.10.2 2023-12-27 18:53:11 +01:00
Thomas Ricouard 21ac4cfa21 Further tweak the layout 2023-12-27 18:16:59 +01:00
Thomas Ricouard bfa717bfa2 Shorter date for status < to 24H 2023-12-27 18:05:41 +01:00
Thomas Ricouard e53a3d0f61 Fix reasons check 2023-12-27 17:12:48 +01:00
Thomas Ricouard 2b16b10987 Tweak status detail layout 2023-12-27 16:48:50 +01:00
Thomas Ricouard 9a5457946b Bump version to 1.10.1 2023-12-27 16:40:29 +01:00
Thomas Ricouard e6b3113090 Add more information for the fast refresh toggle 2023-12-27 16:27:31 +01:00
Thomas Ricouard 8a0cf44834 Visually align new post button 2023-12-27 16:27:21 +01:00
Thomas Ricouard 1a3bded101 New default timeline layout 2023-12-27 16:07:16 +01:00
Thomas Ricouard 2e1652ef53 Fix "Only buttons" settings 2023-12-27 15:16:53 +01:00
Thomas Ricouard 962c7c0295 Timeline: Basic timeline sync using the marker API 2023-12-27 13:26:30 +01:00
Thomas Ricouard 590299d102 Sync with markers API for notifications 2023-12-26 16:01:02 +01:00
Thomas Ricouard 4de4c7c82a Don't remove notifications 2023-12-26 15:12:08 +01:00
Thomas Ricouard ede45a9d46 Fix #1769 2023-12-26 13:56:28 +01:00
Thomas Ricouard f3a48118f0 Fix #1772 2023-12-26 13:51:41 +01:00
Thomas Ricouard c4bff07c40 Bump version to 1.10.0 2023-12-26 13:40:39 +01:00
Thai D. V f326bbefe6
Fix: Search Instances Feature (#1766)
* fix: search logic and performance

* Remove overlay

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-12-26 13:31:22 +01:00
Thomas Ricouard 3ac1bf362b Use alternate icons, remove duplicate assets 2023-12-26 13:24:39 +01:00
Thomas Ricouard 5f05248523 Fix #1768 2023-12-21 21:10:46 +01:00
Thomas Ricouard f04f5c701c Fix #1767 2023-12-21 21:00:44 +01:00
Thomas Ricouard 3eb373550e visionOS: Fixes 2023-12-19 15:07:51 +01:00
Thomas Ricouard 2fdaed7df4 Add direct access to push notifications settings in notifications tab 2023-12-19 09:58:35 +01:00
Thomas Ricouard 5a2478c791
VisionOS native support (#1758)
* Initial support

* UI Adjustments

* WIP icons

* More UI
2023-12-19 09:51:20 +01:00
Thai D. V ca13e61b53
fix: AddAccountView (#1764)
* fix typo

* format number of users and posts

* add thumbnail and re-layout
2023-12-19 07:25:31 +01:00
Jerry Zhang 260dbd351a
Update SC Localization (#1761) 2023-12-19 06:46:47 +01:00
sh95014 d69696b726
separator should extend to leading margin (#1763) 2023-12-19 06:46:39 +01:00
Thomas Ricouard 9fb8d4e484 Bump version to 1.9.19 2023-12-18 09:00:29 +01:00
Thomas Ricouard 8ff3e22d9f SwiftFormat 2023-12-18 08:22:59 +01:00
sh95014 2145bd5971
AppStore Link Preview (#1756)
* Custom layout for App Store links

* generalize the logic to include links known to be associated with square icons

- such as Apple Music and Spotify
2023-12-18 07:01:46 +01:00
David Walter d755396119
Update EmojiText to 3.2.1 (#1753) 2023-12-18 06:43:52 +01:00
Cthulhux 5aa9f22b42
de: translated popover setting (#1755) 2023-12-18 06:43:34 +01:00
Thomas Ricouard 6f6e352baf Mixin portrait and landscape media in the status medias carousel 2023-12-17 10:41:42 +01:00
Thomas Ricouard 1fa54afc3a Add support for GIPHY + rework loading of the media in the editor 2023-12-17 10:27:01 +01:00
Thomas Ricouard 4985e69200 Allow popover settings everywhere 2023-12-17 09:21:09 +01:00
sh95014 f9da958047
add a setting to disable the account popover on hover (#1750)
* add a setting to disable the account popover on hover

- not entirely pleased with the AnyView() cast but don't really know of a less invasive change

* Fixes

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-12-17 07:57:20 +01:00
Thomas Ricouard a7f982e827 Fix posting order for threads 2023-12-17 07:52:16 +01:00
sh95014 8f37465be0
Update zh-Hant localization (#1745)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations

* improve translation of "by" in "filtered by"

* update zh-Hant localization

* update Hant localization

* Update zh_Hant

* improve status.poll.closes-in

* Update zh_Hant
2023-12-17 07:34:08 +01:00
Cthulhux 81f4276596
de: Update Localizable.xcstrings (#1743) 2023-12-17 07:34:01 +01:00
sh95014 038d029022
group slider and text of "max reply indentation" setting (#1749) 2023-12-17 07:33:55 +01:00
Thomas Ricouard 0d37cdf64b Bump version to 1.9.18 2023-12-17 07:28:59 +01:00
David Walter 47326b3f7a
Update EmojiText to 3.2.0 (#1751)
Fixes #1738
2023-12-17 07:28:18 +01:00
Thomas Ricouard 8f31e34e1d Fix colors 2023-12-15 20:13:50 +01:00
Thomas Ricouard 98c732e6fb Bump version to 1.9.17 2023-12-15 20:08:14 +01:00
Jerry Zhang 880277c6f3
Update SC Localization (#1742)
* Update SC Localization

* Update SC Localization on indentation
2023-12-15 05:55:25 +01:00
Thai D. V 1977b1a572
Feature: Post and Reply by Threads (#1740)
* refactor: `StatusEditorView`

* feat: post and reply by threads

* Tidy up

* Fixes

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-12-14 08:06:24 +01:00
Paul Schuetz d8a686be51
Allow the user to customize the thread indentation (#1737)
* Allow the user to customize the thread indentation

The user can now select if they want to indent threads/replies, and how much
the replies should be indented.

* Make the wording clearer

The wording is now clearer since "thread" is replaced by "reply".

* Fix localizations

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-12-14 07:17:09 +01:00
Paul Schuetz e4df8a8b69
Link to parent post (#1736)
The "reply to ..."-text is now a link to the parent post. A tap scrolls to the
parent if the whole hierarchy over a post is shown (detail view). Otherwise,
the detail view for the parent is opened.
2023-12-14 07:12:12 +01:00
Thai D. V 81ba1e9bee
Add Select Status Text Action (#1731)
* add select text action

* Fixes

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-12-14 06:46:16 +01:00
Thomas Ricouard 71f090552a Bump version to 1.9.16 2023-12-13 19:49:15 +01:00
Thomas Ricouard 8d7b6f382e Fixes & optimizations 2023-12-13 12:37:07 +01:00
Thomas Ricouard 232e031559 Add charts for tags 2023-12-13 09:05:30 +01:00
Thomas Ricouard d31af12bb6 Add pull to refresh on post detail 2023-12-10 08:42:26 +01:00
Thomas Ricouard c11a31955c Bump version to 1.9.15 2023-12-09 13:08:07 +01:00
Thai D. V f3ef79b297
Relayout media on status editor (#1728)
* relayout media display

* animate media layout

* fix layout
2023-12-09 10:59:10 +01:00
Thomas Ricouard 52208ab20e Poxy OpenAI calls and remove OpenAI secrets from the app 2023-12-09 10:58:42 +01:00
Thomas Ricouard da6c5ed76c Add follow section in about 2023-12-08 08:04:35 +01:00
Thomas Ricouard 382ebd77e6 Bump version to 1.9.14 2023-12-08 06:58:26 +01:00
Xabi 9aa64f261a
Missing strings (#1725) 2023-12-07 20:15:18 +01:00
Thomas Ricouard 9ab394272f Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-12-07 18:48:19 +01:00
Thomas Ricouard 052afd5931 New media carrousel 2023-12-07 18:48:18 +01:00
Jesús Jiménez Sánchez fdcdf3453f
Missing Spanish translations (#1724) 2023-12-07 13:51:47 +01:00
Chanhwi Joo 6a34b4c9df
Update Korean localization (#1723) 2023-12-07 11:23:08 +01:00
Thomas Ricouard 51656794fc Use env webAuthenticationSession 2023-12-07 09:45:34 +01:00
Thomas Ricouard 5941276145 Update dependencies 2023-12-07 09:29:03 +01:00
Thai D. V 774ba834bd
Improve media selection on the status editor. (#1722)
* show menu buttons on media item

* fix media preparing logic
- not removing photo pickers when removing media on the post editor
- pickers don't have identifiers after being selected
- preparing tasks (creating containers, uploading media) don't run in parallel
- re-preparing the whole media list every time adding new ones

* remove measurement code

* rename variables

* fix MainActor mutation
2023-12-07 06:39:34 +01:00
Andrzej Rózga 9fe5994bb2
Polish localization update (#1719) 2023-12-07 06:10:01 +01:00
Thomas Ricouard f2cd05968e Add a translate button after generating image description 2023-12-06 21:04:47 +01:00
Thomas Ricouard 4f9e23296f Cleanup 2023-12-06 18:56:19 +01:00
Thomas Ricouard 3d2171d716 Refactor auth to ASWebAuthenticationSession 2023-12-06 08:05:26 +01:00
Jerry Zhang a6f6aa3a02
Update Simplified Chinese localization (#1714)
* Update SC Localization

* Adjust SC localization

Co-Authored-By: nixzhu <zhuhongxu@gmail.com>

---------

Co-authored-by: nixzhu <zhuhongxu@gmail.com>
2023-12-06 06:41:41 +01:00
Thai D. V 2e350f5fce
move environment runtime check to compile time (#1709) 2023-12-06 06:41:26 +01:00
Thomas Ricouard df1a44cc21 Use V1 accounts API for autocomplete 2023-12-05 21:03:47 +01:00
Thai D. V 330aa93437
photo view ignores bottom edge of safe area (#1708) 2023-12-05 08:23:42 +01:00
Xabi a86048de33
Update Basque localisation (#1707)
Translated newest strings.
2023-12-05 08:15:38 +01:00
Cthulhux afcd49cb69
de: update Localizable.xcstrings: added "Generate description" (#1706) 2023-12-05 08:15:31 +01:00
Thomas Ricouard 2ff724c268 Bump version to 1.9.13 2023-12-04 20:53:01 +01:00
Thomas Ricouard 4dbe04a5d4 Better image alt prompt 2023-12-04 20:36:15 +01:00
Thomas Ricouard 28ab417b0a Generation image description using GPT Vision 2023-12-04 20:04:12 +01:00
Thomas Ricouard 5c204fd06f New Christmas icons 2023-12-04 20:03:41 +01:00
Thomas Ricouard fcaf48ce53 foregroundColor -> foregroundStyle 2023-12-04 15:49:44 +01:00
Thomas Ricouard 3840b8fb28 presentationMode -> dismiss 2023-12-04 14:14:42 +01:00
Thomas Ricouard 4a09989160 Fix tag condition 2023-12-04 11:49:36 +01:00
Thomas Ricouard 947a684ce3 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-12-04 09:52:20 +01:00
Thomas Ricouard 76219f553b Add tag status indicator for home timeline 2023-12-04 09:52:18 +01:00
Cthulhux 0166a892d8
Update Localizable.xcstrings: added de string (#1705) 2023-12-04 09:04:30 +01:00
Thomas Ricouard bfc2994cfb Fix iCloue container 2023-12-03 14:15:35 +01:00
Thomas Durand 8d54f1a359
Using BUNDLE_ID_PREFIX to fix fork building with iCloud container (#1703) 2023-12-03 13:55:15 +01:00
Thomas Durand ad2adadf87
Added a "Continues a thread" label to status rows (#1704) 2023-12-03 13:54:57 +01:00
Thai D. V 56360ae821
fix: make windowWidth and windowHeight of SceneDelegate observable (#1693) 2023-12-03 12:43:15 +01:00
Cthulhux bf65c386e6
Update Localizable.xcstrings: updated de (#1699) 2023-12-03 08:18:22 +01:00
Thomas Ricouard b249b37612 Add a fast refresh option 2023-12-01 08:51:19 +01:00
Thomas Ricouard f89b3d2761 Bump version to 1.9.12 2023-12-01 08:51:12 +01:00
Thomas Ricouard 719eb34701 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-12-01 08:15:00 +01:00
Thomas Ricouard 885a134eaf Fix list on older instances 2023-12-01 08:14:57 +01:00
Chanhwi Joo 1d04a51fb0
Update Korean localization (#1697) 2023-12-01 08:14:17 +01:00
Thomas Ricouard 32be7d4460 bump version to 1.9.11 2023-11-30 12:26:54 +01:00
Thomas Ricouard 28c8e4d60e Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-11-30 12:02:52 +01:00
Thomas Ricouard 222daae47c Add new icons 2023-11-30 12:02:50 +01:00
Cthulhux efe0bdcdad
German translation: added a few strings, trying to fix #1584 (#1694) 2023-11-29 09:02:24 +01:00
Hugo Saynac 69d5f265fe
Improve indentation level design for indentations level > 1 (#1695) 2023-11-29 09:02:01 +01:00
Jerry Zhang 94670762a4
Update SC Localization (#1696) 2023-11-29 09:01:36 +01:00
Thomas Ricouard 12419a77e2 Fix build for real 2023-11-28 14:41:17 +01:00
Thomas Ricouard 662f1002f5 Fix build 2023-11-28 14:32:35 +01:00
Thomas Ricouard f2606b4614 Search users in list edit 2023-11-28 14:16:04 +01:00
Thomas Ricouard ab07fb5906 Update localizations 2023-11-28 09:35:26 +01:00
Thai D. V 1f703fc1f4
add localization to EditTagGroupView (#1692) 2023-11-28 09:19:48 +01:00
Thomas Ricouard 2e2a9f5f14 Add more lists setttings 2023-11-28 09:18:52 +01:00
Thomas Ricouard d2f7ab1464 Move AccountPopoverView 2023-11-27 09:19:43 +01:00
Nathan Reed 06a8ca67c3
Improve display of HTML ul (bullet list) and ol (numbered list) (#1690)
While SwiftUI's `Text` view won't display these in an `AttributedString` even if they get parsed from Markdown (which would also require the use of the `.full` option instead of the `.inlineOnlyPresrevingWhitespace` option), we can improve the appearance somewhat.
Currently, list elements are clumped together with no spaces between them, and there's no indication whatsoever that the author indicated these to be a list.
Change to insert Markdown list syntax with linebreaks and dashes, so users can at least understand there's a list there.
Similar change for ordered lists.

This will still be broken for nested lists, but it didn't seem worth it to put a lot of effort into this (or other revamps, like making bold/italics/code work properly) because it seems like the current text handling in Ice Cubes is suboptimal and eventually slated for improvement (according to https://github.com/Dimillian/IceCubesApp/issues/1459#issuecomment-1638562657).
So this is more designed to make lists "less broken" in some cases, rather than be a comprehensive fix for all lists in all cases.
2023-11-27 09:15:27 +01:00
Thai D. V de83b8ec90
Fix EditTagGroupView (#1686)
* refactor data of `EditTagGroupView`

* lower case tags before saving because API is case-insensitive

* fix: "add new tag" `TextField` is not focused after adding the first tag (on both macOS and iOS)

* perf: improve symbol search performance

* improve layout and animation of symbol search

* fix: sort tags and remove duplicate tags

* fix: crash when open timeline for an empty tag group

* fix: revert concurrency code because performance issue at 1d3f271 is a false alarm

* add warning labels to help the users

* fix: state `tagGroup`

* fix: selecting symbol logic and warning labels

* refactor `EditTagGroupView.body`

* refactor warning labels

* Fix theme

* Move to its own folder

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-11-27 09:13:07 +01:00
Thai D. V ea5480ef46
add account popovers for display name and handle (#1687) 2023-11-27 09:00:52 +01:00
Simone Margio 98e8ffe4a3
Update Italian translation (#1688) 2023-11-27 08:57:27 +01:00
Jerry Zhang 1af75fbede
Update SC Localization (#1684) 2023-11-24 19:30:00 +01:00
Thomas Ricouard 3a23afed89 Bump version to 1.9.10 2023-11-20 19:27:20 +01:00
Thomas Ricouard b3153289c4 Fix to account selector on iOS 2023-11-20 18:43:16 +01:00
Thomas Ricouard 47d54fd9e6 Fixes 2023-11-20 17:20:09 +01:00
Thai D. V 94172cef27
Feature: popover the account overview when hovering on the avatar (#1682)
* fix avatar scale

* refactor avatar  config data

* add `AvatarView_Previews`

* refactor shape and placeholder of avatar

* refactor `AvatarView` and add `AvatarPopup`

* add `hoverEffect` for iPad

* fix auto-dismiss bug

* fix `showPopup` bug

* disable inappropriate avatar popups
2023-11-20 10:59:49 +01:00
Oleg 534b098ca6
Hide settings link on macos (#1681) 2023-11-20 09:27:58 +01:00
Thomas Ricouard cc03465956 Fix missing localizations 2023-11-20 08:51:44 +01:00
Thomas Ricouard 18f95bdf92 Bump version to 1.9.9 2023-11-19 08:45:43 +01:00
Thomas Ricouard 71ab8d558a Fix / simplify account content warning 2023-11-19 08:26:07 +01:00
Paul Schuetz 12d92ab1ec
Add hint if the server post options are overridden (#1679)
If the content settings specify their own post settings and override the
instance settings, a hint (and link to the content settings) is added to the
instance settings (infos) since that setting might introduce confusion (As
happened in #1677).
2023-11-19 08:10:53 +01:00
Paul Schuetz 8bf36709ea
Fix reply indentation when the post has pictures (#1678)
The size of the image is now set correctly to prevent the shifting of the
vertical bars. The handling of the compact view (regarding the indentation) is
now centrally handled in StatusDetailView.
2023-11-19 08:10:44 +01:00
Euigyom Kim d3b52b3206
Make categorized emoji picker (#1680)
Signed-off-by: Euigyom Kim <egkim@dehol.kr>
2023-11-19 08:09:41 +01:00
Thomas Ricouard 1e35ffb82b Fix settings close button 2023-11-18 11:58:04 +01:00
Thomas Ricouard c1c7c666cb Disable indentation in compact post 2023-11-18 10:44:27 +01:00
sh95014 11388757f3
Limit image height to screen height (#1675)
* limit image height to window height minus a hardcoded value

https://github.com/Dimillian/IceCubesApp/issues/1554

* Limit image to screen height

- limit available height to 80% of screen/window height
- if image fits in available width and height, just display it at 1x (to avoid ugly resizing artifacts)
- otherwise, shrink it proportionally to fit

https://github.com/Dimillian/IceCubesApp/issues/1554
2023-11-17 09:42:33 +01:00
Paul Schuetz 59e5eba860
Improve the display of replies (#1672)
Threads/replies are now shown more clearly. Each reply has an indentation level
(and therefore the number of vertical lines) one more than its direct parent.
This leads to siblings having the same indentation level. It makes
understanding somewhat complex thread structures way easier. Previously, a
reply was only indented if it came directly after its parent. If a toot had
more than one reply, the structure was nearly indecipherable, as it wasn't
clear which the parent post of the second (or later) toot was. An example is
"https://mastodon.social/@mhoye/110452462852364819" and all of its replies.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-11-16 09:56:00 +01:00
Thai D. V 4b74532048
Feature: store selected notification filter (#1627) (#1663)
* store selected notification filter (#1627)

* store one filter for all accounts
2023-11-16 09:53:16 +01:00
Thomas Ricouard 58d6a3b472 Bump version to 1.9.8 2023-11-16 09:51:56 +01:00
Thomas Ricouard f451d7cb8c Bigger media viewer window 2023-11-14 19:48:14 +01:00
Thomas Ricouard bf618d3c5f Update packages 2023-11-14 19:47:51 +01:00
Thomas Ricouard 0c50071ae6 Fix scheme 2023-11-13 08:34:36 +01:00
Madeline d30fcb8c9b
Update project PRODUCT_NAME (#1664)
Add constant value for product_name in target IceCubesApp.

Replaces $(TARGET_NAME), which resulted in an incorrect displayed name
when ran under macOS Catalyst.

Value is now set to constant "Ice Cubes".
2023-11-13 08:22:44 +01:00
sh95014 33145eaafc
Update zh_Hant (#1671)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations

* improve translation of "by" in "filtered by"

* update zh-Hant localization

* update Hant localization

* Update zh_Hant
2023-11-13 08:16:12 +01:00
Thomas Ricouard 32f96ac1ce Format 2023-11-07 11:24:03 +01:00
Théo Arrouye 4266ac4b42
Improve SoundEffectManager & HapticManager (#1662)
* Remove unnecessary vars and switches

* Improve SoundEffectManager call-site API

* Improve HapticManager call-site API
2023-11-07 11:22:36 +01:00
Thai D. V 6e1e83cace
Refactor StatusRowMediaPreviewView (#1654)
* improve the sensitive content overlay animation and refactor subviews

* fix alt text button and refactor views

* refactor `StatusRowMediaPreviewView.onTapGesture`

* simplify `MediaPreview` and `FeaturedImagePreView`

* make alt text button adaptable
2023-11-07 11:20:35 +01:00
Andrzej Rózga 9e4b333981
Polish localization update (#1655)
* Polish localization update

* Merge branch 'main' into pr/1655

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-11-06 11:51:16 +01:00
Chanhwi Joo a7ac559225
Update Korean localization (#1658) 2023-11-06 11:40:11 +01:00
Thomas Ricouard 0424b62684 Fix build 2023-11-01 19:55:48 +01:00
Thomas Ricouard 3e3c69c41c format 2023-11-01 18:58:44 +01:00
Thomas Ricouard 4c7a7986c5 fix build 2023-11-01 18:58:19 +01:00
Hugo Saynac b2933b8c75
Fix flickering issues when resizing window (#1644)
* Fix flickering issues when resizing window, or hiding notifications on macOS

* Restore processor and add debouncing to the processor updates

* Fix indentation

* Add LazyResizableImage to the Design system module
2023-11-01 18:57:13 +01:00
Echo b2550d28ac
Grammar (#1634) 2023-11-01 18:52:00 +01:00
Paul Schuetz f68bc3e306
Show the pending-counter in any corners (#1638)
The pending-button can now be shown in any corner the user prefers. This is
accomplished by allowing the user to move the counter left in addition to the
already present option to move it down. Fixes #1637

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-11-01 18:51:46 +01:00
Thai D. V 20ecc49e31
refactor MediaUIView state and logic (#1651) 2023-11-01 18:50:02 +01:00
Thomas Ricouard cb1f3dc548 Bump version to 1.9.7 2023-10-29 11:57:40 +01:00
Thomas Ricouard db64dd726e Enable CloudKit sync for tag groups, local timeline and drafts 2023-10-29 08:51:20 +01:00
Thomas Ricouard bbce55e703 MediaViewer: Add loading state for quicklook 2023-10-29 08:27:26 +01:00
Cthulhux cd0e9c10ac
de: Update Localizable.xcstrings (#1643) 2023-10-28 13:46:50 +02:00
Andrzej Rózga df3d8e9ea3
Polish localization update (#1645)
* Polish localization update

* Polish localization update
2023-10-28 13:46:42 +02:00
Jerry 8943588645
Update Simplified Chinese localization (#1646) 2023-10-28 13:46:34 +02:00
Xabi 104c308cb2
Update EU Localizable.xcstrings (#1648)
New window
2023-10-28 13:46:24 +02:00
Thomas Ricouard 4fa2f3a10b Bump version to 1.9.6 2023-10-28 13:45:50 +02:00
Thomas Ricouard 8a49409b26 Tag group: fix first tag not being included 2023-10-27 11:39:31 +02:00
Thomas Ricouard e9e1992806 Bump version to 1.9.5 2023-10-27 11:39:19 +02:00
Thomas Ricouard 641853ed8d Editor: Open in window on mac catalyst 2023-10-27 11:39:11 +02:00
Thomas Ricouard 3f3ea4ff68 Editor: Properly close window on Catalyst 2023-10-27 11:39:02 +02:00
Thomas Ricouard 5a52eb50e9 Fix login on Catalyst 2023-10-26 17:47:19 +02:00
Thomas Ricouard 2a936adca0 Add missing localization 2023-10-26 13:57:00 +02:00
Thomas Ricouard cf0f0fd891 Refactor + add more shortcuts on macOS 2023-10-26 06:23:00 +02:00
Thomas Ricouard 494b0df0e3 Embed extensions in Catalyst 2023-10-24 19:19:53 +02:00
Thomas Ricouard 434247f3ea Fixes for macOS 2023-10-24 18:34:45 +02:00
Thomas Ricouard 07bfd8cd0e Initial macOS Catalyst support 2023-10-23 19:12:25 +02:00
Thomas Ricouard b257bfc576 Bump version to 1.9.3 2023-10-19 08:55:10 +02:00
Thomas Ricouard 1b228d504f Media viewer: various fixes 2023-10-18 12:19:39 +02:00
Xabi e9b322e289
Update EU Localizable.xcstrings (#1625)
Added:
- Block %@
- Do you want to block this user?
2023-10-17 09:39:54 +02:00
Thomas Ricouard 32cbb1699e Bump version to 1.9.2 2023-10-17 09:19:41 +02:00
Thomas Ricouard ccae4e0e3d Add button to save photo in the new media viewer 2023-10-17 08:52:05 +02:00
Thomas Ricouard 8ed6d548eb Always autoplay video in the new media viewer 2023-10-17 08:24:11 +02:00
Thomas Ricouard 1743b3bc08 Bump version to 1.9.1 2023-10-17 08:19:14 +02:00
Thomas Ricouard 3cee46d4ef Fix build 2023-10-16 19:40:58 +02:00
Thomas Ricouard ff5ed48a6e Bump version to 1.9.0 2023-10-16 19:11:08 +02:00
Thomas Ricouard fd55020533 New media viewer 2023-10-16 19:08:59 +02:00
Thomas Ricouard 017275ec69 Fix status embed 2023-10-16 09:26:49 +02:00
Thomas Ricouard f08c90f8a0 Fix #1419 2023-10-16 09:16:17 +02:00
Andrzej Rózga 518e69d49d
Polish localization update (#1621) 2023-10-15 08:11:29 +02:00
Jerry f6abd5ddf0
Update Simplified Chinese localization for block user confirmation (#1617) 2023-10-11 08:51:15 +02:00
Cthulhux 855fde2eb4
de: Update Localizable.xcstrings (#1619)
translated the user block stuff
2023-10-11 08:51:07 +02:00
Chanhwi Joo 1bd9d15a8f
Update Korean localization & localize the user block confirmation dialog (#1616)
* Update Korean localization

* Localize the user block confirmation dialog
2023-10-10 18:49:16 +02:00
Thomas Ricouard ee725f15f7 Revert "Enable iCloud sync for SwiftData"
This reverts commit 89c611ed62.
2023-10-10 18:48:17 +02:00
Thomas Ricouard 89c611ed62 Enable iCloud sync for SwiftData 2023-10-10 18:32:11 +02:00
Ico Davids ee2dbf2965
Updated NL translations (#1613) 2023-10-10 08:23:05 +02:00
Jerry 31ae9cb952
Update Simplified Chinese localization (#1612) 2023-10-06 06:29:10 +02:00
Cthulhux 6480014148
de: Update Localizable.xcstrings (#1611) 2023-10-06 06:28:59 +02:00
Thomas Ricouard beec49a7e6 Bump version to 1.8.6 2023-10-05 20:41:19 +02:00
Thomas Ricouard 3fd9013dbd Compiler check 2023-10-05 17:10:24 +02:00
Thomas Ricouard aa7c1b87e4 Migrate to string catalog 2023-10-05 10:28:39 +02:00
Thomas Ricouard 1275b09f20 Add / Remove tag from tag groups from timeline view 2023-10-05 09:47:51 +02:00
Bosco Ho 1bf4d9e398
Feature: Tab bar scroll to top (#1598)
* - *WIP* Explore tab: Tap on tab to scroll to top.

* - Explore tab: Tap tab to scroll to top.

* - Explore: Tap tab again to focus on search bar.
- Explore: Set `.defaultMinListRowHeight` so scroll to view doesn't occupy more than 1pt height in grouped style list.
- Explore: Add padding to get Explore list view to look the same.

* - Explore: Minor adjust to padding.

* - Messages: Add tap tab to scroll to top.

* - Notifications: Add tap tab to scroll to top.

* - Profile: Add tap tab to scroll to top.

* Add `ScrollToView` that can be used across all views.

* Move scroll-to-top constants to ScrollToView.

* Format

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-10-05 08:22:45 +02:00
Eric 4bbfdcd256
Feature request: Block user confirmation dialog (#1606)
- Using State property and Binding between ContextMenu and AccountDetailView to show a confirmation dialog when the block button is pressed.

Co-authored-by: Eric Chaing <eric@Erics-MacBook-Pro.local>
2023-10-04 09:40:54 +02:00
Yasura Dodo e8cb090baf
Fix a crash bug at AccountsListRow (#1602)
When you long tap a `AccountsListRow`, a `contextMenu` will be called, and then the app will be crashed.
This happens because two environments are missing; `QuickLook` and `RouterPath`
2023-10-02 11:58:13 +02:00
Yasura Dodo e3f7eb31e4
Fix a crash bug at Client.makeURL (#1601)
The crash will happen when you type something unexpected instance URL.

Example
```swift
let server = "mstdn.jp/"

var components = URLComponents()
components.scheme = "https"
components.host = server
components.path = "/api/v1/instance"
components.url! // 💥 error: Execution was interrupted, reason: EXC_BREAKPOINT (code=1, subcode=0x18c986650).
```
2023-10-02 09:31:59 +02:00
Thomas Ricouard 23a83d69cc Remove legacy migrations 2023-10-01 09:48:27 +02:00
Thomas Ricouard d5896b95e9 format 2023-10-01 09:37:37 +02:00
Paul Schuetz 0b5e764556
Automatically remove spaces in server names (#1600)
* Automatically remove spaces in server names

If a server name includes a space (which can happen if the string is pasted /
autocompleted), this space is removed, which results in the app not crashing.
Fixes #1599

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Format

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-10-01 09:37:09 +02:00
Benoît Clouet d32c5c004c
Added the ability to display the Pending/Unread button at bottom of the screen for bigger displays or smaller hands (#1595) 2023-10-01 09:24:37 +02:00
Bosco Ho 1f44c502dd
Use NavigationLink with value to push Explore trending links" (#1594)
- Fixes trending links "see more" not getting added to navigation path.
2023-09-27 08:38:17 +02:00
Paul Schuetz 1f28595d39
Remove "Translate with DeepL"-option (#1593)
The "Translate with DeepL"-option is removed to make the app better understandable for the average user. A person who wants to use DeepL can still insert their own API key to always use DeepL.
Fixes #1583

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-09-26 14:11:00 +02:00
Thomas Ricouard 717ef16628 Correctly save / restore any previously selected timeline on home tab 2023-09-25 14:43:29 +02:00
Thomas Ricouard 46d4f3c4f4 Bump version to 1.8.5 2023-09-25 14:37:39 +02:00
Thomas Ricouard e0663bf177 Fix #1590 2023-09-25 14:12:35 +02:00
Thomas Ricouard fd1ec73773 Bump version to 1.8.4 2023-09-25 14:09:04 +02:00
Thomas Ricouard 7efd8ed7cb Fix #1585 2023-09-22 22:41:06 +02:00
Thomas Ricouard cc32845134 Revert "Switch to iOS 17 inspector"
This reverts commit 7589ab75f8.
2023-09-22 22:39:35 +02:00
Thomas Ricouard 4870b202d6 Migrate TagGroup to SwiftData 2023-09-22 19:33:53 +02:00
Thomas Ricouard 527d982dce Migrate LocalTimeline to SwiftData 2023-09-22 12:49:25 +02:00
Thomas Ricouard cb1b5b69df Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-09-22 09:31:37 +02:00
Thomas Ricouard 0c4bde40af Migrate drafts to SwiftData 2023-09-22 09:31:35 +02:00
Jerry 21782c9e02
Update missing Simplified Chinese translation (#1580) 2023-09-22 08:35:44 +02:00
Thomas Ricouard 7eec1b8439 Share sheet: Fix account selector 2023-09-22 08:35:21 +02:00
Thomas Ricouard 60713101a7 Remove some .shared usage 2023-09-22 08:32:13 +02:00
Thomas Ricouard 90fc2907d3 Bump to 1.8.3 2023-09-21 08:56:43 +02:00
Thomas Ricouard 4adbff1342 Fix avatar shape and position settings not being saved 2023-09-20 21:19:45 +02:00
Thomas Ricouard 7589ab75f8 Switch to iOS 17 inspector 2023-09-20 21:19:31 +02:00
Thomas Ricouard 15f498037d Fix thread bar in status detail 2023-09-20 21:19:02 +02:00
Thomas Ricouard 90337bd3ea Bump version to 1.8.2 2023-09-20 08:20:01 +02:00
Thomas Ricouard 46df3bb7f9 Fix #1579 2023-09-20 07:28:04 +02:00
Thomas Ricouard 75a00907ea Bump version to 1.8.1 2023-09-19 18:40:32 +02:00
Thomas Ricouard e2f0863ff6 Fix timeline filter update 2023-09-19 18:33:13 +02:00
Thomas Ricouard 3743e6d870 Fix share sheet 2023-09-19 09:25:48 +02:00
Thomas Ricouard 6c23569d15 UserPreferences -> Observable 2023-09-19 09:18:20 +02:00
Thomas Ricouard fd09276d49 Refactor notifications count 2023-09-19 08:44:11 +02:00
Thomas Ricouard f9c0355f1d Convert Theme to Observable 2023-09-18 21:03:52 +02:00
Thomas Ricouard 625b7f8137 Fix tab icon only on iOS 17 2023-09-18 20:14:26 +02:00
Thomas Ricouard e6455304ac Fix draft label color 2023-09-18 19:07:14 +02:00
Thomas Ricouard 1b0ddf4fd9 Fix #1457 2023-09-18 19:04:54 +02:00
Thomas Ricouard bc554da678 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-09-18 18:55:12 +02:00
Thomas Ricouard 8bb102cd67 Fix #1466 2023-09-18 18:55:11 +02:00
Cthulhux cd253c7dc1
de: added 1 translation (#1573)
I've become sloppy over the past few months... sorry :)) totally missed this!
2023-09-18 18:39:31 +02:00
Thomas Ricouard 27102cbae3 oops 2023-09-18 14:30:36 +02:00
Thomas Ricouard bd3d2008c2 Fix #1483 2023-09-18 14:30:24 +02:00
Thomas Ricouard 1ac25cc417 Fix icon image files 2023-09-18 09:39:20 +02:00
Thomas Ricouard 8b445324e0 Fix #1548 2023-09-18 09:29:42 +02:00
Thomas Ricouard 379d2f36fb Fix #1545 2023-09-18 09:18:48 +02:00
Thomas Ricouard 7388cc4a86 Add two new icons 2023-09-18 09:14:51 +02:00
Thomas Ricouard 4189a59cf6
iOS 17+ only support + migrating to Observation framework (#1571)
* Initial iOS 17 + Observable migration

* More Observation

* More observation

* Checkpoint

* Checkpoint

* Bump version to 1.8.0

* SwiftFormat

* Fix home timeline switch on login

* Fix sidebar routerPath

* Fixes on detail view

* Remove print changes

* Simply detail view

* More opt

* Migrate DisplaySettingsLocalValues

* Better post detail transition

* Status detail animation finally right

* Cleanup
2023-09-18 07:01:23 +02:00
Eslam Nahel 3853eff065
Fix text field bottom padding in EditorView (#1570) 2023-09-17 08:47:15 +02:00
Thomas Ricouard 5b0f10f0a2 Bump version to 1.7.9 2023-09-17 07:32:09 +02:00
Thomas Ricouard 98035e8530 Better status focused screen transition 2023-09-16 15:04:42 +02:00
Thomas Ricouard aaafac8e5a Bump version to 1.7.8 2023-09-16 14:31:26 +02:00
Thomas Ricouard 8a3c971402 Swiftformat 2023-09-16 14:15:03 +02:00
Thomas Ricouard 584a0d0432 Composer: Fix nav bar background 2023-09-16 14:02:50 +02:00
Thomas Ricouard 8e3584ee79 Upgrade to Swift tools version 5.9 + strict Swift concurrency everywhere 2023-09-15 12:46:15 +02:00
Thomas Ricouard 1bbb0dc82d Fix sound effects + upgrade swift concurrency settings 2023-09-14 11:04:14 +02:00
Xabi 53b442eb33
Update EU localisation (#1567)
Added:
- account.action.privacy-settings
2023-09-04 09:07:33 +02:00
Thomas Ricouard 5f4fef859c
Update README.md 2023-08-31 19:35:48 +02:00
Jesús Jiménez Sánchez 1f46691279
Fix incorrect Spanish translation (#1562) 2023-08-31 07:42:07 +02:00
Andrzej Rózga 59f2023497
Polish localization update (#1564) 2023-08-31 07:42:00 +02:00
Jerry 462d2355f4
Update Simplified Chinese localization (#1566)
Simplified Chinese translation for "Privacy Settings"
2023-08-31 07:41:54 +02:00
Thomas Ricouard e921f2cdd4
Fix dark secondary color (#1565) 2023-08-30 09:10:22 +02:00
Thomas Ricouard bdce052dc7 Bump version to 1.7.7 2023-08-30 08:41:31 +02:00
Thomas Ricouard 9cffb7eda2 Add Starfield inspired themes 2023-08-30 08:02:38 +02:00
Thomas Ricouard 113b28db18 Account context menu link to web based privacy settings 2023-08-29 08:58:07 +02:00
Thomas Ricouard 1901777eb0 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-08-24 11:38:12 +02:00
Thomas Ricouard 519ef3d708 Bump version to 1.7.6 2023-08-24 11:38:07 +02:00
Grant McSheffrey 077b0d269d
Bugfix 1459 - Escape ~ character as markdown (#1561)
* Add simple test for escaping markdown content in statuses

* Add ~ as markdown character to be escaped in statuses

The ~ isn't documented in the original markdown syntax docs but is
commonly used (including by AttributedString) to surround text
formatted with a strikethrough.
2023-08-24 09:58:29 +02:00
Grant McSheffrey 30f9da06c8
Support status links with non-ASCII characters (Bugfix 1546) (#1550)
* Allow creation of URL objects from strings containing non-ASCII characters

Adds a new initializer for creating URL objects with a flag to specify that
non-ASCII characters found in the path or query string should first be
URL encoded.

* Add basic test for creating HTMLString objects

* Encode link paths and queries when parsing statuses

It's common to use non-ASCII characters in URLs even though they're technically
invalid characters. Every modern browser handles this by silently encoding
the invalid characters on the user's behalf. However, trying to create a URL
object with un-encoded characters will result in nil so we need to encode the
invalid characters before creating the URL object. The unencoded version
should still be shown in the displayed status.

The parsing of the URL string is a little messy because we can't use the URL
class for this scenario and need to duplicate some of its work.

* Only encode link URLs as a backup

If a URL can be created from a status href, don't try URL encoding
it as this could result in double encoding. Only encode the string
if the creation of a URL fails. This is also more efficient.
2023-08-23 07:08:12 +02:00
sh95014 edf36d4b30
Zh hant localization (#1553)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations

* improve translation of "by" in "filtered by"

* update zh-Hant localization

* update Hant localization
2023-08-23 06:56:50 +02:00
Jesús Jiménez Sánchez 05d8ce1bba
Update missing Spanish strings (#1549)
* Update missing Spanish strings

* Update Spanish plurals

* Small Spanish accessibility string fix

* Fix Date/Time Spanish string
2023-08-23 06:55:14 +02:00
Thomas Ricouard e027972d43 Fix bump 2023-08-11 12:11:30 +02:00
Thomas Durand 56b0010d6c
Poll close in … : Fixing missing space in some locales (#1536) 2023-08-10 08:59:08 +02:00
Chanhwi Joo 5fb9ab1c5e
Fix quote button not showing for unlisted posts (#1537) 2023-08-10 08:58:43 +02:00
Cthulhux 5da1128a4d
de: Update Localizable.strings (#1539) 2023-08-10 08:57:55 +02:00
Thomas Ricouard ad9552472b Bump version to 1.7.5 2023-08-10 08:56:50 +02:00
Thomas Ricouard 04b5804c96 Video Player: Pause video when onDisappear 2023-08-09 13:53:41 +02:00
Thomas Ricouard 27164fa399 Bump version to 1.7.4 2023-08-09 09:17:49 +02:00
Thomas Ricouard 44a83cb180 Fix bump 2023-08-07 06:36:42 +02:00
Thomas Ricouard 799ea7829c Update subscription text because apple 2023-08-07 06:36:05 +02:00
Andrzej Rózga a719f20742
Polish localization update (#1535) 2023-08-05 10:29:47 +02:00
Simone Margio 3b89caa7fe
Italian translation (#1532)
- Replacement of the term "Bottone" in "Pulsante", the first term is mainly connected to clothing, instead the use of "Pulsante" identifies more precisely the concept of using a physical or virtual button.

- Maintaining the Boost term: on Twitter, in Italy, it's usual to use terms such as "tweets, retweets, and others". Therefore, the maintenance of the Boost word has been preferred rather than the total change to "Condividi".

- Reference buttons should eliminate the use of the word "Enable" as the visual switch is the element that confirms to the user whether the action is enabled or not. Further advice is to place the information icon "i" next to the switches, which allows the user to better understand the use of these features.

- Translation of: accessibility, filters, package: status, package: notifications, package: explore, package: conversations, package: account.

- Miscellaneous and minor changes

ATTENTION: using words like "social media love" and then asking "Happy messaging" can lead to misleading messages. They should be removed from all translations.
2023-08-04 19:17:04 +02:00
Jerry 2dc01a09b9
Update Simplified Chinese localization (#1533)
Add translation for "Edit tag group"
2023-08-04 19:16:57 +02:00
Xabi fca92be1f3
Update EU Localizable.strings (#1534)
Added:
timeline.filter.edit-tag-groups
2023-08-04 19:16:49 +02:00
Thomas Ricouard a6bfac0846 Bump version to 1.7.3 2023-08-04 19:08:33 +02:00
Thomas Ricouard 4280764733 Edit tag groups 2023-08-04 12:40:21 +02:00
Chanhwi Joo 559e1d0c83
Add a new 6-striped icon without white borders (#1526) 2023-08-01 09:53:10 +02:00
Chanhwi Joo 1b741d41f5
Add new Korean translations (#1508)
* Add new Korean translations

* Add Korean translation for reply visibility setting

* Replace `댓글` with `답글` for consistency
2023-08-01 09:22:05 +02:00
Simone Margio a3d497f48e
Add minimal icon app (#1525)
* Minimal icon app

Adding icons to the application on a minimal view

* Changes and add to Italian language

Insertion and modifications of some strings in the Italian language

* Revert "Changes and add to Italian language"

This reverts commit ce3c5a6a13.
2023-08-01 09:21:37 +02:00
Thomas Ricouard 0842f23d52 Keep the new keyword field focused 2023-07-22 19:21:29 +02:00
Andrzej Rózga 199f83c386
Polish localization update (#1515) 2023-07-20 14:27:24 +02:00
Alessio Maffeis d7c3a54b56
Update placeholder text (#1516)
* Update placeholder text

* Add newline
2023-07-20 14:27:18 +02:00
Xabi 69c1c7b11e
Update EU localisation - tag groups (#1512)
* Update EU Localizable.strings

Added:
- status.error.posting.title

* Update EU localisation

explore.scope.all, people, hashtags and posts

* Update EU localisation - reply visibility

Added:
- reply visibility

* Update EU localisation - tag groups

- timeline.filter.tag-groups
- timeline.filter.add-tag-groups
- add-tag-groups.edit.title.field
- add-tag-groups.edit.icon.field
- add-tag-groups.edit.tags
- add-tag-groups.edit.tags.add
2023-07-20 08:01:54 +02:00
Cthulhux aacbb6de09
Update Localizable.strings (#1514) 2023-07-20 08:01:45 +02:00
Paul Schuetz b8af362b23
Show all symbols when adding a tag group (#1513)
* Show all symbols when adding a tag group

All the SFSymbols are shown when adding a tag group, the list is taken from
SFSafeSymbols. This includes symbols such as "swift" and "apple.logo", as seen
in https://mastodon.social/@alexito4/110742407894134083.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Add credit for SFSafeSymbols

The list of used libraries is updated with SFSafeSymbols.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-07-20 08:01:32 +02:00
Jerry bff7bd591a
Update Simplified Chinese localization (#1510)
* Update Simplified Chinese localization for Reply Visibility

* Update Simplified Chinese localization for Tag Groups

* Altered Simplified Chinese translation for tab label

显示 Tab 标签 -> 在导航栏中显示文本
2023-07-19 18:20:02 +02:00
Thomas Ricouard c751cb87b8 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-07-19 18:12:23 +02:00
Thomas Ricouard 2fcd5383de Bump version to 1.7.2 2023-07-19 18:12:21 +02:00
Xabi 9f78f0d611
Update EU localisation - reply visibility (#1511)
* Update EU Localizable.strings

Added:
- status.error.posting.title

* Update EU localisation

explore.scope.all, people, hashtags and posts

* Update EU localisation - reply visibility

Added:
- reply visibility
2023-07-19 17:48:15 +02:00
Thomas Ricouard 225821a8da Fix new icon 2023-07-19 14:14:50 +02:00
Thomas Ricouard 287a7dd4d8 Properly enable the new icon 2023-07-19 13:48:34 +02:00
Paul Schuetz 90b0e91c79
Allow specifying the default reply visibility (#1509)
* Allow specifying the visibility of replies

Replies can now have their own default visibility. This visibility is always at
least as restrictive as the default post visibility. When posting a reply, the
visibility is pre-populated with the more restrictive out of the default and
the visibility of the original post.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Use iOS-specific modifier

If the app is run on iOS 17, the new onChange(...)-modifier is used.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Restrict the extension of the onChange-Modifier

The extension of the view to allow the use of the version-appropriate
onChange-modifier is now only available in the relevant file.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Reset to use Xcode 14 / iOS 16

The iOS 17 specific changes are removed to allow building in the older Xcode 14.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Make the default reply visibility public

The standard default reply visibility is now public, the behavior of the app
isn't changed for a user who just updated.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-07-19 11:49:06 +02:00
Thomas Ricouard bb4453c811 Scrollable + interactive Tag Group timeline header 2023-07-19 08:30:47 +02:00
Thomas Ricouard 3407f05003 Bump version to 1.7.1 2023-07-19 08:22:43 +02:00
Thomas Ricouard fbff719066 Fixes to add tag group view 2023-07-19 08:13:16 +02:00
Thomas Ricouard 8ace002e4a Add Tag Group symbol in settings 2023-07-19 07:50:19 +02:00
Thomas Ricouard a2fe0511e0 Run swiftformat 2023-07-19 07:46:25 +02:00
Alejandro Martínez 5951bcec38
Tag groups (#1506)
* Implemented tag groups

* Cleanup

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-07-19 07:44:35 +02:00
Xabi c4c705aa10
Update EU localisation (#1505)
* Update EU Localizable.strings

Added:
- status.error.posting.title

* Update EU localisation

explore.scope.all, people, hashtags and posts
2023-07-19 07:19:01 +02:00
Cthulhux a2b0cc245f
de updated (#1507)
Translated new strings
2023-07-19 07:16:02 +02:00
Thomas Ricouard 4a6f81f22e Fix Introspect warning 2023-07-18 13:58:00 +02:00
Chanhwi Joo 4e1205dca8
Improve Korean translations (#1502)
* Fix the label not properly showing the follower count

* Replace `인스턴스` with `서버`

* Add new translations for search filters and the language detect option
2023-07-18 13:15:59 +02:00
Jerry beb6d1c3c3
Update Simplified Chinese localization (#1504)
* Update Simplified Chinese localization for search scope bar

* Update Simplified Chinese localization for setting to turn of auto language detection

* Update Simplified Chinese localization

Update translation for settings.translation.auto-detect-post-language-footer

Co-Authored-By: nixzhu <zhuhongxu@gmail.com>

---------

Co-authored-by: nixzhu <zhuhongxu@gmail.com>
2023-07-18 13:15:52 +02:00
Thomas Ricouard 39ec8bb389 Add a new icon 2023-07-18 09:45:44 +02:00
Thomas Ricouard 185f4b60e2 Update package + Switch to SwiftUIIntrospect for the Timeline 2023-07-18 09:45:39 +02:00
Thomas Ricouard 47cf849f21 Add scope bar for search in explore screen 2023-07-18 08:52:10 +02:00
Thomas Ricouard 4943a1708c Add quick access button to explore screen 2023-07-18 08:39:52 +02:00
Thomas Ricouard ab834be2f3 Bumping version to 1.7.0 2023-07-18 08:24:02 +02:00
Thomas Ricouard 3525d94f71 Add a mention / reply button on user profile navigation 2023-07-18 08:21:34 +02:00
Thomas Ricouard 58debff490 Fix explore view loading state Fix #1395 2023-07-18 08:04:18 +02:00
Thomas Ricouard 67d1dede04 Don't erase alt text on app switch Fix #1419 2023-07-18 07:20:43 +02:00
Thomas Ricouard 4168c64d20 Add a setting to turn off auto detect language when posting close #1461 2023-07-17 20:39:53 +02:00
Thomas Ricouard 2850c168b0 Fix profile field name font 2023-07-17 19:49:42 +02:00
Thomas Ricouard 94b642f051 Support custom emojis in field name fix #1474 2023-07-17 19:46:46 +02:00
Thomas Ricouard 9e43dc3f6f Fix polls endpoint close #1489 2023-07-17 19:37:54 +02:00
Thomas Ricouard 9ed785db0e Properly JSON encode image ALT fix #1492 2023-07-17 19:35:16 +02:00
Thomas Ricouard c0b34d352b Add overlay / border on media previews 2023-07-17 19:18:19 +02:00
Thomas Ricouard d41eca867b Embed Media card in Button 2023-07-17 19:13:36 +02:00
Yusuke Arakawa ed5b3d7e0f
Update Localizable.strings (#1501)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-07-14 10:58:57 +02:00
Andrzej Rózga 10caea9d1a
Polish localization update (#1482) 2023-07-09 15:36:25 +02:00
Espen Bye cf930faf41
Updated Norwegian localization (#1484)
* Translate strings to Norwegian

* More translations
2023-07-09 15:36:19 +02:00
Xabi 3c75c40c77
Update EU Localizable.strings (#1478)
Added:
- status.error.posting.title
2023-07-06 09:56:10 +02:00
Jerry da54c933f9
Add localization for Error while posting message (#1472)
* Fix Error while posting message not localized

* Update Localizable.strings files

* Update Traditional Chinese localization
2023-07-05 09:03:28 +02:00
Jerry 7a51c03a9b
Update Simplified Chinese localization (#1473)
Add missing translations

"status.editor.photo-library" = "照片图库";
"status.editor.camera-picker" = "拍照";
"status.editor.browse-file" = "选取文件";
2023-07-05 09:03:11 +02:00
Ico Davids 49a481f6e2
Sharing settings strings (#1477) 2023-07-05 09:03:02 +02:00
Thomas Ricouard 4372ccce2c Bump to 1.6.18 2023-07-04 08:44:25 +02:00
Thomas Ricouard a97868cab7 Fixes for bluesky bridge support 2023-07-04 08:37:30 +02:00
Jerry e33dcdf372
Update Simplified Chinese localization (#1453)
* Update Simplified Chinese localization

Translations for Sharing settings

* Update Simplified Chinese localization

Fix translations in Display settings
2023-07-03 07:41:22 +02:00
Nathan Reed 194e3aea74
Add feature to block or mute user directly from post (#1460)
* Make status context menu button frame tap target larger

This makes it much easier to hit on the first try, and doesn't appear to negatively impact the layout.

* Add feature to block or mute user directly from post

To avoid calling the /accounts/relationships endpoint for every single status displayed, the data is only loaded when the menu is activated.
When the API call comes back, the items are added to the menu (updating the view model appears to cause the menu to update, even while it is displayed)
Borrowed blocking & muting logic/menu items from AccountDetailContextMenu.
2023-07-03 07:40:49 +02:00
Andrzej Rózga 8c97c9e1be
Polish localization update (#1447) 2023-06-29 08:54:12 +02:00
Xabi 0fa3fe9e6e
Update EU Localizable.strings (#1448)
Added:
- settings.content.sharing
- settings.content.sharing.share-button-behavior
- settings.content.sharing.share-behavior.link-only
- settings.content.sharing.share-behavior.link-and-text
2023-06-29 08:54:04 +02:00
Jerry 399e807f60
Update Simplified Chinese localization (#1449)
* Update Simplified Chinese localization

* Update Simplified Chinese localization
2023-06-29 08:53:55 +02:00
Xabi 7687a47efa
Update EU plurals (#1451) 2023-06-29 08:53:43 +02:00
Cthulhux 42a07e3bdb
de: Update Localizable.strings (#1443)
translated the Sharing settings
2023-06-27 09:11:15 +02:00
Cthulhux 5cba62dc89
de: Update Localizable.stringsdict (#1444)
For some yet unknown reason, "follower" is "translated" as "Follower" in the standard German UI. So IceCubes will also get that...
2023-06-27 09:11:04 +02:00
Chanhwi Joo 0a47c546d8
Add Korean translations and a missing key for the es locale (#1445)
* Add Korean translations for the share button behavior options

* Add a Korean translation for the new follower label

* Add a missing key for es locale
2023-06-27 09:10:56 +02:00
Thomas Durand 69ab13297f
More compact account list rows (#1442) 2023-06-26 15:54:56 +02:00
Thomas Ricouard 386b34e065 Bump to 1.6.17 2023-06-26 15:54:12 +02:00
nathanwale abcd63a136
Post length is counted differently from server (see #1439) (#1440)
Mastodon server replaces all URLs with a 23 character string, not just those that are longer than 23 characters
2023-06-26 11:46:04 +02:00
sebnoumea 044d3b6b84
FIXES issue#1200 (#1297) 2023-06-26 11:45:45 +02:00
Nathan Reed ffe9e7a714
Add setting to control share button default behavior (#1421)
* Add setting to control share button default behavior

This adds a setting to control the behavior of the share button on the status row actions view.
Currently, it always shares the link to the post as well as the post text.
In iOS 16.4, Apple added iMessage unfurling for Mastodon URLs.
When sharing posts from Ice Cubes via iMessage, this leads to the recipient seeing two copies of the post: one from the unfurled link and one from Ice Cubes including the post text.
Users will now have the option to exclude the post text from their sharing.
This is easier than tapping the 3-dots button on the post (which is kind of small) and then expanding the Share menu in the context menu, which is the other way to access this functionality at the
moment.

The default value for the new option will be "Link and Text", which is the current behavior - so we won't change the behavior on existing users.

* Add new strings to other language localizations
2023-06-26 11:45:14 +02:00
sh95014 eb2222cc11
Update zh_Hant localization (#1427)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations

* improve translation of "by" in "filtered by"

* update zh-Hant localization
2023-06-26 11:44:54 +02:00
Thomas Ricouard a740fe8ca8 Streaming: exponential backoff on reconnect #1438 2023-06-23 07:38:21 +02:00
Thomas Ricouard 831ff08082 Streaming: Send message as UTF8 + token in subprotocols fix #1438 2023-06-23 07:33:10 +02:00
Raphael Monteiro 9e01e6b0f6
Improve Brazilian Portuguese (pt-BR) localization (#1420) 2023-06-05 13:16:16 +02:00
Thomas Ricouard 8eb9daac3e Fix ISO 639 languages 2023-04-25 15:39:17 +02:00
Thomas Ricouard 1870b80f4a Fix AI Prompts 2023-04-18 13:04:05 +02:00
Thomas Ricouard 2bb910aca5 Bump to 1.6.16 2023-04-17 11:09:59 +02:00
sh95014 5659961036
Update zh-Hant localization (#1381)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings

* Update zh-Hant localizations
2023-04-15 12:27:54 +02:00
Peter-Josef Meisch fd074f4ca3
Fix broken localization file (#1380) 2023-04-15 12:27:42 +02:00
Yusuke Arakawa ec854cad9e
Update Localizable.strings (#1368) 2023-04-12 18:58:13 +02:00
Xabi 3f3129afc1
Update EU localisation (#1367)
New:
- accessibility.status.media-viewer-action.label
2023-04-12 18:58:06 +02:00
Thomas Ricouard 9897307c79 Better safeguard around timeline refresh 2023-04-09 15:11:02 +02:00
Thomas Ricouard b48e921699 Bump to 1.6.15 2023-04-09 06:42:54 +02:00
Paul Schuetz 7e5c4ed92a
Show verified URLs in account lists (#1364)
* Show verified URLs in account lists

This allows the user to quickly assess which account of multiple is the official
one, especially when searching for a person with multiple search results.
Fixes #1361

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Replace the verified urls text with a checkmark

This makes it easy for the user to directly see why the urls are listed.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Swiftformat

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-04-08 13:31:43 +02:00
Yusuke Arakawa 67d5c9648f
Update Localizable.strings (#1363) 2023-04-07 18:14:11 +02:00
Valeriy Van 57c42869a7
Fix URL to icon in README.md (#1366) 2023-04-07 18:14:02 +02:00
Vitaly Kovalyshyn 6d6d2c5d08
update ukrainian Localization (#1365)
* update ukrainian Localization

* Fixed incorrect translation
2023-04-07 18:13:54 +02:00
Roberto Pastor 852bc3c1af
Updated spanish translation (#1362)
Co-authored-by: Roberto Pastor <roberto.pastor@cabify.com>
2023-04-06 10:57:00 +02:00
Chanhwi Joo 95469bcc9a
Update Korean localization (#1360) 2023-04-06 10:56:53 +02:00
Andrzej Rózga 57634652df
Polish localization update (#1358) 2023-04-06 10:56:46 +02:00
Ico Davids b9a66552ec
Updated NL localization (#1356)
- 'take photo' in status editor
- translations for untranslated accessibility strings
2023-04-06 10:56:39 +02:00
Cthulhux 4619e73e56
updated de.. (#1357)
* de: updated translation

Fixed 1 typo, translated a couple of remaining strings

* Update Localizable.strings

+1 string
2023-04-06 10:56:30 +02:00
Jerry dc0f72c742
Update Simplified Chinese localization (#1351)
* Update Simplified Chinese localization

Simplified Chinese localization for Accessibility

* Update Simplified Chinese translation

"accessibility.status.media-viewer-action.label" = "打开媒体查看器"
2023-04-06 10:56:23 +02:00
Chris Kolbu 7391c12644
Accessibility fix for Timeline StatusRowView and Status detail (#1355)
* Add StatusRowView accessibility action to open media attachment viewer

Previously, there would be no way to open QuickLook from the timeline.

Now, we add a custom accessibility action to do this.

* Work around initial accessibility focus bug in StatusDetailView

Previously, (due to identity issues?) the focus would be set on the header view. However, moving to the next element in the focus order. would skip over a random number of elements, depending on the context of the detail view.

Now, we manually set the focus once, allowing the focus order to work as intended.

* Respect filters in Timeline combined accessibility label

* Add explicit action to show filtered warnings from `filterView`

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-04-04 08:12:25 +02:00
Ico Davids 4351cec117
Translated accessibility strings for toggles (#1350) 2023-04-04 08:04:07 +02:00
Xabi 0c7adca0cf
Update EU localisation (#1353)
New:
- status.editor.camera-picker
- filter.expired
- filter.expiry-%@
- accessibility.general.toggle.on
- accessibility.general.toggle.off
- accessibility.status.poll.option-prefix-%lld-of-%lld
- accessibility.status.poll.active.label
- accessibility.status.poll.finished.label
- accessibility.status.poll.selected.label
- accessibility.media.supported-type.image.label
- accessibility.media.supported-type.gifv.label
- accessibility.media.supported-type.video.label
- accessibility.media.supported-type.audio.label
- accessibility.status.contains-media.label-%@
- accessibility.status.application.label

Improved:
- account.favorited-by
- account.follow-requests.pending-requests
- account.follow-requests.instructions
- notifications.label.favorite.push

'account.follow-requests.instructions' has been changed to: "*The users above*…" instead of "*Those users*…"
2023-04-04 08:03:58 +02:00
Thomas Ricouard 2601764b28 Poll: Support hidden votesCount close #1354 2023-04-04 08:03:33 +02:00
Thomas Ricouard ab5c6643b3 Fix a crash when deleting an uploading image 2023-04-04 07:51:46 +02:00
Thomas Ricouard 573497ed52 Disable take photo option on macOS 2023-04-04 07:44:29 +02:00
Thomas Ricouard 9ba18a8ca3 Fix camera photo upload 2023-04-03 14:48:32 +02:00
Thomas Ricouard 477dd520b9 Editor: Add Take Photo option close #1339 2023-04-03 13:54:16 +02:00
Thomas Ricouard ab51d57648 Cleanup debounce 2023-04-03 13:53:41 +02:00
Thomas Ricouard 14e91a680e Bump to 1.6.14 2023-04-03 13:53:29 +02:00
Chris Kolbu f728ea652e
Accessibility bug fixes (#1348)
* Fix bug affecting accessibillityRepresentation of type Toggle

Previously, the action on the button would not get executed. This is a SwiftUI bug, as views passed into `accessibilityRepresentation` should not have any behaviour.

Now, we set an equivalent `accessibilityValue` on|off to emulate the same functionality.

* Remove conditional ViewModifier in favour of inlined modifier

Since this view is part of the `StatusRowView` it’s better to err on the side of less branching with ModifiedContent<>

* Avoid combining StatusRowMediaPreviewView accessibility children

By combining the elements, the end result was that the intended action (opening QuickLook) was swallowed in favour of displaying the alt text alert of images.
2023-04-03 11:14:44 +02:00
Chris Kolbu db81486f14
Restore HTMLString link parsing (#1347) 2023-04-01 15:47:12 +02:00
Yusuke Arakawa 00ee8c2373
Update Localizable.strings (#1346) 2023-04-01 15:47:00 +02:00
Yusuke Arakawa 6af794dc72
Update Localizable.strings (#1343) 2023-03-31 15:34:37 +02:00
Paul Schuetz 59b16d86a7
Fix the lag of the display setting sliders (#1342) close #1341
* Fix the lag of the display setting sliders

The sliders in the display settings were laggy because changing the value in the
theme class needs comparatively much time. This writing to the class is now
only done when the user lets go of the slider, so sliding it is responsive. I
was unable to make writing to the class more responsive, the example post needs
therefore a short time before it accepts the new values. Furthermore, all
AppStorage keys are now realized with a ThemeKey to clean the class up.
Fixes #1341

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Remove unnecessary changes to theme

The changing of theme keys is unnecessary for the fix oft the lag, so it's
removed.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Rework fix to be more similar to other lag fixes

The fix now uses the ...LocalValues class, which published updates only every
half a second.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-03-31 15:34:24 +02:00
Thomas Ricouard d3e71cea74 Fix screenshots sharing on iOS 16.4 2023-03-31 14:52:39 +02:00
Thomas Ricouard eb3cbfe6f6 Bump to 1.6.13 2023-03-31 09:08:59 +02:00
Thomas Ricouard d3888d8c40 Accessibility: Disable links parsing for now 2023-03-30 16:29:44 +02:00
Thomas Ricouard dda6ee8f8f Bump to 1.6.12 2023-03-30 08:47:55 +02:00
Andrzej Rózga 501af24cf5
Polish localization update (#1328) 2023-03-30 08:04:28 +02:00
Jerry 1f5960b257
Update Simplified Chinese localization (#1330)
* Line Spacing Chinese localization

* Filter Settings Chinese localization

* Accessibility Chinese localization
2023-03-30 08:04:19 +02:00
Yusuke Arakawa 6c304df78f
Update Localizable.strings (#1333) 2023-03-30 08:04:12 +02:00
Chanhwi Joo c390a2ee10
Update Korean localization (#1335)
* Remove unnecessary comments

* Translate VoiceOver strings

* Read poll options better
2023-03-30 08:04:04 +02:00
J-rg 92a30b7575
Update German localization (#1288) 2023-03-29 09:48:48 +02:00
Jair Henrique 14d86d9b98
Improve pt_BR translations (#1325) 2023-03-28 18:49:39 +02:00
Ico Davids e1e32fdb97
Updated NL localization (#1326)
* Line Spacing

* Post Edit Summary

* Various filter and accessibility strings

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 18:49:31 +02:00
Chris Kolbu 9e347c75b9
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView

Previously, this view did not provide the proper context to indicate that it represented a poll.

Now, we’ve added
- A container that will stay “Active poll” or “Poll results” when the cursor first hits one of the options;
- A prefix to say “Option X of Y” before each option;
- A Selected trait on the selected option(s), if present
- Consolidating and adding an `.updatesFrequently` trait to the footer view with the countdown.

* Add poll description in StatusRowView combinedAccessibilityLabel

This largely duplicates the logic in `StatusPollView`.

* Improve accessibility of media attachments

Previously, the media attachments without alt text would not show up in the consolidated `StatusRowView`, nor would they be meaningfully explained on the status detail screen.

Now, they are presented with their attachment type.

* Change accessibilityRepresentation of AppAcountsSelectorView

* Change Notifications tab title view accessibility representation to Menu

Previously it would present as a button

* Hide layout `Rectangle`s from accessibility

* Consolidate `StatusRowDetailView` accessibility representation

* Improve readability of Poll accessibility label

* Ensure poll options don’t present as interactive when the poll is finished

* Improve accessibility of StatusRowCardView

Previously, it would present as four separate elements, including an image without a description, all interactive, none with an interactive trait.

Now, it presents as a single element with the `.link` trait

* Improve accessibility of StatusRowHeaderView

Previously, it had no traits and no actions except inherited ones.

Now it presents as a button, triggering its primary action.

It also has custom actions corresponding to its context menu

* Avoid applying the StatusRowView custom actions to every view when contained

* Provide context for the application name

* Add pauses to StatusRowView combinedAccessibilityLabel

* Hide `TimelineView.scrollToTopView` from accessibility

* Set appropriate font style on Notification header

After the change the Text needed a `.headline` style to match the prior appearance.

* Fix bug in accessibilityRepresentation of TimelineView nav bar title

Previously, it would not display the proper label for .remoteLocal filter options.

* Ensure that pop-up button nav bar titles are interactive

* Ensure TextView responds to Environment.sizeCategory

This resolves #1309

* Fix button

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 18:48:58 +02:00
sh95014 59af600945
zh-Hant localization updates (#1324)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes

* Update Localizable.strings

* Update Localizable.strings
2023-03-28 09:00:02 +02:00
Andrzej Rózga d759bf9ece
Polish localization update (#1322) 2023-03-28 08:59:49 +02:00
Jair Henrique 409437841d
Improve pt_BR translations (#1320) 2023-03-28 08:59:41 +02:00
Chanhwi Joo 9d23e05d49
Add 2 missing localization strings (#1319)
* Add 2 missing localization strings

* Add a Korean translation for the line spacing setting
2023-03-28 08:59:31 +02:00
Xabi c498ab9b2d
Update EU localisation (#1315)
Added:
- settings.display.font.line-spacing-%@
- status.summary.edit-history

Improved:
- settings.display.navigation-title
- settings.general.display
- settings.general.translate
- settings.translation.navigation-title
2023-03-28 08:59:22 +02:00
Yusuke Arakawa 942dfa1de7
Update Localizable.strings (#1317) 2023-03-28 08:59:13 +02:00
Cthulhux 9e0c77a48f
Update Localizable.strings (#1314) 2023-03-28 08:59:03 +02:00
Thomas Ricouard efb255eb62 Display settings: keep example post on the top 2023-03-26 19:19:59 +02:00
Thomas Ricouard 92e15fdcc9 Settings: Add line spacing option which apply to only posts content for now 2023-03-26 18:51:15 +02:00
Thomas Ricouard 69e5ba251c Bump to 1.6.11 2023-03-26 18:33:08 +02:00
Jerry d35de0013c
Update Simplified Chinese localization (#1307) 2023-03-26 14:19:42 +02:00
Paul Schuetz 731ee4c3ac
Fix icon switching on iPad (#1310)
The switching of icons didn't work on the iPad anymore (See
https://norden.social/@betamax65/110088664994961476). This might be a temporary
fix, depending on what caused the bug (which I couldn't determine). For now,
one icon in the set seemingly must have a complete iPad icon set, which is
achieved with the standard icon. Furthermore, an assert statement helps to
determine the problem with the icons. This statement won't be compiled into
release builds.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-03-26 14:19:34 +02:00
Andrzej Rózga a0fa559d60
Polish localization update (#1305) 2023-03-26 10:17:49 +02:00
Cthulhux 69e3f798bb
Update Localizable.strings (#1306) 2023-03-26 10:17:43 +02:00
Cthulhux 2d5f096887
Update Localizable.strings (#1298) 2023-03-25 17:16:44 +01:00
Xabi 6ecc56f39a
Update Basque localisation (#1300) 2023-03-25 17:16:36 +01:00
Chanhwi Joo 50ce63e800
Update Korean localization (#1301) 2023-03-25 17:16:29 +01:00
Chanhwi Joo 3d63ea4642
Make "Edit History" navigation title localizable (#1302) 2023-03-25 17:16:22 +01:00
Yusuke Arakawa 3c26b7fceb
Update Localizable.strings (#1303) 2023-03-25 17:16:13 +01:00
Paul Schuetz 0874be89f8
Add an edit button to the remote timeline settings (#1304) 2023-03-25 17:16:07 +01:00
Thomas Ricouard 356b58bf67 Use the new iOS 16.4 sheet background for app selection sheet (You'll need to use Xcode 14.3 going forward) 2023-03-24 13:53:42 +01:00
Thomas Ricouard 65431dc727 Bump to 1.6.10 2023-03-24 13:53:06 +01:00
Chris Kolbu b2f594f174
Accessibility tweaks + Notifications and Messages tab uplift (#1292)
* Improve StatusRowView accessibility actions

Previously, there was no way to interact with links and hashtags.

Now, these are added to the Actions rotor

* Hide `topPaddingView`s from accessibility

* Fix accessible header rendering in non-filterable TimelineViews

Previously, all navigation title views were assumed to be popup buttons.

Now, we only change the representation for timelines that are filterable.

* Combine tagHeaderView text elements

Previously, these were two separate items

* Prefer shorter Quote action label

* Improve accessibility of StatusEmbeddedView

Previously, this element would be three different ones, and include all the actions on the `StatusRowView` proper. Now, it presents as one element with no actions.

* Add haptics to StatusRowView accessibility actions

* Improve accessibility of ConversationsListRow

This commit adds:
- A combined representation of the component views
- “Unread” as the first part of the label (if this is the case)
- All relevant actions as custom actions
- Reply as magic tap

* Remove StatusRowView accessibilityActions if viewModel.showActions is false

* Hide media attachments from accessibility if the view is not focused

* Combine NotificationRowView accessibility elements; add user actions

Previously, there was no real way to interact with these notifications.

Now, the notifications that show the actions row have the appropriate StatusRowView-derived actions, and new followers notifications have more actions that let you see each user’s profile.

* Prefer @Environment’s `accessibilityEnabled` over `isVoiceOverRunning`

This way we can cater for Voice Control, Full Keyboard Access and Switch Control as well.

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-24 07:52:29 +01:00
Yusuke Arakawa 9746eb7674
Update Localizable.strings (#1295) 2023-03-23 17:32:06 +01:00
Peter-Josef Meisch f68e174aac
Use unicode word chars to recognize hashtags in editor (#1296) 2023-03-23 17:31:58 +01:00
Roberto Pastor 776a51734f
Updated spanish translation (#1294) 2023-03-23 17:31:48 +01:00
Jerry 0ec94c6cc4
Update Simplified Chinese localization (#1293) 2023-03-23 17:31:40 +01:00
Xabi e32749851e
Update Basque plurals (#1286) 2023-03-21 06:25:10 +01:00
Xabi a562c22aee
Update Basque localisation (#1285) 2023-03-21 06:25:03 +01:00
Ico Davids c14bd26e3a
Accessibility strings (#1284) 2023-03-21 06:24:54 +01:00
Roberto Pastor 6f0e466954
Updated spanish translation (#1283) 2023-03-21 06:24:50 +01:00
Cthulhux cc8d63e656
Update Localizable.strings (#1282) 2023-03-21 06:24:43 +01:00
Thomas Ricouard 96811e5074 Bump to 1.6.9 2023-03-20 06:38:24 +01:00
Cthulhux af245da273
de: translated the whole lot of new strings (#1279)
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-20 06:36:31 +01:00
Andrzej Rózga e066ef8dc9
Polish localization update (#1280)
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-20 06:35:47 +01:00
Yusuke Arakawa 8f09841f96
Update Localizable.strings (#1281)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-20 06:35:14 +01:00
Chris Kolbu eab69ce9fa
Timeline tab accessibility uplift (#1277)
* Refine Profile tab VoiceOver order to prioritise user information

Previously, VoiceOver user would have to traverse through header image, “follows you”, and the profile image before getting to the display name of the user.

Now, this element is the first element after the navigation bar.

* Add accessibility label to Timeline Compose post button

Previously, this button was using the SF symbol fallback label.

Now, it has a localized equivalent in addition to two other options: “New”, and “Create”

* Change accessible representation of Timeline nav bar menu

Previously, this would present as a static text.

Now, it has the header trait. In addition, by changing the representation, VoiceOver will read it out as “Home, Pop-up button, Header”, indicating that it opens a menu.

* Add accessibilityHint to Timeline tab Accounts selector

* Add accessibilityLabel and hint to PendingStatusesObserver

Previously, this button would have a label equal to the count of unread posts. Now, it states “X new posts” with the hint “Scrolls the timeline”
2023-03-20 06:33:42 +01:00
Chris Kolbu 3a3d0a7b55
Fix: Inline StatusRowView accessibilityLabel modifier to avoid flashing (#1278)
* Inline StatusRowView accessibilityLabel modifier

By inlining this label, we avoid the creation of `ConditionalContent`, which often leads to views being recreated unnecessarily.

In focused mode, the empty label is not read as, it is the accessibility container label for the post component elements.

* Inline StatusRowView accessibilityLabel modifier

By inlining this label, we avoid the creation of `ConditionalContent`, which often leads to views being recreated unnecessarily.

In focused mode, the empty label is not read as, it is the accessibility container label for the post component elements.

* Wrap

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-19 18:36:57 +01:00
Thomas Ricouard 4ffdd46a2a StatusRow: Only add ConditionalAccessibilityLabelModifier if voiceover is running 2023-03-19 17:04:35 +01:00
Thomas Ricouard df55028836 SwiftFormat . 2023-03-19 16:28:06 +01:00
Chris Kolbu 9a6b2129b2
Profile tab accessibility uplift (#1274)
* Combine `joinedAtView` into one accessibility element

Previously, the calendar image was visible with a nonsensical label.

We use the `.combine` operator here to maintain the proper string formatting of the date.

* Improve the accessibility of the AccountDetailHeaderView

Previously, this image had no description and no indication that it had an associated interaction. Now, we wrap it in a button that performs the tap gesture action, and remove the element altogether if there is no avatar image set.

This commit also handles the checkmark for supporter users

* Tweak accessibility of Profile CustomInfoLabels

This commit:
- Reverses the order of title and value
- Sets the value as an `accessibilityValue`
- Adds a hint indicating what the button does, as they perform slightly different actions

* Make Profile tab header image into a Button

This element has an action associated with it (quicklook), so it makes more sense to have it as a button, and hide it if the user does not have an image set.

Without the action it would have been considered decorative and should be hidden.

* Change accessibilityLabel of Profile tab nav bar item to ‘Options’

“More” is considered overly generic.

This commit also adds two additional user input label options

* Add accessibility labels for the Profile tab `Picker`

Previously, these labels were the default accessibility label provided by the SF symbol, that almost, but not quite, made sense

* Remove StatusRowView swipe actions if VoiceOver is running

These swipe actions are automagically added to the accessibility element’s custom actions, in addition to the ones already there, which means that there is a significant (and confusing) amount of doubling up going on.

* Fix typo in StatusRowView.accessibilityActions

* Add accessibilityLabels to all StatusRowActionsView actions

* Provide explicit combined accessibility label for unfocused StatusRowView

Previously, this was a synthesized label, which read the elements in their traversal order, and didn’t provide any context for which of the three numbers corresponded to replies, boosts or favourites.

Now, we create an explicit combined label when the post isn’t being viewed by itself.

* Improve accessibility of StatusRow(Reblog|Reply)View

They are now combined elements and don’t vend the icon as its own element.

* Add missing punctuation to accessibility hints

* Remove interaction from Profile tab @username and profile note elements

These elements open the profile photo url, which is already provided explicitly through the profile photo

* Prefer spoiler warning for StatusRowView accessibility label

…but place the full, unredacted content in an `AccessibilityCustomContent` field for easy access.

Additionally, if VoiceOver is running, an action to expand the warning is also available.

* Represent `FollowButton` elements as Toggles to accessibility

Since these buttons have two states (though arguable in the case of following, but handled here by not changing the representation if a request is pending), it makes sense to handle them as toggles, so they will be read as “Following, On, <Trait>”

* Remove errant comment

* Add “Verified” accessibilityValue to profile fields

* Fix bug StatusRowView default action bug affecting VoiceOver users

Previously, the default (‘Activate’) action for VoiceOver users would be to share a link to the toot, rather than navigate to its detail. It’s hard to say exactly what caused this, but the root was the inclusion of the `contextMenu` in the `accessibilityActions`.

Now, double-tapping on a a non-focused `StatusRowView` will take you to the toot detail.

* Add header trait to Profile tab display name and familiar followers

These stand out as being header-like in presentation and represent the beginning of specific parts of the screen.

* Add conditional accessibility modifier to Profile tab user-defined fields that opens the correct link

* Add accessibility container that contextualises the user-defined fields

When VoiceOver users first enter a user-defined field, the container label will be read out before the element’s spoken description.

* Improve StatusRowView combined accessibility label

It will now start with:

“X boosted Y”, “X replied to @Y”, or “X…” depending on the context of the toot.

* Change familiar follows thumbnail to a Button; add display name as accessibility label

Previously, this button had no context, and would just be a series of images with nothing to allow users to disambiguate them.

* Revert changes from ZStack with tap gesture to Button

Using a Button for this purpose caused high weirdness in tap zones. Basically everything down to the familiar followers triggered both image buttons.

* Add image alt text to StatusRowView and StatusRowMediaPreviewView

Previously, there was no way for the intended audience for the alt text to find said text. There is a tap gesture on each image in the focused status row, but this is not advertised to the user.

Now, the first image’s alt text is read as part of the non-focused, combined representation, and each image has its own alt text attributed in the focused representation.

* Add Profile tab accessibility labels to indicate private/bot/muted/blocked accounts

Previously, the icon did not have any accessible representation (an empty text string).

* Add header trait to Profile “pinned post”

* Use the Account.Field.name for the user input label

* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 16:27:18 +01:00
Paul Schuetz da0b92e13d
Allow translation of an account bio/note (#1276)
The bio (note) of an account can now be translated via DeepL. If the user has
put in his own DeepL API key, that is used, otherwise, the standard one is
used. See #1267

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-03-19 16:18:13 +01:00
Jerry a08587643d
Update Simplified Chinese localization (#1265) 2023-03-19 06:45:40 +01:00
Andrzej Rózga 09dc56fcd3
Polish localization update (#1271) 2023-03-18 14:08:54 +01:00
Paul Schuetz e72abeebc6
Indicate loading when DeepL button is used (#1272) 2023-03-18 14:08:48 +01:00
Cthulhux 7d8516474c
de: translated AI strings (#1261) 2023-03-18 06:02:20 +01:00
Xabi 68f1a3e47d
Update Basque localisation (#1262) 2023-03-18 06:02:14 +01:00
Yusuke Arakawa 072c980157
Update Localizable.strings (#1263) 2023-03-18 06:02:06 +01:00
Chris Kolbu 4d588e4a18
Compose Post Screen Accessibility Tweaks (#1259)
* Add localized label for the AI prompt status accessory view

Previously, this icon would have an accessibility label matching its SF symbol key, ‘faxmachine’.

* Darken status editor character count foreground color

By changing it to .secondary, it gets to an APCA contrast of 61, which is a _just_ passing Bronze score for that text size.

It’s still quite short of WCAG 2.1 AA at 3.3:1 (recommended is 4.5:1)

* Change remaining character count color to red when < 0

* Refine remaining character count accessibility

In this commit, we
- Change its trait to `.updatesFrequently`
- Set a localized `accessibilityLabel`
- Set its `accessibilityValue` to the remaining character count
- Disable user interaction (which is presumably set automatically by virtue of being enclosed in a `Menu`)

* Set accessibilitySortPriority on Status editor ScrollView

Previously, the traversal order placed the elements inside the `ScrollView` last. Now, they follow on from the navigation bar contents in the expected order.

* Hide the AvatarView from status creation accessibility

When there is only one account available, there is no functionality associated with this element, so it is considered decorative-only, and should be hidden

* Set TextView placeholder’s `accessibilityValue` to placeholder text when empty

This behaviour matches `UITextField`

* Hide TextView custom `placeholderView` from accessibility

Previously, TextView would vend two accessibility elements when the placeholder was visible. This causes needless confusion for users.

Now, the TextView matches the accessible behaviour of text inputs elsewhere.

* Improve accessibility of post `privacyMenu`

Previously, it would be presented as `Everyone, Button`. Now, we move the visibility to its `value` and use `Visibility` for its label, in conjunction with a hint that states it `Changes post audience`.

* Add `.button` trait and accessible label to emojis in `customEmojisSheet`

Previously, these would all present as `image` with no description, making it very hard to discern what kind of emoji you were adding.

* Change drafts sheet item type to `Button`

A button with an action has a more accessible representation than a `Text` with a tap gesture.
2023-03-17 06:39:31 +01:00
Chris Kolbu c5b4a0dd07
Settings screen Accessibility tweaks (#1258)
* Remove `.button` trait from `Link`s on Account Settings screen

SwiftUI currently sets both the `.button` and `.link` traits on these elements, which is a failure for WCAG 2.1 4.12: Name, Role, Value: https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html

There is a radar for this issue: FB11507660

* Improve accessibility by making `AppAccountView`s a Button

Previously, the component elements of the `fullView` would be rendered as 3-4 individual views that would _all_ be interactive and perform the same action.

Now, as a Button, only one accessibility element is vended.

* Fix account label color

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-17 06:38:50 +01:00
Paul Schuetz fa090f5663
Remove an unnecessary icon. (#1256) 2023-03-17 06:06:56 +01:00
Ico Davids 5ef39e7a09
Add navigation title to the Translation Settings view (#1257) 2023-03-17 06:06:09 +01:00
Thomas Ricouard 022b068ce8 Always load translate 2023-03-16 07:09:59 +01:00
Paul Schuetz d00b66034d
Show the translate-with-DeepL button if necessary (#1248)
Previously, the button was shown if the always use DeepL setting was active.
This is redundant. Instead, the button is now shown, if the setting isn't
active.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-03-16 07:09:34 +01:00
Yusuke Arakawa ae51ea0c1c
Update Japanese Localizable.strings (#1255)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-03-16 07:08:29 +01:00
Chanhwi Joo 1a4d552e06
Update Korean localization (#1252) 2023-03-15 14:58:58 +01:00
Thomas Ricouard 3e88d89de3 Status detail: Handle status update 2023-03-15 14:55:45 +01:00
Thomas Ricouard 6e47f9410d Open links in Safari if remote status loading fails 2023-03-15 08:25:23 +01:00
Cthulhux 8803f1524a
de: fixed grammar (#1247) 2023-03-15 07:06:51 +01:00
Andrzej Rózga aa72c35718
Polish localization update (#1249) 2023-03-15 07:06:40 +01:00
Xabi 62438d669f
Update Basque localisation (#1250) 2023-03-15 07:06:32 +01:00
Jerry e52a3c0416
Update Simplified Chinese localization (#1251) 2023-03-15 07:06:24 +01:00
Thomas Ricouard 7c118ade6c Fix build 2023-03-14 18:54:45 +01:00
Yusuke Arakawa 7f96d97d7c
Changed so that pictograms can be entered continuously (#1246) 2023-03-14 18:53:16 +01:00
Paul Schuetz baf853f46e
Add the ability to translate using deepl even if the instance offers its own service (#1237)
* Allow forced translation with DeepL

Translation with DeepL can now be forced either per post or on the system level.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Require the use of a private API key

A private API key of the user is now required to allow "always translate via
DeepL".

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Persist a stored API key

An API key is stored even if useOnlyDeepL is disabled. If the API key is empty,
the setting is still disabled.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Localize the texts

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Save API key while writing

The API key is now saved, even if the app is closed before leaving the
translation settings view.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Fix build

* Fix theme

* Transition to KeychainSwift, clean up

KeychainHelper is replaced with the already-used KeychainSwift package, the
functions are cleaned up so that the process is easier to understand. The
deactivateToggleIfNoKey function doesn't change the behavior of the buttons or
context menus in the timeline, only demonstrates the necessity of an API key to
the user. Consequently, it's only called when the settings view is shown.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Swiftformat + fixes

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-14 18:50:19 +01:00
Vitaly Kovalyshyn f263c57858
update uk localizations (#1244) 2023-03-14 12:17:14 +01:00
Ico Davids dca8937aba
Use 'Done' text on accounts selector (#1245) 2023-03-14 12:17:05 +01:00
Ico Davids c818dbf744
Updated NL localization (#1238) 2023-03-14 07:22:44 +01:00
Paul Schuetz ff9bfe9285
Allow reordering of remote timelines (#1240)
The reordering of remote timelines is now available. See #1239

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-03-14 07:22:17 +01:00
Thomas Ricouard 0e3d174625 Bump to 1.6.8 2023-03-14 07:21:42 +01:00
Thomas Ricouard 4f6f98271a Fix #1236 2023-03-13 18:47:24 +01:00
Thomas Ricouard aa120a48f7 ServerError: Fix 2023-03-13 13:42:32 +01:00
Thomas Ricouard 6c307aba63 SwiftFormat 2023-03-13 13:38:28 +01:00
Thomas Ricouard f1267620be More tweaks to the prompt 2023-03-12 14:53:49 +01:00
Thomas Ricouard 7d0c6671bb Further tweaks to OpenAI hashtags prompts close #1222 2023-03-12 13:24:19 +01:00
Thomas Ricouard 0989f25bff Rework About Screen 2023-03-12 12:58:00 +01:00
Thomas Ricouard f0e9b0ca26 Better OpenAI hashtags prompts 2023-03-12 12:38:05 +01:00
Thomas Ricouard e52712383f Post JSON instead of URL queries for oauth flow 2023-03-12 12:23:44 +01:00
Thomas Ricouard 705e5514dc Bump to 1.6.7 2023-03-12 12:23:28 +01:00
Thomas Ricouard 5c9122a72c Accounts selector: Add correct initial height 2023-03-12 12:01:38 +01:00
Thomas Ricouard 8b4f6dbd05 Fix image max size in app extension 2023-03-12 11:43:15 +01:00
Thomas Ricouard 6f484fa6c5 Status row: fix navigating to account from remote timeline 2023-03-12 08:04:20 +01:00
Yusuke Arakawa c56ef64f55
Update Localizable.strings (#1223)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-03-11 14:42:49 +01:00
Cthulhux 0db1b889b4
Update Localizable.strings (#1225) 2023-03-11 14:42:42 +01:00
Thomas Ricouard 0132e51509 Add more path to compressor image 2023-03-11 13:42:07 +01:00
Thomas Ricouard f172d6d4a6 Rework image compression / upload 2023-03-11 13:38:08 +01:00
Jerry 0d2454886e
Update Localizable.strings (#1213) 2023-03-11 07:22:00 +01:00
Chanhwi Joo b574cdfbda
Update Korean localization (#1216) 2023-03-11 07:21:52 +01:00
Andrzej Rózga 77468d4560
Polish localization update (#1218) 2023-03-11 07:21:39 +01:00
Xabi 45b9d2886e
Update Basque localisation (#1219) 2023-03-11 07:21:30 +01:00
Keita Watanabe 968792ad68
Fix build error for design system package (#1220) 2023-03-11 07:21:16 +01:00
Thomas Ricouard 9057740162 Add upload from file browsing + better compression for images 2023-03-10 18:22:45 +01:00
Thomas Ricouard c3d1c6d363 Add a Mastometrics link in account menu 2023-03-10 18:22:13 +01:00
Thomas Ricouard 71f2617a30 Bump to 1.6.6 2023-03-10 09:29:18 +01:00
Thomas Ricouard 8571800b31 Account selector: Refresh accounts more often 2023-03-10 08:13:40 +01:00
Thomas Ricouard 8561374a84 Account selector: remove double settings 2023-03-10 07:59:54 +01:00
Xabi fd8906ecd5
Undo last changes (EU plurals) (#1211) 2023-03-10 07:12:01 +01:00
Jerry 7b646c770a
Update Simplified Chinese localization (#1212) 2023-03-10 07:11:50 +01:00
Cthulhux 21363d1bdf
de: translated #tags (#1202) 2023-03-09 20:36:01 +01:00
Yusuke Arakawa cbe7d8e8af
Update Localizable.strings (#1203) 2023-03-09 20:35:53 +01:00
Andrzej Rózga 498d6b950e
Polish localization update (#1204) 2023-03-09 20:35:40 +01:00
Ico Davids 25925f11d7
Updated NL localization (#1205)
* Updated NL localization

* Updated NL localization
2023-03-09 20:35:32 +01:00
Xabi 58e4a8df49
Update Basque localisation (#1208)
New:
- status.editor.ai-prompt.add-tags
- status.editor.ai-prompt.insert-tags
2023-03-09 20:35:23 +01:00
Thomas Ricouard b9793057e0 Bigger font for focused status 2023-03-09 20:27:03 +01:00
Thomas Ricouard 93d9ded447 Switch to new Chat completion API + Add Tags completion 2023-03-09 13:46:04 +01:00
Thomas Ricouard c36b9083ce More accurate tab selection sound / haptic 2023-03-09 08:30:13 +01:00
Thomas Ricouard 4001ffdbe5 Account selector: allow large detent 2023-03-09 06:47:06 +01:00
Thomas Ricouard 82dfeffaec Add haptic feedbacks when changing account 2023-03-09 06:36:38 +01:00
Thomas Ricouard 0709ce0958 Bump to 1.6.5 2023-03-09 06:30:19 +01:00
Thomas Ricouard 15b704c97a All new accounts selector 2023-03-08 19:02:31 +01:00
Thomas Ricouard 5c69aa64bc Re upload medias when account is changed in the share sheet 2023-03-08 19:02:23 +01:00
Thomas Ricouard 4c7d0f3386 Play sound effects before the server action for status 2023-03-08 19:02:12 +01:00
Thomas Ricouard f6b987a18a Display Settings: Close to live colors update, removed the "apply colors" button. 2023-03-08 19:02:00 +01:00
Thomas Ricouard c3c6899483 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-03-07 18:25:10 +01:00
Thomas Ricouard e7752feba0 Improve filter edit UX 2023-03-07 18:25:06 +01:00
Yusuke Arakawa 9d1e077762
Fixed the problem that the header information on the profile screen was not displayed (#1187)
* Fixed the problem that the header information on the profile screen was not displayed

* Fixed parallelism issue

---------

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-03-07 18:24:20 +01:00
Paul Schuetz 156279faac
Remove unnecessary dictionary in favor of tuple (#1192)
The dictionary for the detected and selected language when posting is replaced
with a named tuple to include named values that are checked at compile time.
This removes a source of error while still being expressive.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-03-07 18:24:12 +01:00
Ico Davids b3919702e0
Outlined icons in status editor (#1194) 2023-03-07 18:23:38 +01:00
Thomas Ricouard 21fd0b0541 Datasource: don't return filtered hidden statuses close #1175 2023-03-07 07:23:17 +01:00
Thomas Ricouard 58957c779a Align reblog / reply view in leading mode Fix #1186 2023-03-07 07:10:57 +01:00
Yusuke Arakawa 62fd7bae12
Fix spoiler image content alignment (#1177)
Fixed an issue where the alignment of the spoiler button and the spoiler image is split left and right when the image size is set to compact.

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-03-07 07:05:20 +01:00
Xabi eaaa8cd1c9
Update Basque plurals (#1189)
New:
- tag.suggested.mentions-%lld

Edited:
- notifications-others-count %lld
- notifications.label.favorite %lld
- notifications.label.follow %lld
- notifications.label.mention %lld
- notifications.label.reblog %lld
(they were ok in 1.6.3, just trying to improve it)
2023-03-07 07:05:10 +01:00
Xabi 0e3493bdb8
Update Basque localisation (#1190)
Moved to plurals:
- tag.suggested.mentions-%lld [not needed here anymore]

Edited:
- enum.durations.custom [capitalisation]
- settings.general.browser.in-app [shortening]
- settings.general.browser.system [shortening]
2023-03-07 07:05:02 +01:00
Thomas Ricouard acad7ee65f Bump to 1.6.4 2023-03-06 21:25:15 +01:00
Thomas Ricouard 4937ffb618 Update sounds 2023-03-06 21:04:46 +01:00
David Walter 2ac615b0ba
Fix CustomEmoji Baseline Offset (#1188) 2023-03-06 15:21:26 +01:00
Thomas Ricouard 28230ba184 Fix audio session 2023-03-06 14:10:39 +01:00
Sami Samhuri 796f451f3a
Fix poll percentage wrapping with larger font sizes (#1182) 2023-03-06 07:07:59 +01:00
Andrzej Rózga b0ee77caed
Polish localization (#1174)
* Fixed problem with with the translation of "mentions" in plural form
- Localizable.stringsdict needs a digit (not string) to make a choice of a correct plural form.
- fixed StatusEditorAutoCompleteView
- changed %@ format specifier in Localizable.strings with %lld

* Polish localization update

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-06 07:07:35 +01:00
Xabi af63692afa
Update Basque localisation (#1179)
New:
- enum.durations.custom
- tag.suggested.mentions-%@

Fixed:
- notifications.label.status
- status.editor.mode.reply-%@
- filter.action.warning
2023-03-06 07:06:08 +01:00
Xabi 2a95678b4f
Update Basque plurals (#1178)
I seem to be unable to get plurals right but I want to believe I'm getting close 😉
2023-03-06 07:06:00 +01:00
Thomas Ricouard cc71209254 Bump to 1.6.3 2023-03-05 19:21:23 +01:00
Keita Watanabe 1989ee1b0b
Fix String interpolation warnings (#1172) 2023-03-05 07:25:52 +01:00
sh95014 310a5fba99
Traditional Chinese (zh-Hant) localization (#1170)
* checkpoint

* checkpoint

* plurals and a couple of minor fixes
2023-03-05 07:25:34 +01:00
Keita Watanabe ef7c216d3a
Fix account name would be blank when DisplayName is empty. (#1169) 2023-03-05 07:24:59 +01:00
Keita Watanabe e3ab57ea1c
Fix account order (#1171) 2023-03-05 07:24:07 +01:00
Chanhwi Joo 07231d0e14
Update Korean localization (#1173) 2023-03-05 07:23:18 +01:00
Ico Davids 0483c28f80
Updated Dutch localization (#1166)
- Mentions of suggested tags
2023-03-05 07:22:48 +01:00
Jerry f1cff5514e
Update Localizable.strings (#1162) 2023-03-05 07:22:40 +01:00
Yusuke Arakawa 1af66896f9
Update Localizable.strings (#1160) 2023-03-04 17:10:14 +01:00
Stian Øverbye 60fb706eec
Minor language fix (#1161) 2023-03-04 17:09:57 +01:00
Paul Schuetz 143d07711f
Translate string to german (#1163)
The last non-german string is translated.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-03-04 17:09:51 +01:00
Cthulhux 546167b461
de: new string.. (#1164) 2023-03-04 17:09:44 +01:00
Thomas Ricouard 1466d9690a Suggestion: cancel previous task 2023-03-04 09:55:17 +01:00
Thomas Ricouard 761c8ed3be Composer: Sort suggested tags by usage + display it 2023-03-04 09:50:13 +01:00
Keita Watanabe 700ace10d9
fix about view preview (#1156) 2023-03-04 09:31:22 +01:00
Keita Watanabe b08e783cb8
add oss licenses for SwiftUI-Introspect and RevenueCat (#1157) 2023-03-04 09:31:04 +01:00
Thomas Ricouard cfee153050 Optimize tabbar selection 2023-03-04 09:30:27 +01:00
Thomas Ricouard ab06c0ab17 Fix supporter badge for rounded avatar 2023-03-04 09:16:00 +01:00
Thomas Ricouard f00f843a77 Improve padding in card link 2023-03-04 07:53:42 +01:00
Thomas Ricouard b6b3c30931 Fix rendering of the rocket ship 2023-03-04 07:13:38 +01:00
Thomas Ricouard f5b44de317 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-03-04 06:29:06 +01:00
Thomas Ricouard db34222b1d Bump to 1.6.2 2023-03-04 06:29:04 +01:00
Andrzej Rózga 0589c7f84e
Polish localization update (#1153) 2023-03-04 06:09:23 +01:00
Cthulhux a5845311f0
de: quick update for the new string... (#1154)
In a series of unfortunate circumstances, my previous commit was too late for the additional string. Here it is. ;-)
2023-03-04 06:09:16 +01:00
Thomas Ricouard 7fa0cd0fcd Bump to 1.6.1 2023-03-04 06:09:05 +01:00
Xabi ff4f50cef5
Update Basque plurals (#1148) 2023-03-03 20:10:51 +01:00
Xabi d07265c9f2
Update Basque localisation (#1149) 2023-03-03 20:10:40 +01:00
Ico Davids b11fc6b725
Dutch localization update (#1150) 2023-03-03 20:10:30 +01:00
Ico Davids 31744067e4
Make primary action bold: (#1151) 2023-03-03 20:10:20 +01:00
Thomas Ricouard df4a76f9d1 StatusDataControllerProvider: Update all statuses in detail view fetch 2023-03-03 19:29:31 +01:00
Thomas Ricouard e3d00d2b3e Composer: Don't allow description until the image is finished processing 2023-03-03 18:47:25 +01:00
Yusuke Arakawa 636cf54b61
Update Localizable.strings (#1145) 2023-03-03 18:22:16 +01:00
Cthulhux e166881e67
de: +2 strings (#1146) 2023-03-03 18:22:08 +01:00
Xabi 9b64326f48
Update Basque localisation (#1147)
New:
- settings.display.colors.apply
- settings.display.theme.text-color
- filter.edit.expiry
- filter.edit.expiry.date-time
- filter.edit.expiry.duration

Edited:
- notifications.label.poll
2023-03-03 18:22:00 +01:00
Thomas Ricouard deae0930b1 Add web account settings button 2023-03-03 18:21:52 +01:00
Thomas Ricouard 42c444fb03 Cleanup / fixes 2023-03-03 12:41:38 +01:00
Thomas Ricouard 82179e5f6f Fix notification text color 2023-03-03 09:20:17 +01:00
Thomas Ricouard 5766adc965 Cleanup display settings 2023-03-03 08:29:45 +01:00
Peter-Josef Meisch db5d0b9274
Display and edit filter expirations (#1141) 2023-03-03 08:15:34 +01:00
Thomas Ricouard eea6d93dd5 Add customization of text color close #385 2023-03-03 08:12:01 +01:00
Thomas Ricouard 10eeb39241 Fix laggy color picker close #1082 2023-03-03 07:24:00 +01:00
Thomas Ricouard 1ea8af4445 Fix #1096 2023-03-03 07:12:02 +01:00
Jerry a3b277affb
Update Simplified Chinese localization (#1144)
* Update Localizable.strings

* Update Localizable.strings

* Update Localizable.strings

Co-authored-by: nixzhu <zhuhongxu@gmail.com>

---------

Co-authored-by: nixzhu <zhuhongxu@gmail.com>
2023-03-03 07:04:58 +01:00
Cthulhux 8adeacc066
de: translated supporter strings (#1134) 2023-03-03 06:04:41 +01:00
Andrzej Rózga ff0f256b88
Polish localization update (#1135) 2023-03-03 06:04:34 +01:00
Roberto Pastor 79b5e2f940
Fixed typos and updated spanish translation (#1137) 2023-03-03 06:04:26 +01:00
Chanhwi Joo d65266fc45
Update Korean localization (#1143) 2023-03-03 06:04:18 +01:00
Thomas Ricouard df80321433 StatusRow: Remove client env object 2023-03-02 21:16:03 +01:00
Thomas Ricouard 37ed178c3f Various fixes + fix Explore navigation 2023-03-02 20:15:07 +01:00
Gareth Simpson d7f1ef45fe
Add Account: Sanitize the servername to remove http[s]:// and also usernames (#1131)
* Sanitize the servername to remove http[s]:// and also usernames

Fixes: #1120

* Sanitize the input box with sanitizedName, not instance.title
2023-03-02 08:55:35 +01:00
Thomas Ricouard 15b7954705 StatusRowViewModel: Cleanup 2023-03-02 06:56:25 +01:00
Thomas Ricouard d2d297f019 StatusDataController: Update on timeline fetch 2023-03-02 06:42:58 +01:00
Xabi 3c047c9bb5
Update Basque localisation (#1129)
New:
- settings.support.supporter.title
- settings.support.supporter.subtitle
- settings.support.supporter.subscribed
- settings.support.supporter.subscription-info
- settings.support.restore-purchase.button
- settings.support.restore-purchase.explanation
- settings.support.privacy-policy
- settings.support.terms-of-use
2023-03-02 06:30:49 +01:00
Yusuke Arakawa f0c156a098
Update Localizable.strings (#1133) 2023-03-02 06:30:40 +01:00
Gian Luca Dalla Torre beaf014c31
Italian Localization Update (#1128)
Get ready for 1.6.0!
2023-03-01 21:14:46 +01:00
Thomas Ricouard a76d8ef267 oops 2023-03-01 21:14:26 +01:00
Thomas Ricouard d3486bbd7e Fix entitlements check 2023-03-01 20:43:01 +01:00
Thomas Ricouard c9ee764d48 Update sounds 2023-03-01 20:14:03 +01:00
Andrzej Rózga 1581beef42
Polish localization update (#1126) 2023-03-01 20:08:09 +01:00
Ico Davids 6f6c0eb29b
Dutch localization update (#1127)
- Sound Effects
2023-03-01 20:08:02 +01:00
Thomas Ricouard 81f3db733b Add supporter subscription + supporter badge 2023-03-01 20:07:40 +01:00
Thomas Ricouard a9e935016f StatusDataController: update to fresh statuses data on user profile 2023-03-01 19:27:56 +01:00
Thomas Ricouard 43a4551d9b StatusRow: Flatify the hierarchy to work around iOS 16.4 issues 2023-03-01 17:34:03 +01:00
Thomas Ricouard 87ef2f2a39 Composer lang: Use reply / quote lang and latest recently used language as default 2023-03-01 07:44:37 +01:00
Thomas Ricouard d2c58482f0 StatusDataController: Handle remote status 2023-03-01 07:28:46 +01:00
Thomas Ricouard 963cef02a1 Add sent toot sound effect 2023-03-01 07:04:07 +01:00
Thomas Ricouard 147ba5a179 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-03-01 07:03:15 +01:00
Thomas Ricouard 05da36c27a StatusDataController: Properly fix update cycle 2023-03-01 07:03:09 +01:00
Gareth Simpson bd1593a107
Record quote toots that have failed to load so that we don't try and load them again. (#1119)
* Record quote toots that have failed to load so that we don't try and load them again.

Fixes
1: Repeated visible insertion and removal of placeholder quote toot.
2: Link hijacking of inline status viewer allowing links to be followed as regular URLs

* Move set

* Add back to routeur check

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-01 06:46:55 +01:00
Louis Lac 7207a188ce
Optimize images size (#1113)
* Converted images to HEIC

* Converted images to HEIC
2023-03-01 06:37:33 +01:00
Xabi 38a292052a
Update Basque localisation (#1115)
New:
- settings.other.sound-effect
2023-03-01 06:34:21 +01:00
Mike Cohen 8621d71cb1
Update ReblogCache.swift (#1121)
Increase cache size to 300, since 100 was too small and I was still seeing many duplicate boosts.
2023-03-01 06:30:54 +01:00
Yusuke Arakawa 527a7c1e33
Update Localizable.strings (#1123) 2023-03-01 06:30:39 +01:00
Cthulhux 57197b9e9a
Update Localizable.strings (#1111) 2023-02-28 21:54:39 +01:00
Vitaly Kovalyshyn 9309514c3b
uk: +Sounds; +Metadata; +bonus (#1112) 2023-02-28 21:54:30 +01:00
Thomas Ricouard 76dfc83ae2 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-02-28 21:33:41 +01:00
Thomas Ricouard b540d6ef5b Icons: Remove wrong username 2023-02-28 21:33:33 +01:00
Yusuke Arakawa ddebf87080
A cancel button has been placed on the custom pictogram selection screen on the post screen (#1101)
Currently, the post screen has a cancel button only on the screen for selecting drafts, so we placed a cancel button for consistency and UX improvement.
Related: #1073

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-28 21:11:32 +01:00
Chanhwi Joo ecfc82c371
Update Korean localization (#1103) 2023-02-28 21:11:25 +01:00
Vitaly Kovalyshyn 70f0ed9306
Ukrainian localization: some small improvements (#1104)
* Ukrainian localization: some small improvements

* ai-prompt fixes
2023-02-28 21:11:17 +01:00
Thomas Ricouard 9ad9b2d93a Fix status data controller 2023-02-28 21:11:06 +01:00
Thomas Ricouard a3e2d3f8b3 Add sound effects 2023-02-28 18:55:08 +01:00
Thomas Ricouard 6de27c62b6 Add a new neon icon 2023-02-28 18:52:34 +01:00
Thomas Ricouard f72b006b7f Bump to 1.6.0 2023-02-28 18:49:59 +01:00
Thomas Ricouard 735ed6a211 Accounts: Allow text selection of username and bio 2023-02-28 18:49:02 +01:00
Thomas Ricouard 54198c877f Notifications: fix rocket icon 2023-02-28 18:48:22 +01:00
Gareth Simpson 9ebe0b314c
Change arrows icon to rocket for boosts (#1099)
* Change arrows icon to rocket for boosts

* Fixing case (part 1)

* Fixing Case (part 2)

* Clean up after merge

* Fix for disabled boost

* Fixes

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-28 14:53:31 +01:00
Thomas Ricouard adf8d004f7 Update status on fetching detail 2023-02-28 14:16:16 +01:00
Thomas Ricouard 23fe7d3373 Media: Cleanup unused context menu 2023-02-28 08:09:13 +01:00
Thomas Ricouard f93e4063f2 Consistent favorites / boosts / bookmark state / count for statuses + refactor close #889 2023-02-28 06:58:52 +01:00
Thomas Ricouard 78d2930beb Bump to 1.5.13 2023-02-27 19:05:20 +01:00
Peter-Josef Meisch a209c9d0c2
Edit Account should be possible for all accounts; fix type in variable name (#1097) 2023-02-27 18:42:21 +01:00
Jerry d39ff54544
Update Simplified Chinese translations (#1093)
* Update Localizable.strings

* Update settings.content.collapse-long-posts-hint
2023-02-27 18:42:12 +01:00
Ico Davids de5fcec3c2
Dutch localization update (#1095) 2023-02-27 18:42:04 +01:00
Thomas Ricouard 4bc2672583 Timeline: Fix trending refreshing when navigating back 2023-02-27 18:41:51 +01:00
Thomas Ricouard 6dcce79379 Fix swipe actions not updating 2023-02-27 13:09:50 +01:00
Thomas Ricouard eee6a8b0bb Bump to 1.5.12 2023-02-27 07:11:50 +01:00
Thomas Ricouard 30de766777 Remove Atomics 2023-02-27 06:40:30 +01:00
Jim Dovey d1209e6704
Updated to resolve all possible Sendability warnings from Swift 6 compatibility mode. (#1072)
Co-authored-by: Jim Dovey <jimdovey@apple.com>
2023-02-27 06:39:07 +01:00
Cthulhux 9f026fbc42
de: translated three new strings (#1084) 2023-02-27 06:37:56 +01:00
Peter-Josef Meisch 6dae90f227
add icons for muted and blocked profiles (#1085) 2023-02-27 06:37:39 +01:00
Andrzej Rózga 90fce88ad7
Polish localization update (#1086) 2023-02-27 06:37:23 +01:00
Xabi 0097c3e895
Update Basque localisation (#1089)
New strings:
- settings.content.collapse-long-posts
- settings.content.collapse-long-posts-hint
- status.show-full-post
2023-02-27 06:37:16 +01:00
Thomas Ricouard b75dd65ac4 Timeline only clear cache if previous value was .home 2023-02-27 06:23:03 +01:00
Thomas Ricouard f22671cc66 Fix jump to latest not working on home 2023-02-27 06:21:49 +01:00
Thomas Ricouard 8a0cbcaa02 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-02-26 19:09:23 +01:00
Thomas Ricouard 8c4b286751 Timeline: Check for task cancellation before loading next page 2023-02-26 19:09:21 +01:00
Yusuke Arakawa 482bc1253c
Update Localizable.strings (#1083) 2023-02-26 19:04:13 +01:00
Thomas Ricouard 0f8c481bcb Bump to 1.5.11 2023-02-26 19:03:13 +01:00
Peter-Josef Meisch 4d28e2348e
Change icon for locked profile (#1065) 2023-02-26 17:33:16 +01:00
Peter-Josef Meisch 3a144b7792
collapse long posts (#1037) close #914
* collapse long posts

* initialize user pref setting in init(), remove onAppear and onChange(pref) from view

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-26 17:32:09 +01:00
Chanhwi Joo bd782abb88
Add 2 new icons (#1080) 2023-02-26 17:19:39 +01:00
Andrzej Rózga 4bae04e36e
Polish localization update (#1074) 2023-02-26 17:19:03 +01:00
Chanhwi Joo 9ff3a294ea
Update Korean localization (#1078) 2023-02-26 17:18:50 +01:00
Jair Henrique bcb2036b6b
Improve pt-BR localization (#1079) 2023-02-26 17:18:44 +01:00
Xabi cc174ddbd6
Update Basque localisation (#1081) 2023-02-26 17:18:37 +01:00
Thomas Ricouard 9d47427769 Fix notifications status images on iPad 2023-02-26 09:54:34 +01:00
Thomas Ricouard 347335f770 Move userMentioned outside of Status 2023-02-26 09:38:26 +01:00
Yusuke Arakawa 47bd92cd75
Update Localizable.strings (#1071) 2023-02-26 09:01:42 +01:00
Thomas Ricouard 0ec33b802d Refactor account context menu and add it to account list row 2023-02-26 08:59:49 +01:00
Ico Davids 242998799a
Dutch localization update (#1067) 2023-02-26 06:46:09 +01:00
Thomas Ricouard 83e4e74329 Swiftformat 2023-02-26 06:45:57 +01:00
Paul Schuetz 06629cc397
Enhance the context menu for private messages (#1053)
* Enhance the message context menu

A direct message can now directly be bookmarked, the author can be publicly
mentioned and reported.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Add options to the conversation list context menu

Since the latest message is shown in the conversation list, the user can now
interact with this message via the context menu similar to the messages in the
conversation history.
The "conversation" class had to be modified since
bookmarking and liking a message would have led to a race condition (depending
on the server) when fetching the conversations afterwards, so the only affected
the message is now immediately updated.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Remove child view models

The child views models are removed, and the list row now only uses the conversation
object managed by the list view model.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Make unmodified var let

The last state-var of a conversation isn't modified, instead, a new conversation
is created. Therefore, the var is now a let.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-02-26 06:45:31 +01:00
Thomas Ricouard 2ba2675ae4 Fix DM badge 2023-02-25 19:54:46 +01:00
Thomas Ricouard 93ee83c65d Timeline: Cleanup 2023-02-25 19:47:15 +01:00
Thomas Ricouard 151154b335 Timeline: Enable jump to latest + in place refresh for all other timeline types 2023-02-25 19:32:47 +01:00
Thomas Ricouard 43cb5164d1 Profile use compact name formatter for numbers close #1057 2023-02-25 18:37:07 +01:00
Yusuke Arakawa f1db2f716d
Adjusted how to hide the voting screen (#1054)
Like other submission item selection screens, the voting screen can now be shown/hidden with a button toggle.

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-25 18:28:27 +01:00
Thomas Ricouard d82453c513 Better visibility for DM in notifications list close #1064 2023-02-25 18:12:31 +01:00
Thomas Ricouard b036e90ce4 Simplify Timeline refresh 2023-02-25 10:10:27 +01:00
nixzhu 250730be42
Update Simplified Chinese localization (#1027)
* Update some translations

* Update two translations
2023-02-25 07:42:39 +01:00
Andrzej Rózga a125b71f34
Polish localization update (#1049) 2023-02-25 07:42:30 +01:00
Xabi 3ce1a7f038
Update Basque localisation (#1052)
added missing strings:
- settings.section.cache
- settings.cache-media.clear
- account.edit.metadata-section-title
- account.edit.metadata-name-placeholder
- account.edit.metadata-value-placeholder
- account.edit.add-metadata-button

fixed typo:
- settings.display.section.font

replaced:
- status.action.translate
- status.action.translate-from-%@
- status.action.translated-label-%@
with
- status.action.translate
- status.action.translated-label-%@
- status.action.translated-label-from-%@-%@
2023-02-25 07:42:23 +01:00
Thomas Ricouard 7561354a0c Bump tp 1.5.10 2023-02-24 20:12:56 +01:00
Cthulhux 08930a8061
de: new strings.. (#1048) 2023-02-24 18:53:03 +01:00
Yusuke Arakawa 1c2968f976
Update Localizable.strings (#1041) 2023-02-24 18:52:55 +01:00
Thomas Ricouard abb1c53ae6 Various fixes 2023-02-24 17:16:39 +01:00
Thomas Ricouard 8e72430b4f Revert the isThread behaviour 2023-02-24 13:25:40 +01:00
Thomas Ricouard 29aaa7c5cb Optimisations: Autoclosure for StatusRowViewModel 2023-02-24 13:25:21 +01:00
Thomas Ricouard 401bd7afb5 Edit profile: Fix fonts 2023-02-24 09:37:23 +01:00
Thomas Ricouard cc4768b5e7 Profile edit: Allow re order of fields 2023-02-24 09:23:16 +01:00
Yusuke Arakawa 293d680510
Fix follow button placement in the center (#1033)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-24 08:42:24 +01:00
Thomas Ricouard b47eaac9e7 Fix fr localization typo 2023-02-24 08:28:00 +01:00
Thomas Ricouard 63ff87f640 Move languages into Models 2023-02-24 08:24:51 +01:00
Thomas Ricouard 096e42b1c2 Profile edit: Add metadata editing 2023-02-24 07:55:24 +01:00
Yusuke Arakawa a14e1b5417
Update Localizable.strings (#1039)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-24 06:45:21 +01:00
Thomas Ricouard 3cc589851f Composer: Scale down image that are too big for upload 2023-02-23 21:21:21 +01:00
Thomas Ricouard fa0ad34bea Bump to 1.5.9 2023-02-23 20:04:51 +01:00
Thomas Ricouard aad3e27748 Composer: Normalize error UI for media upload 2023-02-23 19:53:16 +01:00
Thomas Ricouard 3f17afa8ac Accounts: Replace lock / robot emojis with SF Symbols 2023-02-23 18:57:48 +01:00
Thomas Ricouard f01a742845 Notifications: Show badge on account switcher on iOS 2023-02-23 18:57:28 +01:00
Thomas Ricouard 26e09d230b QuickLook: change + cleanup cache folder on close 2023-02-23 18:57:12 +01:00
Thomas Ricouard cdbfd5db00 Settings: Add an option to clean media cache 2023-02-23 18:43:09 +01:00
Thomas Ricouard 8e99c195e0 Sidebar: Make badge bigger + limit to 99+ 2023-02-23 18:42:34 +01:00
Thomas Ricouard 0db7ea897a Show thread icons whenever there is reply 2023-02-23 09:02:12 +01:00
Jair Henrique 62afbc5ea6
Improve pt-BR localization (#1025) 2023-02-23 08:05:39 +01:00
Kum Hathaway efaa21414e
Update Localizable.strings (#1028)
Just an update
2023-02-23 08:05:28 +01:00
Vitaly Kovalyshyn 27a3d34c94
- Improved ukrainian localization; (#1030)
- Added missed labels.
2023-02-23 08:05:16 +01:00
Thomas Ricouard 1ac9d8a6f8 Don't fetch status accounts when already fetched 2023-02-23 07:32:00 +01:00
Thomas Ricouard ead649125e Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-02-23 07:23:22 +01:00
Thomas Ricouard f93f0f0974 Quote statuses: Added cache + faster 2023-02-23 07:23:18 +01:00
David Walter a0e37273a4
Fix scaling of custom emoji (#1020) 2023-02-22 22:13:46 +01:00
Xabi 76556f4e83
Updated Basque localisation (#1017) 2023-02-22 22:13:09 +01:00
Ico Davids d54ffbac8f
Update nl localization (#1018) 2023-02-22 22:12:31 +01:00
Xabi 0746f409b8
Updated Basque plurals (#1019) 2023-02-22 22:12:22 +01:00
Ico Davids e4b880dfe5
Make primary action bold: (#1021) 2023-02-22 22:12:10 +01:00
Jair Henrique b927c680d7
Improve pt-BR localization (#1022) 2023-02-22 22:11:53 +01:00
Andrzej Rózga ea8df7ffa4
Polish localization update (#1023) 2023-02-22 22:11:43 +01:00
Emmanuel Netter 78a02d03b6
Updated french translation (#1024) 2023-02-22 22:11:37 +01:00
Thomas Ricouard c7bb84eb9c Bump to 1.5.8 2023-02-22 20:01:37 +01:00
Ico Davids 4bad875835
Instance Info refinements: (#1012)
- Format stats with thousandseparators
- Format instance version in monospace
2023-02-22 19:16:08 +01:00
Thomas Ricouard a4910037b8 Swiftformat . 2023-02-22 19:09:39 +01:00
Paul Schuetz 4af78478ba
Don't show the source-language before translating (#1008)
* Clear up the translate-button

The Translate button on the post and in the context menu now does not show the
source language to avoid user confusion if the language set by the poster is
not the actual language of the post. This language is now only used to decide
whether to display the button in the main view. The Translate button in the
context menu is independent.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Show the translation-source-language

The source-language of a translation is now shown.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

* Remove unused strings

The now unused translate-from-strings are removed.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-22 19:03:05 +01:00
Peter-Josef Meisch fc63830b27
Add lock icon to protected account (#1011)
Closes #915
2023-02-22 19:00:39 +01:00
Daniel Dickison bdf5d3c783
Always show buttons on focus status (#1015)
I think it's helpful to have the buttons and their numeric badges visible when showing a status detail view for the focused status, even if the user has opted to hide them in timeline display settings.

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-22 19:00:29 +01:00
Cthulhux 0831d64865
Update Localizable.strings (#1014)
more strings -> de...
2023-02-22 18:58:11 +01:00
Ico Davids dc3a56e37c
Move autoPlayVideo setting to content settings view (#1013) 2023-02-22 18:57:48 +01:00
Chanhwi Joo 0507ee6ccc
Use proper casing for en-GB localization (#1010) 2023-02-22 18:57:03 +01:00
Pascal Batty f1a1905098
Fix action button counter glitch in most scenarios (#1009)
Adds monospacedDigit modifier to the counter next to action button counter labels. This fixes the layout glitch that happens when the counter changes, most noticeably when you tap the boost or favorite button except for when the counter gains or loses a digit (9 -> 10, 99 -> 100 etc…)
Still greatly improves the actions view experience though.

Co-authored-by: Pascal Batty <pascal@zen.ly>
2023-02-22 18:56:49 +01:00
Thomas Durand 482d93a68d
Removed Boutique, using Bogeda directly (#1007)
* Removed Boutique, using Bogeda directly

* Updated about screen
2023-02-22 18:56:37 +01:00
Thomas Durand 11bc89c0cd
EmojiText update - containing performance improvements with "custom emoji cache" (#1006) 2023-02-22 18:56:28 +01:00
Vitaly Kovalyshyn bc58fe95bb
Ukrainian language: First version (#1004)
* Ukrainian language: First version

* Ukrainian localization. Fixed misspelling.

* Fixes

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-22 18:56:18 +01:00
Thomas Ricouard 4b40678931 Add a new context menu action to copy link 2023-02-22 18:49:32 +01:00
Thomas Ricouard c8c7f2d29d Don't include post actions button in capture mode 2023-02-22 18:49:17 +01:00
Thomas Ricouard 2828550531 Support medium display mode for card view 2023-02-22 18:49:00 +01:00
Yusuke Arakawa 00e7f29a11
Update Localizable.strings (#998) 2023-02-22 12:49:56 +01:00
Chanhwi Joo 40386d6312
Make boost swipe buttons consistent with ones from inline & context menu (#999)
* Show different label and icon for boosting my followers-only post

* Disable boost swipe actions on posts that can't be boosted

* Remove unnecessary function calls
2023-02-22 12:49:36 +01:00
Vincent Tourraine 76b8de1dad
Clean up settings capitalization (#1000)
Update EN Localizable.strings to follow title-style capitalization
2023-02-22 12:49:28 +01:00
Chanhwi Joo c1d2b28919
Update Korean localization (#1001) 2023-02-22 12:49:16 +01:00
Ico Davids 874403eca6
Dutch localization update (#1002)
* Dutch localization update

* Use 'stemmers' instead of 'personen'

* Slightly improve 'boosted' status
2023-02-22 12:49:09 +01:00
Roberto Pastor 8731b6514e
Updated spanish localization (#1003)
Co-authored-by: Roberto Pastor <roberto.pastor@cabify.com>
2023-02-22 12:49:01 +01:00
Pascal Batty 50b8c93787
Add flair to status action buttons (#1005)
* Add flair to status action buttons

- makes tintColor viewModel independent in Action
- adds isOn function to Action
- moves actionButton to its own function for clarity (and help compilo)
- moves the counter outside the button
- creates StatusActionButtonStyle that defines how an action button behaves when tapped and toggled
- adds nested SparklesView that animates sparkles when the action button is tapped

Sidenote : couldn't get the "bouncy" scale effect I wanted. It wouldn't work on an iOS device, but did on the simulator.

* Fix private boost action icon regression

---------

Co-authored-by: Pascal Batty <pascal@zen.ly>
2023-02-22 12:48:51 +01:00
Thomas Ricouard c4daa73932 More accurate notifications badge 2023-02-22 12:14:57 +01:00
Thomas Ricouard 105b7717a9 Fix #984 follow you being out of boundaries 2023-02-22 07:36:29 +01:00
Thomas Ricouard 5ca0180c4c Show full username for leading avatar position 2023-02-22 07:31:14 +01:00
Thomas Ricouard 4576507225 Added a new Medium media style 2023-02-22 07:26:32 +01:00
Alex Grebenyuk 37a69650ef
Remove capture mode for images (#996)
* Remove capture mode for images

* Simplify how processor is created in StatusRowMediaPreviewView

* Optimize StatusViewId further
2023-02-22 07:09:56 +01:00
Ico Davids 678f6f0cdd
Redesigned swipe actions settings (#937)
* Redesigned Swipe Action Settings screen

* Add TODO comments

* Redesigned Swipe Action Settings screen

* Redesigned Swipe Action Settings screen

* Add EN localization strings for primary/secondary

* Consolidate left/right swipe actions into one section

* Switch to targeted Swift concurrency warnings + fix them

* Polish localization update (#936)

* Updates to Dutch localization: (#935)

* de: translated the notes feature (#933)

* Fix 1 line note in centre (#938)

* Sort lists alphabetically in ListAddAccountView (#943)

* Optimize viewId (#942)

* Update Localizable.strings (#941)

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>

* Update Nuke (#940)

* Remove Sendable conformance on Client as it's not needed

* Profile: Show about fields inline

* Added a tip that it's a video, and not an image when autoplay is off (#939)

* Added a tip that it's a video, and not an image when autoplay is off

* Centered - bigger version of the video tip

* Share post as image close #885

* Honour in app browser settings when opening profile about fields

* Fix threading UI

* More tweak to capture mode

* Update Localizable.strings (#948)

* Update Localizable.strings (#946)

Translated..

* Updated EmojiText to 2.x (#944)

Interface used by IceCubeApp has not changed from 1.x to 2.x
Looking at the library diff shows new features like SFSymbol powered emojis. Not like we're going to make use of that
https://github.com/divadretlaw/EmojiText/compare/v1.2.0...2.0.2

* Bump to 1.5.5

* Polish localization update (#949)

* Optimize avatar view (#950)

* Reduce AvatarPlaceholderView body calls

* Resize avatars

* Reworked post header view + add option to hide server name from username

* Better header spacing

* Further improvement to the post header

* Polish localization update (#954)

* Update Localizable.strings (#953)

* Show post header thread icon more consistently

* Fix post header

* Fix threading UI

* Fix trending refresh

* de: 1 new string -> translated (#955)

* Update Simplified Chinese Translation (#926)

* Update Korean localization (#957)

* Trim whitespace and newlines in instance rules list (#956)

* Fix theme not being applied live on status row close #961

* Update some translations (#959)

* Add indicator for bots accounts

* Bump to 1.5.6

* Fix status actions on boosting posts (#974)

* Fix context menus for boosts

* Allow my boost of my followers-only post

* Disable boost context menu on posts can't be boosted and show different string for boosting my own private post

* Localizations

* CR

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>

* Fix crash when opening account details (#972) close #918

* Tweak the theme selector view (#975)

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>

* Change the Content Settings icon to match the timeline icon again. (#969)

* Fix display of multiple vote polls (#967)

Closes #952

* Updates to Dutch localization (#966)

* Font picker consistency (#960)

* Put SF Rounded into the popup menu with Hyperlegible & Dislexia

* Remove SF Rounded Toggle

* Fix In-App Safari (#945)

* Fix In-App Safari

* Open SFSafariViewController in a separate window

* Swiftformat

* Optimize custom font

* Fix a localization + make the ... menu zone bigger

* Update Localizable.strings (#976)

* Fix Equatable impl for Status and Account (thanks class)

* Make secondary column available on any size + add a toggle + faster macOS window resize

* Bigger secondary column width

* Composer: Fix swipe to dismiss

* Composer: Better ALT editing UI

* updates for Basque (#983)

added missing translations and small fixes

* Updated spanish localization (#982)

Co-authored-by: Roberto Pastor <roberto.pastor@cabify.com>

* Polish localization update (#980)

* Update Localizable.strings (#979)

More strings

* Singularize enum type names (#978)

* Fixes for composer and DM

* Remove padding

* Rename settings.swipeactions.status.icon-style

* Remove unused left/right localizable strings

* Add settings.swipeactions.appearance

* Add settings.swipeactions.status.explanation

* Add settings.swipeactions.primary and settings.swipeactions.secondary

* Add settings.swipeactions.use-theme-colors and settings.swipeactions.use-theme-colors-explanation

* Dutch localization update

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
Co-authored-by: Andrzej Rózga <53080024+AndrzejRozga@users.noreply.github.com>
Co-authored-by: Cthulhux <github@tuxproject.de>
Co-authored-by: Sean Goldin <EvilOne@users.noreply.github.com>
Co-authored-by: David Davies-Payne <d2p@me.com>
Co-authored-by: Alex Grebenyuk <grebenyuk.alexander@gmail.com>
Co-authored-by: Yusuke Arakawa <108506642+nekolaboratory@users.noreply.github.com>
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
Co-authored-by: Thomas Durand <Dean151@users.noreply.github.com>
Co-authored-by: Dejavu Moe <jialong.vip@gmail.com>
Co-authored-by: Chanhwi Joo <56245920+te6-in@users.noreply.github.com>
Co-authored-by: Henrik Nyh <henrik@nyh.se>
Co-authored-by: nixzhu <zhuhongxu@gmail.com>
Co-authored-by: Gareth Simpson <g@xurble.org>
Co-authored-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
Co-authored-by: David Walter <divadretlaw@users.noreply.github.com>
Co-authored-by: Xabi <xabi.rn@gmail.com>
Co-authored-by: Roberto Pastor <wedge.hero@gmail.com>
Co-authored-by: Roberto Pastor <roberto.pastor@cabify.com>
Co-authored-by: Louis Lac <lac.louis5@gmail.com>
2023-02-22 07:07:26 +01:00
Thomas Durand 55b5010606
Updated RevenueCat - Fixes build with Xcode 14.3 beta (#985) 2023-02-22 07:06:14 +01:00
Thomas Durand 2c174ab72e
Fixed compact layout for video tip when video autoplay is disabled (#989) 2023-02-22 07:06:01 +01:00
Thomas Durand ded5bea4ce
Fix build with Swift 5.8 (#986)
Non optionals in if let don't work on the latest Xcode Beta
2023-02-22 07:04:37 +01:00
Julian Kahnert 0011b25a1c
fixes 965 (#991) 2023-02-22 07:04:02 +01:00
Aliaksandr 0fe7519307
Update belarussian localization (#990) 2023-02-22 07:02:42 +01:00
Gian Luca Dalla Torre 3e7fc347fb
Italian Localization Update (#992)
Get ready for version 1.5.7
2023-02-22 07:02:30 +01:00
nixzhu 2672e74d85
Update some translations (#995) 2023-02-22 07:02:21 +01:00
Thomas Ricouard bc2db0f4cc Proper 1.5.7 bump 2023-02-21 21:40:10 +01:00
Thomas Ricouard 27dbda9715 Bump to 1.5.7 2023-02-21 21:25:49 +01:00
Thomas Ricouard ed9b2a37a7 Fixes for composer and DM 2023-02-21 19:38:35 +01:00
Louis Lac bf49a4558c
Singularize enum type names (#978) 2023-02-21 18:52:30 +01:00
Cthulhux 737b179066
Update Localizable.strings (#979)
More strings
2023-02-21 18:51:46 +01:00
Andrzej Rózga 654f6f5d1a
Polish localization update (#980) 2023-02-21 18:51:25 +01:00
Roberto Pastor ce0d27537a
Updated spanish localization (#982)
Co-authored-by: Roberto Pastor <roberto.pastor@cabify.com>
2023-02-21 18:51:18 +01:00
Xabi a0f95b64bd
updates for Basque (#983)
added missing translations and small fixes
2023-02-21 18:51:11 +01:00
Thomas Ricouard 255af8c482 Composer: Better ALT editing UI 2023-02-21 18:50:56 +01:00
Thomas Ricouard 263ecbb715 Composer: Fix swipe to dismiss 2023-02-21 18:50:45 +01:00
Thomas Ricouard e758df04a8 Bigger secondary column width 2023-02-21 18:46:28 +01:00
Thomas Ricouard 7a997ebd8a Make secondary column available on any size + add a toggle + faster macOS window resize 2023-02-21 13:37:31 +01:00
Thomas Ricouard 5d3b378373 Fix Equatable impl for Status and Account (thanks class) 2023-02-21 12:35:07 +01:00
Yusuke Arakawa b643dda083
Update Localizable.strings (#976) 2023-02-21 08:09:50 +01:00
Thomas Ricouard 533558eb81 Fix a localization + make the ... menu zone bigger 2023-02-21 08:09:27 +01:00
Thomas Ricouard 061791f632 Optimize custom font 2023-02-21 07:37:16 +01:00
Thomas Ricouard b259b6739e Swiftformat 2023-02-21 07:23:42 +01:00
David Walter 94d50fafc4
Fix In-App Safari (#945)
* Fix In-App Safari

* Open SFSafariViewController in a separate window
2023-02-21 07:23:23 +01:00
Gareth Simpson 53f364b232
Font picker consistency (#960)
* Put SF Rounded into the popup menu with Hyperlegible & Dislexia

* Remove SF Rounded Toggle
2023-02-21 07:08:32 +01:00
Ico Davids 5057659cfc
Updates to Dutch localization (#966) 2023-02-21 07:05:34 +01:00
Peter-Josef Meisch 6aeb25885c
Fix display of multiple vote polls (#967)
Closes #952
2023-02-21 07:05:21 +01:00
Gareth Simpson a2346413ec
Change the Content Settings icon to match the timeline icon again. (#969) 2023-02-21 07:04:17 +01:00
Yusuke Arakawa 25f699a321
Tweak the theme selector view (#975)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-21 07:04:02 +01:00
Alex Grebenyuk c9e542a2ed
Fix crash when opening account details (#972) close #918 2023-02-21 07:03:24 +01:00
Chanhwi Joo f04c15b8fe
Fix status actions on boosting posts (#974)
* Fix context menus for boosts

* Allow my boost of my followers-only post

* Disable boost context menu on posts can't be boosted and show different string for boosting my own private post

* Localizations

* CR

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-21 06:59:47 +01:00
Thomas Ricouard 64b54cb31b Bump to 1.5.6 2023-02-20 19:26:57 +01:00
Thomas Ricouard 88173adc9e Add indicator for bots accounts 2023-02-20 18:15:45 +01:00
nixzhu 5e81eda3ed
Update some translations (#959) 2023-02-20 18:09:19 +01:00
Thomas Ricouard e7fffa07d4 Fix theme not being applied live on status row close #961 2023-02-20 13:00:50 +01:00
Henrik Nyh 2508f98ce1
Trim whitespace and newlines in instance rules list (#956) 2023-02-20 06:41:49 +01:00
Chanhwi Joo 3038225371
Update Korean localization (#957) 2023-02-20 06:16:47 +01:00
Dejavu Moe d8f258ecbe
Update Simplified Chinese Translation (#926) 2023-02-20 06:16:38 +01:00
Thomas Ricouard 4da8b35628 Merge branch 'main' of https://github.com/Dimillian/IceCubesApp 2023-02-19 21:37:23 +01:00
Thomas Ricouard 1a7ef62fd6 Fix trending refresh 2023-02-19 21:37:22 +01:00
Cthulhux 3ef202d985
de: 1 new string -> translated (#955) 2023-02-19 20:57:07 +01:00
Thomas Ricouard aa63dd5ab7 Fix threading UI 2023-02-19 20:56:56 +01:00
Thomas Ricouard 052586022d Fix post header 2023-02-19 20:56:50 +01:00
Thomas Ricouard a74f292696 Show post header thread icon more consistently 2023-02-19 20:12:31 +01:00
Yusuke Arakawa 83d236426b
Update Localizable.strings (#953) 2023-02-19 19:57:50 +01:00
Andrzej Rózga ee31c60f70
Polish localization update (#954) 2023-02-19 19:57:42 +01:00
Thomas Ricouard b64b21be20 Further improvement to the post header 2023-02-19 19:57:17 +01:00
Thomas Ricouard ed583a937d Better header spacing 2023-02-19 19:51:37 +01:00
Thomas Ricouard 0d6eff391b Reworked post header view + add option to hide server name from username 2023-02-19 19:16:39 +01:00
Alex Grebenyuk da289dbc1f
Optimize avatar view (#950)
* Reduce AvatarPlaceholderView body calls

* Resize avatars
2023-02-19 18:34:16 +01:00
Andrzej Rózga 76be2b5671
Polish localization update (#949) 2023-02-19 18:33:39 +01:00
Thomas Ricouard 8353800cec Bump to 1.5.5 2023-02-19 18:31:46 +01:00
667 changed files with 107773 additions and 19946 deletions

11
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "swift" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

View file

@ -0,0 +1,35 @@
name: Validate Translations
on:
pull_request:
types: [synchronize, opened, reopened, labeled, unlabeled, edited]
jobs:
main:
name: Validate Translations
runs-on: macOS-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: ruby versions
run: |
ruby --version
gem --version
bundler --version
- name: ruby setup
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
# additional steps here, if needed
- name: Clone SwiftPolyglot
run: git clone https://github.com/appdecostudio/SwiftPolyglot.git --branch 0.2.0
- name: Build and Run SwiftPolyglot
run: |
swift build --package-path ./SwiftPolyglot --configuration release
swift run --package-path ./SwiftPolyglot swiftpolyglot "en,eu,be,ca,zh-Hans,zh-Hant,nl,en-GB,fr,de,it,ja,ko,nb,pl,pt-BR,es,tr,uk"

View file

@ -15,7 +15,7 @@ import Network
// Sample code was sending this from a thread to another, let asume @Sendable for this
extension NSExtensionContext: @unchecked Sendable {}
class ActionRequestHandler: NSObject, NSExtensionRequestHandling {
final class ActionRequestHandler: NSObject, NSExtensionRequestHandling, Sendable {
enum Error: Swift.Error {
case inputProviderNotFound
case loadedItemHasWrongType

View file

@ -2,9 +2,9 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>OPENAI_SECRET</key>
<string>NICE_TRY</string>
<key>DEEPL_SECRET</key>
<string>NICE_TRY_AGAIN</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

View file

@ -0,0 +1,9 @@
/*
InfoPlist.strings
IceCubesApp
Created by Thomas Durand on 27/01/2023.
*/
"CFBundleDisplayName" = "Open in Ice Cubes";

View file

@ -0,0 +1,9 @@
/*
InfoPlist.strings
IceCubesApp
Created by Thomas Durand on 27/01/2023.
*/
"CFBundleDisplayName" = "在 Ice Cubes 中開啟";

File diff suppressed because it is too large Load diff

View file

@ -3,19 +3,19 @@
{
"identity" : "bodega",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mergesort/Bodega.git",
"location" : "https://github.com/mergesort/Bodega",
"state" : {
"revision" : "3e7c1c58ad9a46aa8551cebfe87770003cdaaaca",
"version" : "2.0.2"
"revision" : "f0554077c178088ba11557bbdbb71775cc6a1b84",
"version" : "2.1.0"
}
},
{
"identity" : "boutique",
"identity" : "buttonkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mergesort/Boutique",
"location" : "https://github.com/Dean151/ButtonKit",
"state" : {
"revision" : "b5b697de67100edc4b2d5c74724f3c1068b49d4e",
"version" : "2.1.1"
"revision" : "377f5bab4ed047704316d531e0826d4de5ebf6a4",
"version" : "0.1.1"
}
},
{
@ -23,8 +23,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/divadretlaw/EmojiText",
"state" : {
"revision" : "b52cfb8278425c28771bee4cc9e87453a52f3f4d",
"version" : "2.0.2"
"revision" : "c54000aa9ccc048619054a5a2da2ce0576ffea18",
"version" : "4.0.1"
}
},
{
"identity" : "giphy-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Giphy/giphy-ios-sdk",
"state" : {
"revision" : "9c58a350a3381f1641f5a31cdcd162a406274892",
"version" : "2.2.8"
}
},
{
@ -33,7 +42,16 @@
"location" : "https://github.com/evgenyneu/keychain-swift",
"state" : {
"branch" : "master",
"revision" : "e43f9b99b172ae6a7253047f8ba95c7a0b05b99f"
"revision" : "f38cb0ada97847ac5068b915b8d2793b35435668"
}
},
{
"identity" : "libwebp-xcode",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SDWebImage/libwebp-Xcode",
"state" : {
"revision" : "b2b1d20a90b14d11f6ef4241da6b81c1d3f171e4",
"version" : "1.3.2"
}
},
{
@ -50,17 +68,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/kean/Nuke",
"state" : {
"branch" : "nuke-12",
"revision" : "baccf1b00f458a77a9f9615e415bc4463029cf5e"
"revision" : "8ecbfc886da39bccb01c34abef5f2ff4073ad633",
"version" : "12.4.0"
}
},
{
"identity" : "purchases-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/RevenueCat/purchases-ios.git",
"location" : "https://github.com/RevenueCat/purchases-ios",
"state" : {
"revision" : "9cfb6adb41dc40d80c104b2ef6e9a84bca03ea48",
"version" : "4.16.0"
"revision" : "a9763ca482d52ea3d59aa2dfd2fc23427b02dada",
"version" : "4.40.1"
}
},
{
"identity" : "sfsafesymbols",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SFSafeSymbols/SFSafeSymbols",
"state" : {
"revision" : "7cca2d60925876b5953a2cf7341cd80fbeac983c",
"version" : "4.1.1"
}
},
{
@ -68,17 +95,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/stephencelis/SQLite.swift.git",
"state" : {
"revision" : "4d543d811ee644fa4cc4bfa0be996b4dd6ba0f54",
"version" : "0.13.3"
"revision" : "7a2e3cd27de56f6d396e84f63beefd0267b55ccb",
"version" : "0.14.1"
}
},
{
"identity" : "swift-collections",
"identity" : "swift-cmark",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections",
"location" : "https://github.com/apple/swift-cmark.git",
"state" : {
"revision" : "48254824bb4248676bf7ce56014ff57b142b77eb",
"version" : "1.0.2"
"revision" : "f218e5d7691f78b55bfa39b367763f4612486c35",
"version" : "0.3.0"
}
},
{
"identity" : "swift-markdown",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-markdown",
"state" : {
"revision" : "e4f95e2dc23097a1a9a1dfdfe3fe3ee44de77378",
"version" : "0.3.0"
}
},
{
@ -86,8 +122,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/scinfu/SwiftSoup.git",
"state" : {
"revision" : "f707b8680cddb96dc1855632340a572ef37bbb98",
"version" : "2.5.3"
"revision" : "8b6cf29eead8841a1fa7822481cb3af4ddaadba6",
"version" : "2.6.1"
}
},
{
@ -95,17 +131,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/siteline/SwiftUI-Introspect.git",
"state" : {
"revision" : "f2616860a41f9d9932da412a8978fec79c06fe24",
"version" : "0.1.4"
}
},
{
"identity" : "swiftui-shimmer",
"kind" : "remoteSourceControl",
"location" : "https://github.com/markiv/SwiftUI-Shimmer",
"state" : {
"revision" : "965a7cbcbf094cbcf22b9251a2323bdc3432e171",
"version" : "1.1.0"
"revision" : "9e1cc02a65b22e09a8251261cccbccce02731fc5",
"version" : "1.1.1"
}
}
],

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E9DF41F929830FEC0003AAD2"
BuildableName = "IceCubesActionExtension.appex"
BlueprintName = "IceCubesActionExtension"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "IceCubesApp.app"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
@ -45,7 +45,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "IceCubesApp.app"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
@ -62,7 +62,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "IceCubesApp.app"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>

View file

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9F7788C42BE652B1004E6BEF"
BuildableName = "IceCubesAppWidgetsExtensionExtension.appex"
BlueprintName = "IceCubesAppWidgetsExtensionExtension"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "_XCWidgetKind"
value = ""
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "_XCWidgetDefaultView"
value = "timeline"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "_XCWidgetFamily"
value = "systemMedium"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9F2A5415296AB631009B2D7C"
BuildableName = "IceCubesNotifications.appex"
BlueprintName = "IceCubesNotifications"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FAD858729743F7400496AB1"
BuildableName = "IceCubesShareExtension.appex"
BlueprintName = "IceCubesShareExtension"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9FBFE638292A715500C250E9"
BuildableName = "Ice Cubes.app"
BlueprintName = "IceCubesApp"
ReferencedContainer = "container:IceCubesApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,235 @@
import Account
import AppAccount
import Conversations
import DesignSystem
import Env
import Explore
import LinkPresentation
import Lists
import MediaUI
import Models
import Notifications
import StatusKit
import SwiftUI
import Timeline
@MainActor
extension View {
func withAppRouter() -> some View {
navigationDestination(for: RouterDestination.self) { destination in
switch destination {
case let .accountDetail(id):
AccountDetailView(accountId: id, scrollToTopSignal: .constant(0))
case let .accountDetailWithAccount(account):
AccountDetailView(account: account, scrollToTopSignal: .constant(0))
case let .accountSettingsWithAccount(account, appAccount):
AccountSettingsView(account: account, appAccount: appAccount)
case let .statusDetail(id):
StatusDetailView(statusId: id)
case let .statusDetailWithStatus(status):
StatusDetailView(status: status)
case let .remoteStatusDetail(url):
StatusDetailView(remoteStatusURL: url)
case let .conversationDetail(conversation):
ConversationDetailView(conversation: conversation)
case let .hashTag(tag, accountId):
TimelineView(timeline: .constant(.hashtag(tag: tag, accountId: accountId)),
pinnedFilters: .constant([]),
selectedTagGroup: .constant(nil),
scrollToTopSignal: .constant(0),
canFilterTimeline: false)
case let .list(list):
TimelineView(timeline: .constant(.list(list: list)),
pinnedFilters: .constant([]),
selectedTagGroup: .constant(nil),
scrollToTopSignal: .constant(0),
canFilterTimeline: false)
case let .following(id):
AccountsListView(mode: .following(accountId: id))
case let .followers(id):
AccountsListView(mode: .followers(accountId: id))
case let .favoritedBy(id):
AccountsListView(mode: .favoritedBy(statusId: id))
case let .rebloggedBy(id):
AccountsListView(mode: .rebloggedBy(statusId: id))
case let .accountsList(accounts):
AccountsListView(mode: .accountsList(accounts: accounts))
case .trendingTimeline:
TimelineView(timeline: .constant(.trending),
pinnedFilters: .constant([]),
selectedTagGroup: .constant(nil),
scrollToTopSignal: .constant(0),
canFilterTimeline: false)
case let .trendingLinks(cards):
TrendingLinksListView(cards: cards)
case let .tagsList(tags):
TagsListView(tags: tags)
case .notificationsRequests:
NotificationsRequestsListView()
case let .notificationForAccount(accountId):
NotificationsListView(lockedType: nil,
lockedAccountId: accountId,
scrollToTopSignal: .constant(0))
case .blockedAccounts:
AccountsListView(mode: .blocked)
case .mutedAccounts:
AccountsListView(mode: .muted)
}
}
}
func withSheetDestinations(sheetDestinations: Binding<SheetDestination?>) -> some View {
sheet(item: sheetDestinations) { destination in
switch destination {
case let .replyToStatusEditor(status):
StatusEditor.MainView(mode: .replyTo(status: status))
.withEnvironments()
case let .newStatusEditor(visibility):
StatusEditor.MainView(mode: .new(text: nil, visibility: visibility))
.withEnvironments()
case let .prefilledStatusEditor(text, visibility):
StatusEditor.MainView(mode: .new(text: text, visibility: visibility))
.withEnvironments()
case let .imageURL(urls, visibility):
StatusEditor.MainView(mode: .imageURL(urls: urls, visibility: visibility))
.withEnvironments()
case let .editStatusEditor(status):
StatusEditor.MainView(mode: .edit(status: status))
.withEnvironments()
case let .quoteStatusEditor(status):
StatusEditor.MainView(mode: .quote(status: status))
.withEnvironments()
case let .quoteLinkStatusEditor(link):
StatusEditor.MainView(mode: .quoteLink(link: link))
.withEnvironments()
case let .mentionStatusEditor(account, visibility):
StatusEditor.MainView(mode: .mention(account: account, visibility: visibility))
.withEnvironments()
case .listCreate:
ListCreateView()
.withEnvironments()
case let .listEdit(list):
ListEditView(list: list)
.withEnvironments()
case let .listAddAccount(account):
ListAddAccountView(account: account)
.withEnvironments()
case .addAccount:
AddAccountView()
.withEnvironments()
case .addRemoteLocalTimeline:
AddRemoteTimelineView()
.withEnvironments()
case .addTagGroup:
EditTagGroupView()
.withEnvironments()
case let .statusEditHistory(status):
StatusEditHistoryView(statusId: status)
.withEnvironments()
case .settings:
SettingsTabs(popToRootTab: .constant(.settings), isModal: true)
.withEnvironments()
.preferredColorScheme(Theme.shared.selectedScheme == .dark ? .dark : .light)
case .accountPushNotficationsSettings:
if let subscription = PushNotificationsService.shared.subscriptions.first(where: { $0.account.token == AppAccountsManager.shared.currentAccount.oauthToken }) {
NavigationSheet { PushNotificationsView(subscription: subscription) }
.withEnvironments()
} else {
EmptyView()
}
case .about:
NavigationSheet { AboutView() }
.withEnvironments()
case .support:
NavigationSheet { SupportAppView() }
.withEnvironments()
case let .report(status):
ReportView(status: status)
.withEnvironments()
case let .shareImage(image, status):
ActivityView(image: image, status: status)
.withEnvironments()
case let .editTagGroup(tagGroup, onSaved):
EditTagGroupView(tagGroup: tagGroup, onSaved: onSaved)
.withEnvironments()
case .timelineContentFilter:
NavigationSheet { TimelineContentFilterView() }
.presentationDetents([.medium])
.presentationBackground(.thinMaterial)
.withEnvironments()
case .accountEditInfo:
EditAccountView()
.withEnvironments()
case .accountFiltersList:
FiltersListView()
.withEnvironments()
}
}
}
func withEnvironments() -> some View {
environment(CurrentAccount.shared)
.environment(UserPreferences.shared)
.environment(CurrentInstance.shared)
.environment(Theme.shared)
.environment(AppAccountsManager.shared)
.environment(PushNotificationsService.shared)
.environment(AppAccountsManager.shared.currentClient)
.environment(QuickLook.shared)
}
func withModelContainer() -> some View {
modelContainer(for: [
Draft.self,
LocalTimeline.self,
TagGroup.self,
RecentTag.self,
])
}
}
struct ActivityView: UIViewControllerRepresentable {
let image: UIImage
let status: Status
class LinkDelegate: NSObject, UIActivityItemSource {
let image: UIImage
let status: Status
init(image: UIImage, status: Status) {
self.image = image
self.status = status
}
func activityViewControllerLinkMetadata(_: UIActivityViewController) -> LPLinkMetadata? {
let imageProvider = NSItemProvider(object: image)
let metadata = LPLinkMetadata()
metadata.imageProvider = imageProvider
metadata.title = status.reblog?.content.asRawText ?? status.content.asRawText
return metadata
}
func activityViewControllerPlaceholderItem(_: UIActivityViewController) -> Any {
image
}
func activityViewController(_: UIActivityViewController,
itemForActivityType _: UIActivity.ActivityType?) -> Any?
{
nil
}
}
func makeUIViewController(context _: UIViewControllerRepresentableContext<ActivityView>) -> UIActivityViewController {
UIActivityViewController(activityItems: [image, LinkDelegate(image: image, status: status)],
applicationActivities: nil)
}
func updateUIViewController(_: UIActivityViewController, context _: UIViewControllerRepresentableContext<ActivityView>) {}
}
extension URL: Identifiable {
public var id: String {
absoluteString
}
}

View file

@ -1,151 +0,0 @@
import Account
import AppAccount
import Conversations
import DesignSystem
import Env
import Lists
import Status
import SwiftUI
import Timeline
import LinkPresentation
import Models
@MainActor
extension View {
func withAppRouter() -> some View {
navigationDestination(for: RouterDestinations.self) { destination in
switch destination {
case let .accountDetail(id):
AccountDetailView(accountId: id)
case let .accountDetailWithAccount(account):
AccountDetailView(account: account)
case let .accountSettingsWithAccount(account, appAccount):
AccountSettingsView(account: account, appAccount: appAccount)
case let .statusDetail(id):
StatusDetailView(statusId: id)
case let .statusDetailWithStatus(status):
StatusDetailView(status: status)
case let .remoteStatusDetail(url):
StatusDetailView(remoteStatusURL: url)
case let .conversationDetail(conversation):
ConversationDetailView(conversation: conversation)
case let .hashTag(tag, accountId):
TimelineView(timeline: .constant(.hashtag(tag: tag, accountId: accountId)), scrollToTopSignal: .constant(0))
case let .list(list):
TimelineView(timeline: .constant(.list(list: list)), scrollToTopSignal: .constant(0))
case let .following(id):
AccountsListView(mode: .following(accountId: id))
case let .followers(id):
AccountsListView(mode: .followers(accountId: id))
case let .favoritedBy(id):
AccountsListView(mode: .favoritedBy(statusId: id))
case let .rebloggedBy(id):
AccountsListView(mode: .rebloggedBy(statusId: id))
case let .accountsList(accounts):
AccountsListView(mode: .accountsList(accounts: accounts))
}
}
}
func withSheetDestinations(sheetDestinations: Binding<SheetDestinations?>) -> some View {
sheet(item: sheetDestinations) { destination in
switch destination {
case let .replyToStatusEditor(status):
StatusEditorView(mode: .replyTo(status: status))
.withEnvironments()
case let .newStatusEditor(visibility):
StatusEditorView(mode: .new(visibility: visibility))
.withEnvironments()
case let .editStatusEditor(status):
StatusEditorView(mode: .edit(status: status))
.withEnvironments()
case let .quoteStatusEditor(status):
StatusEditorView(mode: .quote(status: status))
.withEnvironments()
case let .mentionStatusEditor(account, visibility):
StatusEditorView(mode: .mention(account: account, visibility: visibility))
.withEnvironments()
case let .listEdit(list):
ListEditView(list: list)
.withEnvironments()
case let .listAddAccount(account):
ListAddAccountView(account: account)
.withEnvironments()
case .addAccount:
AddAccountView()
.withEnvironments()
case .addRemoteLocalTimeline:
AddRemoteTimelineView()
.withEnvironments()
case let .statusEditHistory(status):
StatusEditHistoryView(statusId: status)
.withEnvironments()
case .settings:
SettingsTabs(popToRootTab: .constant(.settings))
.withEnvironments()
.preferredColorScheme(Theme.shared.selectedScheme == .dark ? .dark : .light)
case .accountPushNotficationsSettings:
if let subscription = PushNotificationsService.shared.subscriptions.first(where: { $0.account.token == AppAccountsManager.shared.currentAccount.oauthToken }) {
PushNotificationsView(subscription: subscription)
.withEnvironments()
} else {
EmptyView()
}
case let .report(status):
ReportView(status: status)
.withEnvironments()
case let .shareImage(image, status):
ActivityView(image: image, status: status)
}
}
}
func withEnvironments() -> some View {
environmentObject(CurrentAccount.shared)
.environmentObject(UserPreferences.shared)
.environmentObject(CurrentInstance.shared)
.environmentObject(Theme.shared)
.environmentObject(AppAccountsManager.shared)
.environmentObject(PushNotificationsService.shared)
.environmentObject(AppAccountsManager.shared.currentClient)
}
}
struct ActivityView: UIViewControllerRepresentable {
let image: UIImage
let status: Status
class LinkDelegate: NSObject, UIActivityItemSource {
let image: UIImage
let status: Status
init(image: UIImage, status: Status) {
self.image = image
self.status = status
}
func activityViewControllerLinkMetadata(_ activityViewController: UIActivityViewController) -> LPLinkMetadata? {
let imageProvider = NSItemProvider(object: image)
let metadata = LPLinkMetadata()
metadata.imageProvider = imageProvider
metadata.title = status.reblog?.content.asRawText ?? status.content.asRawText
return metadata
}
func activityViewControllerPlaceholderItem(_ activityViewController: UIActivityViewController) -> Any {
image
}
func activityViewController(_ activityViewController: UIActivityViewController,
itemForActivityType activityType: UIActivity.ActivityType?) -> Any? {
nil
}
}
func makeUIViewController(context: UIViewControllerRepresentableContext<ActivityView>) -> UIActivityViewController {
return UIActivityViewController(activityItems: [image, LinkDelegate(image: image, status: status)],
applicationActivities: nil)
}
func updateUIViewController(_ uiViewController: UIActivityViewController, context: UIViewControllerRepresentableContext<ActivityView>) {}
}

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.icecubesapp</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudKit</string>
</array>
<key>com.apple.developer.user-fonts</key>
<array>
<string>app-usage</string>
</array>
<key>com.apple.developer.usernotifications.communication</key>
<true/>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.$(BUNDLE_ID_PREFIX).IceCubesApp</string>
</array>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)$(BUNDLE_ID_PREFIX).IceCubesApp</string>
</array>
</dict>
</plist>

View file

@ -4,6 +4,14 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.icecubesapp</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudKit</string>
</array>
<key>com.apple.developer.user-fonts</key>
<array>
<string>app-usage</string>
@ -16,7 +24,9 @@
<array>
<string>group.$(BUNDLE_ID_PREFIX).IceCubesApp</string>
</array>
<key>com.apple.security.files.user-selected.read-only</key>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>keychain-access-groups</key>
<array>

View file

@ -1,295 +0,0 @@
import Account
import AppAccount
import AVFoundation
import DesignSystem
import Env
import KeychainSwift
import Network
import RevenueCat
import SwiftUI
import Timeline
@main
struct IceCubesApp: App {
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate
@Environment(\.scenePhase) private var scenePhase
@StateObject private var appAccountsManager = AppAccountsManager.shared
@StateObject private var currentInstance = CurrentInstance.shared
@StateObject private var currentAccount = CurrentAccount.shared
@StateObject private var userPreferences = UserPreferences.shared
@StateObject private var pushNotificationsService = PushNotificationsService.shared
@StateObject private var watcher = StreamWatcher()
@StateObject private var quickLook = QuickLook()
@StateObject private var theme = Theme.shared
@StateObject private var sidebarRouterPath = RouterPath()
@State private var selectedTab: Tab = .timeline
@State private var selectSidebarItem: Tab? = .timeline
@State private var popToRootTab: Tab = .other
@State private var sideBarLoadedTabs: Set<Tab> = Set()
private var availableTabs: [Tab] {
appAccountsManager.currentClient.isAuth ? Tab.loggedInTabs() : Tab.loggedOutTab()
}
var body: some Scene {
WindowGroup {
appView
.applyTheme(theme)
.onAppear {
setNewClientsInEnv(client: appAccountsManager.currentClient)
setupRevenueCat()
refreshPushSubs()
}
.environmentObject(appAccountsManager)
.environmentObject(appAccountsManager.currentClient)
.environmentObject(quickLook)
.environmentObject(currentAccount)
.environmentObject(currentInstance)
.environmentObject(userPreferences)
.environmentObject(theme)
.environmentObject(watcher)
.environmentObject(pushNotificationsService)
.fullScreenCover(item: $quickLook.url, content: { url in
QuickLookPreview(selectedURL: url, urls: quickLook.urls)
.edgesIgnoringSafeArea(.bottom)
.background(TransparentBackground())
})
.onChange(of: pushNotificationsService.handledNotification) { notification in
if notification != nil {
pushNotificationsService.handledNotification = nil
if appAccountsManager.currentAccount.oauthToken?.accessToken != notification?.account.token.accessToken,
let account = appAccountsManager.availableAccounts.first(where:
{ $0.oauthToken?.accessToken == notification?.account.token.accessToken })
{
appAccountsManager.currentAccount = account
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
selectedTab = .notifications
pushNotificationsService.handledNotification = notification
}
} else {
selectedTab = .notifications
}
}
}
}
.commands {
appMenu
}
.onChange(of: scenePhase) { scenePhase in
handleScenePhase(scenePhase: scenePhase)
}
.onChange(of: appAccountsManager.currentClient) { newClient in
setNewClientsInEnv(client: newClient)
if newClient.isAuth {
watcher.watch(streams: [.user, .direct])
}
}
}
@ViewBuilder
private var appView: some View {
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
sidebarView
} else {
tabBarView
}
}
private func badgeFor(tab: Tab) -> Int {
if tab == .notifications && selectedTab != tab,
let token = appAccountsManager.currentAccount.oauthToken {
return watcher.unreadNotificationsCount + userPreferences.getNotificationsCount(for: token)
}
return 0
}
private var sidebarView: some View {
SideBarView(selectedTab: $selectedTab,
popToRootTab: $popToRootTab,
tabs: availableTabs,
routerPath: sidebarRouterPath) {
GeometryReader { proxy in
HStack(spacing: 0) {
ZStack {
if selectedTab == .profile {
ProfileTab(popToRootTab: $popToRootTab)
}
ForEach(availableTabs) { tab in
if tab == selectedTab || sideBarLoadedTabs.contains(tab) {
tab
.makeContentView(popToRootTab: $popToRootTab)
.opacity(tab == selectedTab ? 1 : 0)
.transition(.opacity)
.id("\(tab)\(appAccountsManager.currentAccount.id)")
.onAppear {
sideBarLoadedTabs.insert(tab)
}
} else {
EmptyView()
}
}
}
if proxy.frame(in: .global).width > (.maxColumnWidth + .secondaryColumnWidth),
appAccountsManager.currentClient.isAuth,
userPreferences.showiPadSecondaryColumn
{
Divider().edgesIgnoringSafeArea(.all)
notificationsSecondaryColumn
}
}
}
}.onChange(of: $appAccountsManager.currentAccount.id) { _ in
sideBarLoadedTabs.removeAll()
}
}
private var notificationsSecondaryColumn: some View {
NotificationsTab(popToRootTab: $popToRootTab, lockedType: nil)
.environment(\.isSecondaryColumn, true)
.frame(maxWidth: 360)
.id(appAccountsManager.currentAccount.id)
}
private var tabBarView: some View {
TabView(selection: .init(get: {
selectedTab
}, set: { newTab in
var transaction = Transaction()
transaction.disablesAnimations = true
withTransaction(transaction) {
if newTab == selectedTab {
/// Stupid hack to trigger onChange binding in tab views.
popToRootTab = .other
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
popToRootTab = selectedTab
}
}
selectedTab = newTab
if selectedTab == .notifications,
let token = appAccountsManager.currentAccount.oauthToken {
userPreferences.setNotification(count: 0, token: token)
watcher.unreadNotificationsCount = 0
}
}
HapticManager.shared.fireHaptic(of: .tabSelection)
})) {
ForEach(availableTabs) { tab in
tab.makeContentView(popToRootTab: $popToRootTab)
.tabItem {
if userPreferences.showiPhoneTabLabel {
tab.label
.labelStyle(TitleAndIconLabelStyle())
} else {
tab.label
.labelStyle(IconOnlyLabelStyle())
}
}
.tag(tab)
.badge(badgeFor(tab: tab))
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .tabBar)
}
}
.id(appAccountsManager.currentClient.id)
}
private func setNewClientsInEnv(client: Client) {
currentAccount.setClient(client: client)
currentInstance.setClient(client: client)
userPreferences.setClient(client: client)
Task {
await currentInstance.fetchCurrentInstance()
watcher.setClient(client: client, instanceStreamingURL: currentInstance.instance?.urls?.streamingApi)
watcher.watch(streams: [.user, .direct])
}
}
private func handleScenePhase(scenePhase: ScenePhase) {
switch scenePhase {
case .background:
watcher.stopWatching()
case .active:
watcher.watch(streams: [.user, .direct])
UIApplication.shared.applicationIconBadgeNumber = 0
Task {
await userPreferences.refreshServerPreferences()
}
default:
break
}
}
private func setupRevenueCat() {
Purchases.logLevel = .error
Purchases.configure(withAPIKey: "appl_JXmiRckOzXXTsHKitQiicXCvMQi")
}
private func refreshPushSubs() {
PushNotificationsService.shared.requestPushNotifications()
}
@CommandsBuilder
private var appMenu: some Commands {
CommandGroup(replacing: .newItem) {
Button("menu.new-post") {
sidebarRouterPath.presentedSheet = .newStatusEditor(visibility: userPreferences.postVisibility)
}
}
CommandGroup(replacing: .textFormatting) {
Menu("menu.font") {
Button("menu.font.bigger") {
if userPreferences.fontSizeScale < 1.5 {
userPreferences.fontSizeScale += 0.1
}
}
Button("menu.font.smaller") {
if userPreferences.fontSizeScale > 0.5 {
userPreferences.fontSizeScale -= 0.1
}
}
}
}
}
}
class AppDelegate: NSObject, UIApplicationDelegate {
let themeObserver = ThemeObserverViewController(nibName: nil, bundle: nil)
func application(_: UIApplication,
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool
{
try? AVAudioSession.sharedInstance().setCategory(.ambient, options: .mixWithOthers)
PushNotificationsService.shared.setAccounts(accounts: AppAccountsManager.shared.pushAccounts)
return true
}
func application(_: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
{
PushNotificationsService.shared.pushToken = deviceToken
Task {
PushNotificationsService.shared.setAccounts(accounts: AppAccountsManager.shared.pushAccounts)
await PushNotificationsService.shared.updateSubscriptions(forceCreate: false)
}
}
func application(_: UIApplication, didFailToRegisterForRemoteNotificationsWithError _: Error) {}
func application(_: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options _: UIScene.ConnectionOptions) -> UISceneConfiguration {
let configuration = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role)
if connectingSceneSession.role == .windowApplication {
configuration.delegateClass = SceneDelegate.self
}
return configuration
}
}
class ThemeObserverViewController: UIViewController {
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
print(traitCollection.userInterfaceStyle.rawValue)
}
}

View file

@ -0,0 +1,150 @@
import Account
import AppAccount
import AVFoundation
import DesignSystem
import Env
import KeychainSwift
import MediaUI
import Network
import RevenueCat
import StatusKit
import SwiftUI
import Timeline
@MainActor
struct AppView: View {
@Environment(AppAccountsManager.self) private var appAccountsManager
@Environment(UserPreferences.self) private var userPreferences
@Environment(Theme.self) private var theme
@Environment(StreamWatcher.self) private var watcher
@Environment(\.openWindow) var openWindow
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
@Binding var selectedTab: Tab
@Binding var appRouterPath: RouterPath
@State var popToRootTab: Tab = .other
@State var iosTabs = iOSTabs.shared
@State var sidebarTabs = SidebarTabs.shared
var body: some View {
#if os(visionOS)
tabBarView
#else
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
sidebarView
} else {
tabBarView
}
#endif
}
var availableTabs: [Tab] {
guard appAccountsManager.currentClient.isAuth else {
return Tab.loggedOutTab()
}
if UIDevice.current.userInterfaceIdiom == .phone || horizontalSizeClass == .compact {
return iosTabs.tabs
} else if UIDevice.current.userInterfaceIdiom == .vision {
return Tab.visionOSTab()
}
return sidebarTabs.tabs.map { $0.tab }
}
var tabBarView: some View {
TabView(selection: .init(get: {
selectedTab
}, set: { newTab in
if newTab == .post {
#if os(visionOS)
openWindow(value: WindowDestinationEditor.newStatusEditor(visibility: userPreferences.postVisibility))
#else
appRouterPath.presentedSheet = .newStatusEditor(visibility: userPreferences.postVisibility)
#endif
return
}
if newTab == selectedTab {
/// Stupid hack to trigger onChange binding in tab views.
popToRootTab = .other
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
popToRootTab = selectedTab
}
}
HapticManager.shared.fireHaptic(.tabSelection)
SoundEffectManager.shared.playSound(.tabSelection)
selectedTab = newTab
})) {
ForEach(availableTabs) { tab in
tab.makeContentView(selectedTab: $selectedTab, popToRootTab: $popToRootTab)
.tabItem {
if userPreferences.showiPhoneTabLabel {
tab.label
.environment(\.symbolVariants, tab == selectedTab ? .fill : .none)
} else {
Image(systemName: tab.iconName)
}
}
.tag(tab)
.badge(badgeFor(tab: tab))
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .tabBar)
}
}
.id(appAccountsManager.currentClient.id)
.withSheetDestinations(sheetDestinations: $appRouterPath.presentedSheet)
}
private func badgeFor(tab: Tab) -> Int {
if tab == .notifications, selectedTab != tab,
let token = appAccountsManager.currentAccount.oauthToken
{
return watcher.unreadNotificationsCount + (userPreferences.notificationsCount[token] ?? 0)
}
return 0
}
#if !os(visionOS)
var sidebarView: some View {
SideBarView(selectedTab: $selectedTab,
popToRootTab: $popToRootTab,
tabs: availableTabs)
{
HStack(spacing: 0) {
TabView(selection: $selectedTab) {
ForEach(availableTabs) { tab in
tab
.makeContentView(selectedTab: $selectedTab, popToRootTab: $popToRootTab)
.tabItem {
tab.label
}
.tag(tab)
}
}
.introspect(.tabView, on: .iOS(.v17)) { (tabview: UITabBarController) in
tabview.tabBar.isHidden = horizontalSizeClass == .regular
tabview.customizableViewControllers = []
tabview.moreNavigationController.isNavigationBarHidden = true
}
if horizontalSizeClass == .regular,
appAccountsManager.currentClient.isAuth,
userPreferences.showiPadSecondaryColumn
{
Divider().edgesIgnoringSafeArea(.all)
notificationsSecondaryColumn
}
}
}
.environment(appRouterPath)
}
#endif
var notificationsSecondaryColumn: some View {
NotificationsTab(selectedTab: .constant(.notifications),
popToRootTab: $popToRootTab, lockedType: nil)
.environment(\.isSecondaryColumn, true)
.frame(maxWidth: .secondaryColumnWidth)
.id(appAccountsManager.currentAccount.id)
}
}

View file

@ -0,0 +1,64 @@
import Env
import SwiftUI
extension IceCubesApp {
@CommandsBuilder
var appMenu: some Commands {
CommandGroup(replacing: .newItem) {
Button("menu.new-window") {
openWindow(id: "MainWindow")
}
.keyboardShortcut("n", modifiers: .shift)
Button("menu.new-post") {
#if targetEnvironment(macCatalyst)
openWindow(value: WindowDestinationEditor.newStatusEditor(visibility: userPreferences.postVisibility))
#else
appRouterPath.presentedSheet = .newStatusEditor(visibility: userPreferences.postVisibility)
#endif
}
.keyboardShortcut("n", modifiers: .command)
}
CommandGroup(replacing: .textFormatting) {
Menu("menu.font") {
Button("menu.font.bigger") {
if theme.fontSizeScale < 1.5 {
theme.fontSizeScale += 0.1
}
}
Button("menu.font.smaller") {
if theme.fontSizeScale > 0.5 {
theme.fontSizeScale -= 0.1
}
}
}
}
CommandMenu("tab.timeline") {
Button("timeline.latest") {
NotificationCenter.default.post(name: .refreshTimeline, object: nil)
}
.keyboardShortcut("r", modifiers: .command)
Button("timeline.home") {
NotificationCenter.default.post(name: .homeTimeline, object: nil)
}
.keyboardShortcut("h", modifiers: .shift)
Button("timeline.trending") {
NotificationCenter.default.post(name: .trendingTimeline, object: nil)
}
.keyboardShortcut("t", modifiers: .shift)
Button("timeline.federated") {
NotificationCenter.default.post(name: .federatedTimeline, object: nil)
}
.keyboardShortcut("f", modifiers: .shift)
Button("timeline.local") {
NotificationCenter.default.post(name: .localTimeline, object: nil)
}
.keyboardShortcut("l", modifiers: .shift)
}
CommandGroup(replacing: .help) {
Button("menu.help.github") {
let url = URL(string: "https://github.com/Dimillian/IceCubesApp/issues")!
UIApplication.shared.open(url)
}
}
}
}

View file

@ -0,0 +1,148 @@
import AppIntents
import Env
import MediaUI
import StatusKit
import SwiftUI
extension IceCubesApp {
var appScene: some Scene {
WindowGroup(id: "MainWindow") {
AppView(selectedTab: $selectedTab, appRouterPath: $appRouterPath)
.applyTheme(theme)
.onAppear {
setNewClientsInEnv(client: appAccountsManager.currentClient)
setupRevenueCat()
refreshPushSubs()
}
.environment(appAccountsManager)
.environment(appAccountsManager.currentClient)
.environment(quickLook)
.environment(currentAccount)
.environment(currentInstance)
.environment(userPreferences)
.environment(theme)
.environment(watcher)
.environment(pushNotificationsService)
.environment(appIntentService)
.environment(\.isSupporter, isSupporter)
.sheet(item: $quickLook.selectedMediaAttachment) { selectedMediaAttachment in
MediaUIView(selectedAttachment: selectedMediaAttachment,
attachments: quickLook.mediaAttachments)
.presentationBackground(.ultraThinMaterial)
.presentationCornerRadius(16)
.withEnvironments()
}
.onChange(of: pushNotificationsService.handledNotification) { _, newValue in
if newValue != nil {
pushNotificationsService.handledNotification = nil
if appAccountsManager.currentAccount.oauthToken?.accessToken != newValue?.account.token.accessToken,
let account = appAccountsManager.availableAccounts.first(where:
{ $0.oauthToken?.accessToken == newValue?.account.token.accessToken })
{
appAccountsManager.currentAccount = account
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
selectedTab = .notifications
pushNotificationsService.handledNotification = newValue
}
} else {
selectedTab = .notifications
}
}
}
.onChange(of: appIntentService.handledIntent) { _, _ in
if let intent = appIntentService.handledIntent?.intent {
handleIntent(intent)
appIntentService.handledIntent = nil
}
}
.withModelContainer()
}
#if targetEnvironment(macCatalyst)
.defaultSize(width: userPreferences.showiPadSecondaryColumn ? 1100 : 800, height: 1400)
#elseif os(visionOS)
.defaultSize(width: 800, height: 1200)
#endif
.commands {
appMenu
}
.onChange(of: scenePhase) { _, newValue in
handleScenePhase(scenePhase: newValue)
}
.onChange(of: appAccountsManager.currentClient) { _, newValue in
setNewClientsInEnv(client: newValue)
if newValue.isAuth {
watcher.watch(streams: [.user, .direct])
}
}
}
@SceneBuilder
var otherScenes: some Scene {
WindowGroup(for: WindowDestinationEditor.self) { destination in
Group {
switch destination.wrappedValue {
case let .newStatusEditor(visibility):
StatusEditor.MainView(mode: .new(text: nil, visibility: visibility))
case let .prefilledStatusEditor(text, visibility):
StatusEditor.MainView(mode: .new(text: text, visibility: visibility))
case let .editStatusEditor(status):
StatusEditor.MainView(mode: .edit(status: status))
case let .quoteStatusEditor(status):
StatusEditor.MainView(mode: .quote(status: status))
case let .replyToStatusEditor(status):
StatusEditor.MainView(mode: .replyTo(status: status))
case let .mentionStatusEditor(account, visibility):
StatusEditor.MainView(mode: .mention(account: account, visibility: visibility))
case let .quoteLinkStatusEditor(link):
StatusEditor.MainView(mode: .quoteLink(link: link))
case .none:
EmptyView()
}
}
.withEnvironments()
.environment(RouterPath())
.withModelContainer()
.applyTheme(theme)
.frame(minWidth: 300, minHeight: 400)
}
.defaultSize(width: 600, height: 800)
.windowResizability(.contentMinSize)
WindowGroup(for: WindowDestinationMedia.self) { destination in
Group {
switch destination.wrappedValue {
case let .mediaViewer(attachments, selectedAttachment):
MediaUIView(selectedAttachment: selectedAttachment,
attachments: attachments)
case .none:
EmptyView()
}
}
.withEnvironments()
.withModelContainer()
.applyTheme(theme)
.frame(minWidth: 300, minHeight: 400)
}
.defaultSize(width: 1200, height: 1000)
.windowResizability(.contentMinSize)
}
private func handleIntent(_: any AppIntent) {
if let postIntent = appIntentService.handledIntent?.intent as? PostIntent {
#if os(visionOS) || os(macOS)
openWindow(value: WindowDestinationEditor.prefilledStatusEditor(text: postIntent.content ?? "",
visibility: userPreferences.postVisibility))
#else
appRouterPath.presentedSheet = .prefilledStatusEditor(text: postIntent.content ?? "",
visibility: userPreferences.postVisibility)
#endif
} else if let tabIntent = appIntentService.handledIntent?.intent as? TabIntent {
selectedTab = tabIntent.tab.toAppTab
} else if let imageIntent = appIntentService.handledIntent?.intent as? PostImageIntent,
let urls = imageIntent.images?.compactMap({ $0.fileURL })
{
appRouterPath.presentedSheet = .imageURL(urls: urls,
visibility: userPreferences.postVisibility)
}
}
}

View file

@ -0,0 +1,124 @@
import Account
import AppAccount
import AVFoundation
import DesignSystem
import Env
import KeychainSwift
import MediaUI
import Network
import RevenueCat
import StatusKit
import SwiftUI
import Timeline
@main
struct IceCubesApp: App {
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate
@Environment(\.scenePhase) var scenePhase
@Environment(\.openWindow) var openWindow
@State var appAccountsManager = AppAccountsManager.shared
@State var currentInstance = CurrentInstance.shared
@State var currentAccount = CurrentAccount.shared
@State var userPreferences = UserPreferences.shared
@State var pushNotificationsService = PushNotificationsService.shared
@State var appIntentService = AppIntentService.shared
@State var watcher = StreamWatcher.shared
@State var quickLook = QuickLook.shared
@State var theme = Theme.shared
@State var selectedTab: Tab = .timeline
@State var appRouterPath = RouterPath()
@State var isSupporter: Bool = false
var body: some Scene {
appScene
otherScenes
}
func setNewClientsInEnv(client: Client) {
currentAccount.setClient(client: client)
currentInstance.setClient(client: client)
userPreferences.setClient(client: client)
Task {
await currentInstance.fetchCurrentInstance()
watcher.setClient(client: client, instanceStreamingURL: currentInstance.instance?.urls?.streamingApi)
watcher.watch(streams: [.user, .direct])
}
}
func handleScenePhase(scenePhase: ScenePhase) {
switch scenePhase {
case .background:
watcher.stopWatching()
case .active:
watcher.watch(streams: [.user, .direct])
UNUserNotificationCenter.current().setBadgeCount(0)
userPreferences.reloadNotificationsCount(tokens: appAccountsManager.availableAccounts.compactMap(\.oauthToken))
Task {
await userPreferences.refreshServerPreferences()
}
default:
break
}
}
func setupRevenueCat() {
Purchases.logLevel = .error
Purchases.configure(withAPIKey: "appl_JXmiRckOzXXTsHKitQiicXCvMQi")
Purchases.shared.getCustomerInfo { info, _ in
if info?.entitlements["Supporter"]?.isActive == true {
isSupporter = true
}
}
}
func refreshPushSubs() {
PushNotificationsService.shared.requestPushNotifications()
}
}
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_: UIApplication,
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool
{
try? AVAudioSession.sharedInstance().setCategory(.ambient, options: .mixWithOthers)
try? AVAudioSession.sharedInstance().setActive(true)
PushNotificationsService.shared.setAccounts(accounts: AppAccountsManager.shared.pushAccounts)
return true
}
func application(_: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
{
PushNotificationsService.shared.pushToken = deviceToken
Task {
PushNotificationsService.shared.setAccounts(accounts: AppAccountsManager.shared.pushAccounts)
await PushNotificationsService.shared.updateSubscriptions(forceCreate: false)
}
}
func application(_: UIApplication, didFailToRegisterForRemoteNotificationsWithError _: Error) {}
func application(_: UIApplication, didReceiveRemoteNotification _: [AnyHashable: Any]) async -> UIBackgroundFetchResult {
UserPreferences.shared.reloadNotificationsCount(tokens: AppAccountsManager.shared.availableAccounts.compactMap(\.oauthToken))
return .noData
}
func application(_: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options _: UIScene.ConnectionOptions) -> UISceneConfiguration {
let configuration = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role)
if connectingSceneSession.role == .windowApplication {
configuration.delegateClass = SceneDelegate.self
}
return configuration
}
override func buildMenu(with builder: UIMenuBuilder) {
super.buildMenu(with: builder)
builder.remove(menu: .document)
builder.remove(menu: .toolbar)
builder.remove(menu: .sidebar)
}
}

View file

@ -1,92 +0,0 @@
import QuickLook
import SwiftUI
import UIKit
extension URL: Identifiable {
public var id: String {
absoluteString
}
}
struct QuickLookPreview: UIViewControllerRepresentable {
let selectedURL: URL
let urls: [URL]
func makeUIViewController(context _: Context) -> UIViewController {
return AppQLPreviewController(selectedURL: selectedURL, urls: urls)
}
func updateUIViewController(
_: UIViewController, context _: Context
) {}
}
class AppQLPreviewController: UIViewController {
let selectedURL: URL
let urls: [URL]
var qlController: QLPreviewController?
init(selectedURL: URL, urls: [URL]) {
self.selectedURL = selectedURL
self.urls = urls
super.init(nibName: nil, bundle: nil)
}
@available(*, unavailable)
required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if qlController == nil {
qlController = QLPreviewController()
qlController?.dataSource = self
qlController?.delegate = self
qlController?.currentPreviewItemIndex = urls.firstIndex(of: selectedURL) ?? 0
present(qlController!, animated: true)
}
}
}
extension AppQLPreviewController: QLPreviewControllerDataSource {
func numberOfPreviewItems(in _: QLPreviewController) -> Int {
return urls.count
}
func previewController(_: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
return urls[index] as QLPreviewItem
}
}
extension AppQLPreviewController: QLPreviewControllerDelegate {
func previewController(_: QLPreviewController, editingModeFor _: QLPreviewItem) -> QLPreviewItemEditingMode {
.createCopy
}
func previewControllerWillDismiss(_: QLPreviewController) {
dismiss(animated: true)
}
}
struct TransparentBackground: UIViewControllerRepresentable {
public func makeUIViewController(context _: Context) -> UIViewController {
return TransparentController()
}
public func updateUIViewController(_: UIViewController, context _: Context) {}
class TransparentController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .clear
}
override func willMove(toParent parent: UIViewController?) {
super.willMove(toParent: parent)
parent?.view?.backgroundColor = .clear
parent?.modalPresentationStyle = .overCurrentContext
}
}
}

View file

@ -2,14 +2,14 @@ import DesignSystem
import Env
import Models
import Network
import Status
import StatusKit
import SwiftUI
public struct ReportView: View {
@Environment(\.dismiss) private var dismiss
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var client: Client
@Environment(Theme.self) private var theme
@Environment(Client.self) private var client
let status: Status
@State private var commentText: String = ""
@ -35,42 +35,38 @@ public struct ReportView: View {
}
.navigationTitle("report.title")
.navigationBarTitleDisplayMode(.inline)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.scrollDismissesKeyboard(.immediately)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
isSendingReport = true
Task {
do {
let _: ReportSent =
try await client.post(endpoint: Statuses.report(accountId: status.account.id,
statusId: status.id,
comment: commentText))
dismiss()
isSendingReport = false
} catch {
isSendingReport = false
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.scrollDismissesKeyboard(.immediately)
#endif
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
isSendingReport = true
Task {
do {
let _: ReportSent =
try await client.post(endpoint: Statuses.report(accountId: status.account.id,
statusId: status.id,
comment: commentText))
dismiss()
isSendingReport = false
} catch {
isSendingReport = false
}
}
} label: {
if isSendingReport {
ProgressView()
} else {
Text("report.action.send")
}
}
} label: {
if isSendingReport {
ProgressView()
} else {
Text("report.action.send")
}
}
}
ToolbarItem(placement: .navigationBarLeading) {
Button {
dismiss()
} label: {
Text("action.cancel")
}
CancelToolbarItem()
}
}
}
}
}

View file

@ -1,33 +1,41 @@
import DesignSystem
import Env
import Models
import Observation
import SafariServices
import SwiftUI
extension View {
func withSafariRouter() -> some View {
@MainActor func withSafariRouter() -> some View {
modifier(SafariRouter())
}
}
@MainActor
private struct SafariRouter: ViewModifier {
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var preferences: UserPreferences
@EnvironmentObject private var routerPath: RouterPath
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
@Environment(Theme.self) private var theme
@Environment(UserPreferences.self) private var preferences
@Environment(RouterPath.self) private var routerPath
@State private var presentedURL: URL?
#if !os(visionOS)
@State private var safariManager = InAppSafariManager()
#endif
func body(content: Content) -> some View {
content
.environment(\.openURL, OpenURLAction { url in
// Open internal URL.
routerPath.handle(url: url)
guard !isSecondaryColumn else { return .discarded }
return routerPath.handle(url: url)
})
.onOpenURL(perform: { url in
.onOpenURL { url in
// Open external URL (from icecubesapp://)
let urlString = url.absoluteString.replacingOccurrences(of: "icecubesapp://", with: "https://")
guard !isSecondaryColumn else { return }
let urlString = url.absoluteString.replacingOccurrences(of: AppInfo.scheme, with: "https://")
guard let url = URL(string: urlString), url.host != nil else { return }
_ = routerPath.handle(url: url)
})
_ = routerPath.handleDeepLink(url: url)
}
.onAppear {
routerPath.urlHandler = { url in
if url.absoluteString.contains("@twitter.com"), url.absoluteString.hasPrefix("mailto:") {
@ -40,36 +48,123 @@ private struct SafariRouter: ViewModifier {
return .handled
}
}
guard preferences.preferredBrowser == .inAppSafari, !ProcessInfo.processInfo.isiOSAppOnMac else { return .systemAction }
// SFSafariViewController only supports initial URLs with http:// or https:// schemes.
guard let scheme = url.scheme, ["https", "http"].contains(scheme.lowercased()) else {
#if !targetEnvironment(macCatalyst)
guard preferences.preferredBrowser == .inAppSafari else { return .systemAction }
// SFSafariViewController only supports initial URLs with http:// or https:// schemes.
guard let scheme = url.scheme, ["https", "http"].contains(scheme.lowercased()) else {
return .systemAction
}
#if os(visionOS)
return .systemAction
#else
return safariManager.open(url)
#endif
#else
return .systemAction
}
presentedURL = url
return .handled
#endif
}
}
.fullScreenCover(item: $presentedURL, content: { url in
SafariView(url: url, inAppBrowserReaderView: preferences.inAppBrowserReaderView)
.edgesIgnoringSafeArea(.all)
})
#if !os(visionOS)
.background {
WindowReader { window in
safariManager.windowScene = window.windowScene
}
}
#endif
}
}
struct SafariView: UIViewControllerRepresentable {
let url: URL
let inAppBrowserReaderView: Bool
#if !os(visionOS)
@MainActor
@Observable private class InAppSafariManager: NSObject, SFSafariViewControllerDelegate {
var windowScene: UIWindowScene?
let viewController: UIViewController = .init()
var window: UIWindow?
@MainActor
func open(_ url: URL) -> OpenURLAction.Result {
guard let windowScene else { return .systemAction }
window = setupWindow(windowScene: windowScene)
func makeUIViewController(context _: UIViewControllerRepresentableContext<SafariView>) -> SFSafariViewController {
let configuration = SFSafariViewController.Configuration()
configuration.entersReaderIfAvailable = inAppBrowserReaderView
configuration.entersReaderIfAvailable = UserPreferences.shared.inAppBrowserReaderView
let safari = SFSafariViewController(url: url, configuration: configuration)
safari.preferredBarTintColor = UIColor(Theme.shared.primaryBackgroundColor)
safari.preferredControlTintColor = UIColor(Theme.shared.tintColor)
return safari
safari.delegate = self
DispatchQueue.main.async { [weak self] in
self?.viewController.present(safari, animated: true)
}
return .handled
}
func updateUIViewController(_: SFSafariViewController, context _: UIViewControllerRepresentableContext<SafariView>) {}
func setupWindow(windowScene: UIWindowScene) -> UIWindow {
let window = window ?? UIWindow(windowScene: windowScene)
window.rootViewController = viewController
window.makeKeyAndVisible()
switch Theme.shared.selectedScheme {
case .dark:
window.overrideUserInterfaceStyle = .dark
case .light:
window.overrideUserInterfaceStyle = .light
}
self.window = window
return window
}
nonisolated func safariViewControllerDidFinish(_: SFSafariViewController) {
Task { @MainActor in
window?.resignKey()
window?.isHidden = false
window = nil
}
}
}
#endif
private struct WindowReader: UIViewRepresentable {
var onUpdate: (UIWindow) -> Void
func makeUIView(context _: Context) -> InjectView {
InjectView(onUpdate: onUpdate)
}
func updateUIView(_: InjectView, context _: Context) {}
class InjectView: UIView {
var onUpdate: (UIWindow) -> Void
init(onUpdate: @escaping (UIWindow) -> Void) {
self.onUpdate = onUpdate
super.init(frame: .zero)
isHidden = true
isUserInteractionEnabled = false
}
@available(*, unavailable)
required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func willMove(toWindow newWindow: UIWindow?) {
super.willMove(toWindow: newWindow)
if let window = newWindow {
onUpdate(window)
} else {
DispatchQueue.main.async { [weak self] in
if let window = self?.window {
self?.onUpdate(window)
}
}
}
}
}
}

View file

@ -4,69 +4,93 @@ import DesignSystem
import Env
import Models
import SwiftUI
import SwiftUIIntrospect
@MainActor
struct SideBarView<Content: View>: View {
@EnvironmentObject private var appAccounts: AppAccountsManager
@EnvironmentObject private var currentAccount: CurrentAccount
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var watcher: StreamWatcher
@EnvironmentObject private var userPreferences: UserPreferences
@Environment(\.openWindow) private var openWindow
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
@Environment(AppAccountsManager.self) private var appAccounts
@Environment(CurrentAccount.self) private var currentAccount
@Environment(Theme.self) private var theme
@Environment(StreamWatcher.self) private var watcher
@Environment(UserPreferences.self) private var userPreferences
@Environment(RouterPath.self) private var routerPath
@Binding var selectedTab: Tab
@Binding var popToRootTab: Tab
var tabs: [Tab]
@ObservedObject var routerPath = RouterPath()
@ViewBuilder var content: () -> Content
@State private var sidebarTabs = SidebarTabs.shared
private func badgeFor(tab: Tab) -> Int {
if tab == .notifications && selectedTab != tab,
let token = appAccounts.currentAccount.oauthToken {
return watcher.unreadNotificationsCount + userPreferences.getNotificationsCount(for: token)
if tab == .notifications, selectedTab != tab,
let token = appAccounts.currentAccount.oauthToken
{
return watcher.unreadNotificationsCount + (userPreferences.notificationsCount[token] ?? 0)
}
return 0
}
private func makeIconForTab(tab: Tab) -> some View {
ZStack(alignment: .topTrailing) {
SideBarIcon(systemIconName: tab.iconName,
isSelected: tab == selectedTab)
if let badge = badgeFor(tab: tab), badge > 0 {
makeBadgeView(count: badge)
HStack {
ZStack(alignment: .topTrailing) {
SideBarIcon(systemIconName: tab.iconName,
isSelected: tab == selectedTab)
let badge = badgeFor(tab: tab)
if badge > 0 {
makeBadgeView(count: badge)
}
}
if userPreferences.isSidebarExpanded {
Text(tab.title)
.font(.headline)
.foregroundColor(tab == selectedTab ? theme.tintColor : theme.labelColor)
.frame(maxWidth: .infinity, alignment: .leading)
}
}
.contentShape(Rectangle())
.frame(width: .sidebarWidth, height: 50)
.frame(width: (userPreferences.isSidebarExpanded ? .sidebarWidthExpanded : .sidebarWidth) - 24, height: 50)
.background(tab == selectedTab ? theme.secondaryBackgroundColor : .clear,
in: RoundedRectangle(cornerRadius: 8))
}
private func makeBadgeView(count: Int) -> some View {
ZStack {
Circle()
.fill(.red)
Text(String(count))
Text(count > 99 ? "99+" : String(count))
.foregroundColor(.white)
.font(.caption2)
}
.frame(width: 20, height: 20)
.offset(x: 10, y: -10)
.frame(width: 24, height: 24)
.offset(x: 14, y: -14)
}
private var postButton: some View {
Button {
routerPath.presentedSheet = .newStatusEditor(visibility: userPreferences.postVisibility)
#if targetEnvironment(macCatalyst) || os(visionOS)
openWindow(value: WindowDestinationEditor.newStatusEditor(visibility: userPreferences.postVisibility))
#else
routerPath.presentedSheet = .newStatusEditor(visibility: userPreferences.postVisibility)
#endif
} label: {
Image(systemName: "square.and.pencil")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 20, height: 30)
.offset(x: 2, y: -2)
}
.buttonStyle(.borderedProminent)
.keyboardShortcut("n", modifiers: .command)
.help(Tab.post.title)
}
private func makeAccountButton(account: AppAccount, showBadge: Bool) -> some View {
Button {
if account.id == appAccounts.currentAccount.id {
selectedTab = .profile
SoundEffectManager.shared.playSound(.tabSelection)
} else {
var transation = Transaction()
transation.disablesAnimations = true
@ -76,77 +100,121 @@ struct SideBarView<Content: View>: View {
}
} label: {
ZStack(alignment: .topTrailing) {
AppAccountView(viewModel: .init(appAccount: account, isCompact: true))
if showBadge,
let token = account.oauthToken,
userPreferences.getNotificationsCount(for: token) > 0 {
makeBadgeView(count: userPreferences.getNotificationsCount(for: token))
if userPreferences.isSidebarExpanded {
AppAccountView(viewModel: .init(appAccount: account,
isCompact: false,
isInSettings: false),
isParentPresented: .constant(false))
} else {
AppAccountView(viewModel: .init(appAccount: account,
isCompact: true,
isInSettings: false),
isParentPresented: .constant(false))
}
if !userPreferences.isSidebarExpanded,
showBadge,
let token = account.oauthToken,
let notificationsCount = userPreferences.notificationsCount[token],
notificationsCount > 0
{
makeBadgeView(count: notificationsCount)
}
}
.padding(.leading, userPreferences.isSidebarExpanded ? 16 : 0)
}
.frame(width: .sidebarWidth, height: 50)
.help(accountButtonTitle(accountName: account.accountName))
.frame(width: userPreferences.isSidebarExpanded ? .sidebarWidthExpanded : .sidebarWidth, height: 50)
.padding(.vertical, 8)
.background(selectedTab == .profile && account.id == appAccounts.currentAccount.id ?
theme.secondaryBackgroundColor : .clear)
}
private func accountButtonTitle(accountName: String?) -> LocalizedStringKey {
if let accountName {
"tab.profile-account-\(accountName)"
} else {
Tab.profile.title
}
}
private var tabsView: some View {
ForEach(tabs) { tab in
Button {
if tab == selectedTab {
popToRootTab = .other
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
popToRootTab = tab
if tab != .profile && sidebarTabs.isEnabled(tab) {
Button {
// ensure keyboard is always dismissed when selecting a tab
hideKeyboard()
if tab == selectedTab {
popToRootTab = .other
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
popToRootTab = tab
}
}
}
selectedTab = tab
if tab == .notifications {
if let token = appAccounts.currentAccount.oauthToken {
userPreferences.setNotification(count: 0, token: token)
selectedTab = tab
SoundEffectManager.shared.playSound(.tabSelection)
if tab == .notifications {
if let token = appAccounts.currentAccount.oauthToken {
userPreferences.notificationsCount[token] = 0
}
watcher.unreadNotificationsCount = 0
}
watcher.unreadNotificationsCount = 0
} label: {
makeIconForTab(tab: tab)
}
} label: {
makeIconForTab(tab: tab)
.help(tab.title)
}
.background(tab == selectedTab ? theme.secondaryBackgroundColor : .clear)
}
}
var body: some View {
@Bindable var routerPath = routerPath
HStack(spacing: 0) {
ScrollView {
VStack(alignment: .center) {
if appAccounts.availableAccounts.isEmpty {
tabsView
} else {
ForEach(appAccounts.availableAccounts) { account in
makeAccountButton(account: account,
showBadge: account.id != appAccounts.currentAccount.id)
if account.id == appAccounts.currentAccount.id {
tabsView
if horizontalSizeClass == .regular {
ScrollView {
VStack(alignment: .center) {
if appAccounts.availableAccounts.isEmpty {
tabsView
} else {
ForEach(appAccounts.availableAccounts) { account in
makeAccountButton(account: account,
showBadge: account.id != appAccounts.currentAccount.id)
if account.id == appAccounts.currentAccount.id {
tabsView
}
}
}
}
postButton
.padding(.top, 12)
Spacer()
}
.frame(width: userPreferences.isSidebarExpanded ? .sidebarWidthExpanded : .sidebarWidth)
.scrollContentBackground(.hidden)
.background(.thinMaterial)
.safeAreaInset(edge: .bottom, content: {
HStack(spacing: 16) {
postButton
.padding(.vertical, 24)
.padding(.leading, userPreferences.isSidebarExpanded ? 18 : 0)
if userPreferences.isSidebarExpanded {
Text("menu.new-post")
.font(.subheadline)
.foregroundColor(theme.labelColor)
.frame(maxWidth: .infinity, alignment: .leading)
}
}
.frame(width: userPreferences.isSidebarExpanded ? .sidebarWidthExpanded : .sidebarWidth)
.background(.thinMaterial)
})
Divider().edgesIgnoringSafeArea(.all)
}
.frame(width: .sidebarWidth)
.scrollContentBackground(.hidden)
.background(.thinMaterial)
Divider()
.edgesIgnoringSafeArea(.top)
content()
}
.background(.thinMaterial)
.edgesIgnoringSafeArea(.bottom)
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
}
}
private struct SideBarIcon: View {
@EnvironmentObject private var theme: Theme
@Environment(Theme.self) private var theme
let systemIconName: String
let isSelected: Bool
@ -158,11 +226,20 @@ private struct SideBarIcon: View {
.font(.title2)
.fontWeight(.medium)
.foregroundColor(isSelected ? theme.tintColor : theme.labelColor)
.symbolVariant(isSelected ? .fill : .none)
.scaleEffect(isHovered ? 0.8 : 1.0)
.onHover { isHovered in
withAnimation(.interpolatingSpring(stiffness: 300, damping: 15)) {
self.isHovered = isHovered
}
}
.frame(width: 50, height: 40)
}
}
extension View {
@MainActor func hideKeyboard() {
let resign = #selector(UIResponder.resignFirstResponder)
UIApplication.shared.sendAction(resign, to: nil, from: nil, for: nil)
}
}

View file

@ -4,41 +4,40 @@ import Env
import Explore
import Models
import Network
import Shimmer
import SwiftUI
@MainActor
struct ExploreTab: View {
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var preferences: UserPreferences
@EnvironmentObject private var currentAccount: CurrentAccount
@EnvironmentObject private var client: Client
@StateObject private var routerPath = RouterPath()
@Environment(Theme.self) private var theme
@Environment(UserPreferences.self) private var preferences
@Environment(CurrentAccount.self) private var currentAccount
@Environment(Client.self) private var client
@State private var routerPath = RouterPath()
@State private var scrollToTopSignal: Int = 0
@Binding var popToRootTab: Tab
var body: some View {
NavigationStack(path: $routerPath.path) {
ExploreView()
ExploreView(scrollToTopSignal: $scrollToTopSignal)
.withAppRouter()
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
.toolbar {
statusEditorToolbarItem(routerPath: routerPath,
visibility: preferences.postVisibility)
if UIDevice.current.userInterfaceIdiom != .pad {
ToolbarItem(placement: .navigationBarLeading) {
AppAccountsSelectorView(routerPath: routerPath)
}
}
ToolbarTab(routerPath: $routerPath)
}
}
.withSafariRouter()
.environmentObject(routerPath)
.onChange(of: $popToRootTab.wrappedValue) { popToRootTab in
if popToRootTab == .explore {
routerPath.path = []
.environment(routerPath)
.onChange(of: $popToRootTab.wrappedValue) { _, newValue in
if newValue == .explore {
if routerPath.path.isEmpty {
scrollToTopSignal += 1
} else {
routerPath.path = []
}
}
}
.onChange(of: client.id) { _ in
.onChange(of: client.id) {
routerPath.path = []
}
.onAppear {

View file

@ -5,45 +5,46 @@ import DesignSystem
import Env
import Models
import Network
import Shimmer
import SwiftUI
@MainActor
struct MessagesTab: View {
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var watcher: StreamWatcher
@EnvironmentObject private var client: Client
@EnvironmentObject private var currentAccount: CurrentAccount
@EnvironmentObject private var appAccount: AppAccountsManager
@StateObject private var routerPath = RouterPath()
@Environment(Theme.self) private var theme
@Environment(StreamWatcher.self) private var watcher
@Environment(Client.self) private var client
@Environment(CurrentAccount.self) private var currentAccount
@Environment(AppAccountsManager.self) private var appAccount
@State private var routerPath = RouterPath()
@State private var scrollToTopSignal: Int = 0
@Binding var popToRootTab: Tab
var body: some View {
NavigationStack(path: $routerPath.path) {
ConversationsListView()
ConversationsListView(scrollToTopSignal: $scrollToTopSignal)
.withAppRouter()
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
.toolbar {
if UIDevice.current.userInterfaceIdiom != .pad {
ToolbarItem(placement: .navigationBarLeading) {
AppAccountsSelectorView(routerPath: routerPath)
}
}
ToolbarTab(routerPath: $routerPath)
}
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
.id(client.id)
}
.onChange(of: $popToRootTab.wrappedValue) { popToRootTab in
if popToRootTab == .messages {
routerPath.path = []
.onChange(of: $popToRootTab.wrappedValue) { _, newValue in
if newValue == .messages {
if routerPath.path.isEmpty {
scrollToTopSignal += 1
} else {
routerPath.path = []
}
}
}
.onChange(of: client.id) { _ in
.onChange(of: client.id) {
routerPath.path = []
}
.onAppear {
routerPath.client = client
}
.withSafariRouter()
.environmentObject(routerPath)
.environment(routerPath)
}
}

View file

@ -0,0 +1,24 @@
import AppAccount
import DesignSystem
import Env
import SwiftUI
@MainActor
struct NavigationSheet<Content: View>: View {
@Environment(\.dismiss) private var dismiss
var content: () -> Content
init(@ViewBuilder content: @escaping () -> Content) {
self.content = content
}
var body: some View {
NavigationStack {
content()
.toolbar {
CloseToolbarItem()
}
}
}
}

View file

@ -0,0 +1,46 @@
import AppAccount
import DesignSystem
import Env
import Network
import SwiftUI
@MainActor
struct NavigationTab<Content: View>: View {
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
@Environment(AppAccountsManager.self) private var appAccount
@Environment(CurrentAccount.self) private var currentAccount
@Environment(UserPreferences.self) private var userPreferences
@Environment(Theme.self) private var theme
@Environment(Client.self) private var client
var content: () -> Content
@State private var routerPath = RouterPath()
init(@ViewBuilder content: @escaping () -> Content) {
self.content = content
}
var body: some View {
NavigationStack(path: $routerPath.path) {
content()
.withEnvironments()
.withAppRouter()
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
.withSafariRouter()
.toolbar {
ToolbarTab(routerPath: $routerPath)
}
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
.onChange(of: client.id) {
routerPath.path = []
}
.onAppear {
routerPath.client = client
}
.withSafariRouter()
}
.environment(routerPath)
}
}

View file

@ -7,80 +7,95 @@ import Notifications
import SwiftUI
import Timeline
@MainActor
struct NotificationsTab: View {
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
@Environment(\.scenePhase) private var scenePhase
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var client: Client
@EnvironmentObject private var watcher: StreamWatcher
@EnvironmentObject private var appAccount: AppAccountsManager
@EnvironmentObject private var currentAccount: CurrentAccount
@EnvironmentObject private var userPreferences: UserPreferences
@EnvironmentObject private var pushNotificationsService: PushNotificationsService
@StateObject private var routerPath = RouterPath()
@Environment(Theme.self) private var theme
@Environment(Client.self) private var client
@Environment(StreamWatcher.self) private var watcher
@Environment(AppAccountsManager.self) private var appAccount
@Environment(CurrentAccount.self) private var currentAccount
@Environment(UserPreferences.self) private var userPreferences
@Environment(PushNotificationsService.self) private var pushNotificationsService
@State private var routerPath = RouterPath()
@State private var scrollToTopSignal: Int = 0
@Binding var selectedTab: Tab
@Binding var popToRootTab: Tab
let lockedType: Models.Notification.NotificationType?
var body: some View {
NavigationStack(path: $routerPath.path) {
NotificationsListView(lockedType: lockedType)
NotificationsListView(lockedType: lockedType, scrollToTopSignal: $scrollToTopSignal)
.withAppRouter()
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
.toolbar {
if !isSecondaryColumn {
statusEditorToolbarItem(routerPath: routerPath,
visibility: userPreferences.postVisibility)
if UIDevice.current.userInterfaceIdiom != .pad {
ToolbarItem(placement: .navigationBarLeading) {
AppAccountsSelectorView(routerPath: routerPath)
}
ToolbarItem(placement: .topBarTrailing) {
Button {
routerPath.presentedSheet = .accountPushNotficationsSettings
} label: {
Image(systemName: "bell")
}
}
ToolbarTab(routerPath: $routerPath)
}
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
.id(client.id)
}
.onAppear {
routerPath.client = client
clearNotifications()
}
.withSafariRouter()
.environmentObject(routerPath)
.onChange(of: $popToRootTab.wrappedValue) { popToRootTab in
if popToRootTab == .notifications {
routerPath.path = []
.environment(routerPath)
.onChange(of: $popToRootTab.wrappedValue) { _, newValue in
if newValue == .notifications {
if routerPath.path.isEmpty {
scrollToTopSignal += 1
} else {
routerPath.path = []
}
}
}
.onChange(of: pushNotificationsService.handledNotification) { notification in
if let notification, let type = notification.notification.supportedType {
.onChange(of: selectedTab) { _, _ in
clearNotifications()
}
.onChange(of: pushNotificationsService.handledNotification) { _, newValue in
if let newValue, let type = newValue.notification.supportedType {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
switch type {
case .follow, .follow_request:
routerPath.navigate(to: .accountDetailWithAccount(account: notification.notification.account))
routerPath.navigate(to: .accountDetailWithAccount(account: newValue.notification.account))
default:
if let status = notification.notification.status {
if let status = newValue.notification.status {
routerPath.navigate(to: .statusDetailWithStatus(status: status))
}
}
}
}
}
.onChange(of: scenePhase, perform: { scenePhase in
switch scenePhase {
.onChange(of: scenePhase) { _, newValue in
switch newValue {
case .active:
if isSecondaryColumn {
if let token = appAccount.currentAccount.oauthToken {
userPreferences.setNotification(count: 0, token: token)
}
watcher.unreadNotificationsCount = 0
}
clearNotifications()
default:
break
}
})
.onChange(of: client.id) { _ in
}
.onChange(of: client.id) {
routerPath.path = []
}
}
private func clearNotifications() {
if selectedTab == .notifications || isSecondaryColumn {
if let token = appAccount.currentAccount.oauthToken {
userPreferences.notificationsCount[token] = 0
}
watcher.unreadNotificationsCount = 0
}
}
}

View file

@ -5,42 +5,48 @@ import DesignSystem
import Env
import Models
import Network
import Shimmer
import SwiftUI
@MainActor
struct ProfileTab: View {
@EnvironmentObject private var appAccount: AppAccountsManager
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var client: Client
@EnvironmentObject private var currentAccount: CurrentAccount
@StateObject private var routerPath = RouterPath()
@Environment(AppAccountsManager.self) private var appAccount
@Environment(Theme.self) private var theme
@Environment(Client.self) private var client
@Environment(CurrentAccount.self) private var currentAccount
@State private var routerPath = RouterPath()
@State private var scrollToTopSignal: Int = 0
@Binding var popToRootTab: Tab
var body: some View {
NavigationStack(path: $routerPath.path) {
if let account = currentAccount.account {
AccountDetailView(account: account)
AccountDetailView(account: account, scrollToTopSignal: $scrollToTopSignal)
.withAppRouter()
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
.id(account.id)
} else {
AccountDetailView(account: .placeholder())
AccountDetailView(account: .placeholder(), scrollToTopSignal: $scrollToTopSignal)
.redacted(reason: .placeholder)
.allowsHitTesting(false)
}
}
.onChange(of: $popToRootTab.wrappedValue) { popToRootTab in
if popToRootTab == .profile {
routerPath.path = []
.onChange(of: $popToRootTab.wrappedValue) { _, newValue in
if newValue == .profile {
if routerPath.path.isEmpty {
scrollToTopSignal += 1
} else {
routerPath.path = []
}
}
}
.onChange(of: client.id) { _ in
.onChange(of: client.id) {
routerPath.path = []
}
.onAppear {
routerPath.client = client
}
.withSafariRouter()
.environmentObject(routerPath)
.environment(routerPath)
}
}

View file

@ -1,10 +1,18 @@
import Account
import DesignSystem
import Env
import Models
import Network
import SwiftUI
@MainActor
struct AboutView: View {
@EnvironmentObject private var routerPath: RouterPath
@EnvironmentObject private var theme: Theme
@Environment(RouterPath.self) private var routerPath
@Environment(Theme.self) private var theme
@Environment(Client.self) private var client
@State private var dimillianAccount: AccountsListRowViewModel?
@State private var iceCubesAccount: AccountsListRowViewModel?
let versionNumber: String
@ -17,45 +25,47 @@ struct AboutView: View {
}
var body: some View {
ScrollView {
VStack(alignment: .leading) {
Divider()
HStack {
Spacer()
Image("icon0")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image("icon14")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image("icon17")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image("icon23")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Spacer()
List {
Section {
#if !targetEnvironment(macCatalyst) && !os(visionOS)
HStack {
Spacer()
Image(uiImage: .init(named: "AppIconAlternate0")!)
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image(uiImage: .init(named: "AppIconAlternate4")!)
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image(uiImage: .init(named: "AppIconAlternate17")!)
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image(uiImage: .init(named: "AppIconAlternate23")!)
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Spacer()
}
#endif
Link(destination: URL(string: "https://github.com/Dimillian/IceCubesApp/blob/main/PRIVACY.MD")!) {
Label("settings.support.privacy-policy", systemImage: "lock")
}
.padding(.top, 10)
HStack {
Spacer()
Text("\(versionNumber)©2023 Thomas Ricouard")
.font(.scaledFootnote)
.foregroundColor(.gray)
.fontWeight(.semibold)
.padding(.bottom, 10)
Spacer()
Link(destination: URL(string: "https://github.com/Dimillian/IceCubesApp/blob/main/TERMS.MD")!) {
Label("settings.support.terms-of-use", systemImage: "checkmark.shield")
}
Divider()
Text("settings.about.built-with")
.padding(.horizontal, 25)
.padding(.bottom, 10)
.font(.scaledSubheadline)
.foregroundColor(.gray)
} footer: {
Text("\(versionNumber)© 2024 Thomas Ricouard")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
followAccountsSection
Section {
Text("""
[EmojiText](https://github.com/divadretlaw/EmojiText)
@ -65,7 +75,7 @@ struct AboutView: View {
[LRUCache](https://github.com/nicklockwood/LRUCache)
[Boutique](https://github.com/mergesort/Boutique)
[Bodega](https://github.com/mergesort/Bodega)
[Nuke](https://github.com/kean/Nuke)
@ -74,27 +84,86 @@ struct AboutView: View {
[Atkinson Hyperlegible](https://github.com/googlefonts/atkinson-hyperlegible)
[OpenDyslexic](http://opendyslexic.org)
[SwiftUI-Introspect](https://github.com/siteline/SwiftUI-Introspect)
[RevenueCat](https://github.com/RevenueCat/purchases-ios)
[SFSafeSymbols](https://github.com/SFSafeSymbols/SFSafeSymbols)
""")
.padding(.horizontal, 25)
.multilineTextAlignment(.leading)
.font(.scaledSubheadline)
.foregroundColor(.gray)
.foregroundStyle(.secondary)
} header: {
Text("settings.about.built-with")
.textCase(nil)
}
Divider()
Spacer()
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.navigationTitle(Text("settings.about.title"))
.navigationBarTitleDisplayMode(.large)
.environment(\.openURL, OpenURLAction { url in
routerPath.handle(url: url)
})
.task {
await fetchAccounts()
}
.listStyle(.insetGrouped)
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
.navigationTitle(Text("settings.about.title"))
.navigationBarTitleDisplayMode(.large)
.environment(\.openURL, OpenURLAction { url in
routerPath.handle(url: url)
})
}
@ViewBuilder
private var followAccountsSection: some View {
if let iceCubesAccount, let dimillianAccount {
Section {
AccountsListRow(viewModel: iceCubesAccount)
AccountsListRow(viewModel: dimillianAccount)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
} else {
Section {
ProgressView()
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
}
private func fetchAccounts() async {
await withThrowingTaskGroup(of: Void.self) { group in
group.addTask {
let viewModel = try await fetchAccountViewModel(account: "dimillian@mastodon.social")
await MainActor.run {
dimillianAccount = viewModel
}
}
group.addTask {
let viewModel = try await fetchAccountViewModel(account: "icecubesapp@mastodon.online")
await MainActor.run {
iceCubesAccount = viewModel
}
}
}
}
private func fetchAccountViewModel(account: String) async throws -> AccountsListRowViewModel {
let dimillianAccount: Account = try await client.get(endpoint: Accounts.lookup(name: account))
let rel: [Relationship] = try await client.get(endpoint: Accounts.relationships(ids: [dimillianAccount.id]))
return .init(account: dimillianAccount, relationShip: rel.first)
}
}
struct AboutView_Previews: PreviewProvider {
static var previews: some View {
AboutView()
.environment(Theme.shared)
}
}

View file

@ -9,16 +9,18 @@ import Timeline
struct AccountSettingsView: View {
@Environment(\.dismiss) private var dismiss
@Environment(\.openURL) private var openURL
@EnvironmentObject private var pushNotifications: PushNotificationsService
@EnvironmentObject private var currentAccount: CurrentAccount
@EnvironmentObject private var currentInstance: CurrentInstance
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var appAccountsManager: AppAccountsManager
@Environment(PushNotificationsService.self) private var pushNotifications
@Environment(CurrentAccount.self) private var currentAccount
@Environment(CurrentInstance.self) private var currentInstance
@Environment(Theme.self) private var theme
@Environment(AppAccountsManager.self) private var appAccountsManager
@Environment(Client.self) private var client
@Environment(RouterPath.self) private var routerPath
@State private var isEditingAccount: Bool = false
@State private var isEditingFilters: Bool = false
@State private var cachedPostsCount: Int = 0
@State private var timelineCache = TimelineCache()
let account: Account
let appAccount: AppAccount
@ -27,7 +29,7 @@ struct AccountSettingsView: View {
Form {
Section {
Button {
isEditingAccount = true
routerPath.presentedSheet = .accountEditInfo
} label: {
Label("account.action.edit-info", systemImage: "pencil")
.frame(maxWidth: .infinity, alignment: .leading)
@ -37,7 +39,7 @@ struct AccountSettingsView: View {
if currentInstance.isFiltersSupported {
Button {
isEditingFilters = true
routerPath.presentedSheet = .accountFiltersList
} label: {
Label("account.action.edit-filters", systemImage: "line.3.horizontal.decrease.circle")
.frame(maxWidth: .infinity, alignment: .leading)
@ -57,19 +59,28 @@ struct AccountSettingsView: View {
Label("settings.account.cached-posts-\(String(cachedPostsCount))", systemImage: "internaldrive")
Button("settings.account.action.delete-cache", role: .destructive) {
Task {
await TimelineCache.shared.clearCache(for: appAccountsManager.currentClient.id)
cachedPostsCount = await TimelineCache.shared.cachedPostsCount(for: appAccountsManager.currentClient.id)
await timelineCache.clearCache(for: appAccountsManager.currentClient.id)
cachedPostsCount = await timelineCache.cachedPostsCount(for: appAccountsManager.currentClient.id)
}
}
}
.listRowBackground(theme.primaryBackgroundColor)
Section {
Button {
openURL(URL(string: "https://\(client.server)/settings/profile")!)
} label: {
Text("account.action.more")
}
}
.listRowBackground(theme.primaryBackgroundColor)
Section {
Button(role: .destructive) {
if let token = appAccount.oauthToken {
Task {
let client = Client(server: appAccount.server, oauthToken: token)
await TimelineCache.shared.clearCache(for: client.id)
await timelineCache.clearCache(for: client.id)
if let sub = pushNotifications.subscriptions.first(where: { $0.account.token == token }) {
await sub.deleteSubscription()
}
@ -84,26 +95,22 @@ struct AccountSettingsView: View {
}
.listRowBackground(theme.primaryBackgroundColor)
}
.sheet(isPresented: $isEditingAccount, content: {
EditAccountView()
})
.sheet(isPresented: $isEditingFilters, content: {
FiltersListView()
})
.toolbar {
ToolbarItem(placement: .principal) {
HStack {
AvatarView(url: account.avatar, size: .embed)
AvatarView(account.avatar, config: .embed)
Text(account.safeDisplayName)
.font(.headline)
}
}
}
.task {
cachedPostsCount = await TimelineCache.shared.cachedPostsCount(for: appAccountsManager.currentClient.id)
cachedPostsCount = await timelineCache.cachedPostsCount(for: appAccountsManager.currentClient.id)
}
.navigationTitle(account.safeDisplayName)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
}
}

View file

@ -6,18 +6,20 @@ import Models
import Network
import NukeUI
import SafariServices
import Shimmer
import SwiftUI
@MainActor
struct AddAccountView: View {
@Environment(\.dismiss) private var dismiss
@Environment(\.scenePhase) private var scenePhase
@Environment(\.openURL) private var openURL
@Environment(\.webAuthenticationSession) private var webAuthenticationSession
@EnvironmentObject private var appAccountsManager: AppAccountsManager
@EnvironmentObject private var currentAccount: CurrentAccount
@EnvironmentObject private var currentInstance: CurrentInstance
@EnvironmentObject private var pushNotifications: PushNotificationsService
@EnvironmentObject private var theme: Theme
@Environment(AppAccountsManager.self) private var appAccountsManager
@Environment(CurrentAccount.self) private var currentAccount
@Environment(CurrentInstance.self) private var currentInstance
@Environment(PushNotificationsService.self) private var pushNotifications
@Environment(Theme.self) private var theme
@State private var instanceName: String = ""
@State private var instance: Instance?
@ -25,22 +27,45 @@ struct AddAccountView: View {
@State private var signInClient: Client?
@State private var instances: [InstanceSocial] = []
@State private var instanceFetchError: LocalizedStringKey?
@State private var oauthURL: URL?
@State private var instanceSocialClient = InstanceSocialClient()
@State private var searchingTask = Task<Void, Never> {}
@State private var getInstanceDetailTask = Task<Void, Never> {}
private let instanceNamePublisher = PassthroughSubject<String, Never>()
private var sanitizedName: String {
var name = instanceName
.replacingOccurrences(of: "http://", with: "")
.replacingOccurrences(of: "https://", with: "")
if name.contains("@") {
let parts = name.components(separatedBy: "@")
name = parts[parts.count - 1] // [@]username@server.address.com
}
return name
}
@FocusState private var isInstanceURLFieldFocused: Bool
private func cleanServerStr(_ server: String) -> String {
server.replacingOccurrences(of: " ", with: "")
}
var body: some View {
NavigationStack {
Form {
TextField("instance.url", text: $instanceName)
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
.keyboardType(.URL)
.textContentType(.URL)
.textInputAutocapitalization(.never)
.autocorrectionDisabled()
.focused($isInstanceURLFieldFocused)
.onChange(of: instanceName) { _, _ in
instanceName = cleanServerStr(instanceName)
}
if let instanceFetchError {
Text(instanceFetchError)
}
@ -56,77 +81,76 @@ struct AddAccountView: View {
.formStyle(.grouped)
.navigationTitle("account.add.navigation-title")
.navigationBarTitleDisplayMode(.inline)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.scrollDismissesKeyboard(.immediately)
.toolbar {
if !appAccountsManager.availableAccounts.isEmpty {
ToolbarItem(placement: .navigationBarLeading) {
Button("action.cancel", action: { dismiss() })
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.scrollDismissesKeyboard(.immediately)
#endif
.toolbar {
if !appAccountsManager.availableAccounts.isEmpty {
CancelToolbarItem()
}
}
}
.onAppear {
isInstanceURLFieldFocused = true
let client = InstanceSocialClient()
Task {
let instances = await client.fetchInstances()
withAnimation {
self.instances = instances
}
}
isSigninIn = false
}
.onChange(of: instanceName) { newValue in
instanceNamePublisher.send(newValue)
}
.onReceive(instanceNamePublisher.debounce(for: .milliseconds(500), scheduler: DispatchQueue.main)) { newValue in
let newValue = newValue
.replacingOccurrences(of: "http://", with: "")
.replacingOccurrences(of: "https://", with: "")
let client = Client(server: newValue)
Task {
do {
// bare bones preflight for domain validity
if client.server.contains(".") && client.server.last != "." {
let instance: Instance = try await client.get(endpoint: Instances.instance)
withAnimation {
self.instance = instance
}
instanceFetchError = nil
} else {
instance = nil
instanceFetchError = nil
.onAppear {
isInstanceURLFieldFocused = true
Task {
let instances = await instanceSocialClient.fetchInstances(keyword: instanceName)
withAnimation {
self.instances = instances
}
}
isSigninIn = false
}
.onChange(of: instanceName) {
searchingTask.cancel()
searchingTask = Task {
try? await Task.sleep(for: .seconds(0.1))
guard !Task.isCancelled else { return }
let instances = await instanceSocialClient.fetchInstances(keyword: instanceName)
withAnimation {
self.instances = instances
}
}
getInstanceDetailTask.cancel()
getInstanceDetailTask = Task {
try? await Task.sleep(for: .seconds(0.1))
guard !Task.isCancelled else { return }
do {
// bare bones preflight for domain validity
let instanceDetailClient = Client(server: sanitizedName)
if
instanceDetailClient.server.contains("."),
instanceDetailClient.server.last != "."
{
let instance: Instance = try await instanceDetailClient.get(endpoint: Instances.instance)
withAnimation {
self.instance = instance
instanceName = sanitizedName // clean up the text box, principally to chop off the username if present so it's clear that you might not wind up siging in as the thing in the box
}
instanceFetchError = nil
} else {
instance = nil
instanceFetchError = nil
}
} catch _ as DecodingError {
instance = nil
instanceFetchError = "account.add.error.instance-not-supported"
} catch {
instance = nil
}
} catch _ as DecodingError {
instance = nil
instanceFetchError = "account.add.error.instance-not-supported"
} catch {
instance = nil
}
}
}
.onChange(of: scenePhase, perform: { scenePhase in
switch scenePhase {
case .active:
isSigninIn = false
default:
break
.onChange(of: scenePhase) { _, newValue in
switch newValue {
case .active:
isSigninIn = false
default:
break
}
}
})
.onOpenURL(perform: { url in
Task {
await continueSignIn(url: url)
}
})
.onChange(of: oauthURL, perform: { newValue in
if newValue == nil {
isSigninIn = false
}
})
.sheet(item: $oauthURL, content: { url in
SafariView(url: url)
})
}
}
@ -142,9 +166,9 @@ struct AddAccountView: View {
} label: {
HStack {
Spacer()
if isSigninIn || !instanceName.isEmpty && instance == nil {
if isSigninIn || !sanitizedName.isEmpty && instance == nil {
ProgressView()
.id(instanceName)
.id(sanitizedName)
.tint(theme.labelColor)
} else {
Text("account.add.sign-in")
@ -155,7 +179,9 @@ struct AddAccountView: View {
}
.buttonStyle(.borderedProminent)
}
#if !os(visionOS)
.listRowBackground(theme.tintColor)
#endif
}
private var instancesListView: some View {
@ -163,30 +189,65 @@ struct AddAccountView: View {
if instances.isEmpty {
placeholderRow
} else {
ForEach(instanceName.isEmpty ? instances : instances.filter { $0.name.contains(instanceName.lowercased()) }) { instance in
ForEach(instances) { instance in
Button {
self.instanceName = instance.name
instanceName = instance.name
} label: {
VStack(alignment: .leading, spacing: 4) {
Text(instance.name)
.font(.scaledHeadline)
.foregroundColor(.primary)
Text(instance.info?.shortDescription ?? "")
.font(.scaledBody)
.foregroundColor(.gray)
(Text("instance.list.users-\(instance.users)")
+ Text("")
+ Text("instance.list.posts-\(instance.statuses)"))
.font(.scaledFootnote)
.foregroundColor(.gray)
LazyImage(url: instance.thumbnail) { state in
if let image = state.image {
image
.resizable()
.scaledToFill()
} else {
Rectangle().fill(theme.tintColor.opacity(0.1))
}
}
.frame(height: 100)
.frame(maxWidth: .infinity)
.clipped()
VStack(alignment: .leading) {
HStack {
Text(instance.name)
.font(.scaledHeadline)
.foregroundColor(.primary)
Spacer()
(Text("instance.list.users-\(formatAsNumber(instance.users))")
+ Text("")
+ Text("instance.list.posts-\(formatAsNumber(instance.statuses))"))
.foregroundStyle(theme.tintColor)
}
.padding(.bottom, 5)
Text(instance.info?.shortDescription?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "")
.foregroundStyle(Color.secondary)
.lineLimit(10)
}
.font(.scaledFootnote)
.padding(10)
}
}
.listRowBackground(theme.primaryBackgroundColor)
#if !os(visionOS)
.background(theme.primaryBackgroundColor)
.listRowBackground(Color.clear)
.listRowInsets(EdgeInsets(top: 10, leading: 0, bottom: 10, trailing: 0))
.listRowSeparator(.hidden)
.clipShape(RoundedRectangle(cornerRadius: 4))
#endif
}
}
}
}
private func formatAsNumber(_ string: String) -> String {
(Int(string) ?? 0)
.formatted(
.number
.notation(.compactName)
.locale(.current)
)
}
private var placeholderRow: some View {
VStack(alignment: .leading, spacing: 4) {
Text("placeholder.loading.short")
@ -194,25 +255,26 @@ struct AddAccountView: View {
.foregroundColor(.primary)
Text("placeholder.loading.long")
.font(.scaledBody)
.foregroundColor(.gray)
.foregroundStyle(.secondary)
Text("placeholder.loading.short")
.font(.scaledFootnote)
.foregroundColor(.gray)
.foregroundStyle(.secondary)
}
.redacted(reason: .placeholder)
.shimmering()
.listRowBackground(theme.primaryBackgroundColor)
.allowsHitTesting(false)
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private func signIn() async {
do {
signInClient = .init(server: instanceName)
if let oauthURL = try await signInClient?.oauthURL() {
self.oauthURL = oauthURL
} else {
isSigninIn = false
}
} catch {
signInClient = .init(server: sanitizedName)
if let oauthURL = try? await signInClient?.oauthURL(),
let url = try? await webAuthenticationSession.authenticate(using: oauthURL,
callbackURLScheme: AppInfo.scheme.replacingOccurrences(of: "://", with: ""))
{
await continueSignIn(url: url)
} else {
isSigninIn = false
}
}
@ -223,7 +285,6 @@ struct AddAccountView: View {
return
}
do {
oauthURL = nil
let oauthToken = try await client.continueOauthFlow(url: url)
let client = Client(server: client.server, oauthToken: oauthToken)
let account: Account = try await client.get(endpoint: Accounts.verifyCredentials)
@ -237,18 +298,7 @@ struct AddAccountView: View {
isSigninIn = false
dismiss()
} catch {
oauthURL = nil
isSigninIn = false
}
}
}
struct SafariView: UIViewControllerRepresentable {
let url: URL
func makeUIViewController(context _: UIViewControllerRepresentableContext<SafariView>) -> SFSafariViewController {
SFSafariViewController(url: url)
}
func updateUIViewController(_: SFSafariViewController, context _: UIViewControllerRepresentableContext<SafariView>) {}
}

View file

@ -5,42 +5,65 @@ import Models
import Network
import NukeUI
import SwiftUI
import Timeline
import UserNotifications
@MainActor
struct ContentSettingsView: View {
@EnvironmentObject private var userPreferences: UserPreferences
@EnvironmentObject private var theme: Theme
@Environment(UserPreferences.self) private var userPreferences
@Environment(Theme.self) private var theme
@State private var contentFilter = TimelineContentFilter.shared
var body: some View {
@Bindable var userPreferences = userPreferences
Form {
Section("settings.content.boosts") {
Toggle(isOn: $userPreferences.suppressDupeReblogs) {
Text("settings.content.hide-repeated-boosts")
}
}.listRowBackground(theme.primaryBackgroundColor)
Section("settings.content.media") {
Toggle(isOn: $userPreferences.autoPlayVideo) {
Text("settings.other.autoplay-video")
}
Toggle(isOn: $userPreferences.muteVideo) {
Text("settings.other.mute-video")
}
Toggle(isOn: $userPreferences.showAltTextForMedia) {
Text("settings.content.media.show.alt")
}
}.listRowBackground(theme.primaryBackgroundColor)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Section("settings.content.sharing") {
Picker("settings.content.sharing.share-button-behavior", selection: $userPreferences.shareButtonBehavior) {
ForEach(PreferredShareButtonBehavior.allCases, id: \.rawValue) { option in
Text(option.title)
.tag(option)
}
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Section("settings.content.instance-settings") {
Toggle(isOn: $userPreferences.useInstanceContentSettings) {
Text("settings.content.use-instance-settings")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
.onChange(of: userPreferences.useInstanceContentSettings) { newVal in
#endif
.onChange(of: userPreferences.useInstanceContentSettings) { _, newVal in
if newVal {
userPreferences.appAutoExpandSpoilers = userPreferences.autoExpandSpoilers
userPreferences.appAutoExpandMedia = userPreferences.autoExpandMedia
userPreferences.appDefaultPostsSensitive = userPreferences.postIsSensitive
userPreferences.appDefaultPostVisibility = userPreferences.postVisibility
userPreferences.appRequireAltText = userPreferences.appRequireAltText
}
}
Section("settings.content.reading") {
Section {
Toggle(isOn: $userPreferences.appAutoExpandSpoilers) {
Text("settings.content.expand-spoilers")
}
@ -52,7 +75,18 @@ struct ContentSettingsView: View {
}
}
.disabled(userPreferences.useInstanceContentSettings)
}.listRowBackground(theme.primaryBackgroundColor)
Toggle(isOn: $userPreferences.collapseLongPosts) {
Text("settings.content.collapse-long-posts")
}
} header: {
Text("settings.content.reading")
} footer: {
Text("settings.content.collapse-long-posts-hint")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Section("settings.content.posting") {
Picker("settings.content.default-visibility", selection: $userPreferences.appDefaultPostVisibility) {
@ -62,16 +96,54 @@ struct ContentSettingsView: View {
}
.disabled(userPreferences.useInstanceContentSettings)
Picker("settings.content.default-reply-visibility", selection: $userPreferences.appDefaultReplyVisibility) {
ForEach(Visibility.allCases, id: \.rawValue) { vis in
if UserPreferences.getIntOfVisibility(vis) <=
UserPreferences.getIntOfVisibility(userPreferences.postVisibility)
{
Text(vis.title).tag(vis)
}
}
}
.onChange(of: userPreferences.postVisibility) {
userPreferences.conformReplyVisibilityConstraints()
}
Toggle(isOn: $userPreferences.appDefaultPostsSensitive) {
Text("settings.content.default-sensitive")
}
.disabled(userPreferences.useInstanceContentSettings)
}
Toggle(isOn: $userPreferences.appRequireAltText) {
Text("settings.content.require-alt-text")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Section("timeline.content-filter.title") {
Toggle(isOn: $contentFilter.showBoosts) {
Label("timeline.filter.show-boosts", image: "Rocket")
}
Toggle(isOn: $contentFilter.showReplies) {
Label("timeline.filter.show-replies", systemImage: "bubble.left.and.bubble.right")
}
Toggle(isOn: $contentFilter.showThreads) {
Label("timeline.filter.show-threads", systemImage: "bubble.left.and.text.bubble.right")
}
Toggle(isOn: $contentFilter.showQuotePosts) {
Label("timeline.filter.show-quote", systemImage: "quote.bubble")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.navigationTitle("settings.content.navigation-title")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
}
}

View file

@ -1,143 +1,273 @@
import Combine
import DesignSystem
import Env
import Models
import Network
import Status
import Observation
import StatusKit
import SwiftUI
@MainActor
@Observable class DisplaySettingsLocalValues {
var tintColor = Theme.shared.tintColor
var primaryBackgroundColor = Theme.shared.primaryBackgroundColor
var secondaryBackgroundColor = Theme.shared.secondaryBackgroundColor
var labelColor = Theme.shared.labelColor
var lineSpacing = Theme.shared.lineSpacing
var fontSizeScale = Theme.shared.fontSizeScale
}
@MainActor
struct DisplaySettingsView: View {
typealias FontState = Theme.FontState
@Environment(\.colorScheme) private var colorScheme
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var userPreferences: UserPreferences
@Environment(Theme.self) private var theme
@Environment(UserPreferences.self) private var userPreferences
@State private var localValues = DisplaySettingsLocalValues()
@State private var isFontSelectorPresented = false
private var previewStatusViewModel = StatusRowViewModel(status: Status.placeholder(forSettings: true, language: "la"),
private let previewStatusViewModel = StatusRowViewModel(status: Status.placeholder(forSettings: true, language: "la"),
client: Client(server: ""),
routerPath: RouterPath()) // translate from latin button
var body: some View {
Form {
Section("settings.display.example-toot") {
StatusRowView(viewModel: previewStatusViewModel)
.allowsHitTesting(false)
ZStack(alignment: .top) {
Form {
#if !os(visionOS)
StatusRowView(viewModel: previewStatusViewModel)
.allowsHitTesting(false)
.opacity(0)
.hidden()
themeSection
#endif
fontSection
layoutSection
platformsSection
resetSection
}
Section {
Toggle("settings.display.theme.systemColor", isOn: $theme.followSystemColorScheme)
themeSelectorButton
Group {
ColorPicker("settings.display.theme.tint", selection: $theme.tintColor)
ColorPicker("settings.display.theme.background", selection: $theme.primaryBackgroundColor)
ColorPicker("settings.display.theme.secondary-background", selection: $theme.secondaryBackgroundColor)
.navigationTitle("settings.display.navigation-title")
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
.task(id: localValues.tintColor) {
do { try await Task.sleep(for: .microseconds(500)) } catch {}
theme.tintColor = localValues.tintColor
}
.disabled(theme.followSystemColorScheme)
.opacity(theme.followSystemColorScheme ? 0.5 : 1.0)
} header: {
Text("settings.display.section.theme")
} footer: {
if theme.followSystemColorScheme {
Text("settings.display.section.theme.footer")
.task(id: localValues.primaryBackgroundColor) {
do { try await Task.sleep(for: .microseconds(500)) } catch {}
theme.primaryBackgroundColor = localValues.primaryBackgroundColor
}
.task(id: localValues.secondaryBackgroundColor) {
do { try await Task.sleep(for: .microseconds(500)) } catch {}
theme.secondaryBackgroundColor = localValues.secondaryBackgroundColor
}
.task(id: localValues.labelColor) {
do { try await Task.sleep(for: .microseconds(500)) } catch {}
theme.labelColor = localValues.labelColor
}
.task(id: localValues.lineSpacing) {
do { try await Task.sleep(for: .microseconds(500)) } catch {}
theme.lineSpacing = localValues.lineSpacing
}
.task(id: localValues.fontSizeScale) {
do { try await Task.sleep(for: .microseconds(500)) } catch {}
theme.fontSizeScale = localValues.fontSizeScale
}
#if !os(visionOS)
examplePost
#endif
}
}
private var examplePost: some View {
VStack(spacing: 0) {
StatusRowView(viewModel: previewStatusViewModel)
.allowsHitTesting(false)
.padding(.layoutPadding)
.background(theme.primaryBackgroundColor)
.cornerRadius(8)
.padding(.horizontal, .layoutPadding)
.padding(.top, .layoutPadding)
.background(theme.secondaryBackgroundColor)
Rectangle()
.fill(theme.secondaryBackgroundColor)
.frame(height: 30)
.mask(LinearGradient(gradient: Gradient(colors: [theme.secondaryBackgroundColor, .clear]),
startPoint: .top, endPoint: .bottom))
}
}
@ViewBuilder
private var themeSection: some View {
@Bindable var theme = theme
Section {
Toggle("settings.display.theme.systemColor", isOn: $theme.followSystemColorScheme)
themeSelectorButton
Group {
ColorPicker("settings.display.theme.tint", selection: $localValues.tintColor)
ColorPicker("settings.display.theme.background", selection: $localValues.primaryBackgroundColor)
ColorPicker("settings.display.theme.secondary-background", selection: $localValues.secondaryBackgroundColor)
ColorPicker("settings.display.theme.text-color", selection: $localValues.labelColor)
}
.disabled(theme.followSystemColorScheme)
.opacity(theme.followSystemColorScheme ? 0.5 : 1.0)
.onChange(of: theme.selectedSet) {
localValues.tintColor = theme.tintColor
localValues.primaryBackgroundColor = theme.primaryBackgroundColor
localValues.secondaryBackgroundColor = theme.secondaryBackgroundColor
localValues.labelColor = theme.labelColor
}
} header: {
Text("settings.display.section.theme")
} footer: {
if theme.followSystemColorScheme {
Text("settings.display.section.theme.footer")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var fontSection: some View {
Section("settings.display.section.font") {
Picker("settings.display.font", selection: .init(get: { () -> FontState in
if theme.chosenFont?.fontName == "OpenDyslexic-Regular" {
return FontState.openDyslexic
} else if theme.chosenFont?.fontName == "AtkinsonHyperlegible-Regular" {
return FontState.hyperLegible
} else if theme.chosenFont?.fontName == ".AppleSystemUIFontRounded-Regular" {
return FontState.SFRounded
}
return theme.chosenFontData != nil ? FontState.custom : FontState.system
}, set: { newValue in
switch newValue {
case .system:
theme.chosenFont = nil
case .openDyslexic:
theme.chosenFont = UIFont(name: "OpenDyslexic", size: 1)
case .hyperLegible:
theme.chosenFont = UIFont(name: "Atkinson Hyperlegible", size: 1)
case .SFRounded:
theme.chosenFont = UIFont.systemFont(ofSize: 1).rounded()
case .custom:
isFontSelectorPresented = true
}
})) {
ForEach(FontState.allCases, id: \.rawValue) { fontState in
Text(fontState.title).tag(fontState)
}
}
.listRowBackground(theme.primaryBackgroundColor)
.navigationDestination(isPresented: $isFontSelectorPresented, destination: { FontPicker() })
Section("settings.display.section.font") {
Picker("settings.display.font", selection: .init(get: { () -> FontState in
if userPreferences.chosenFont?.fontName == "OpenDyslexic-Regular" {
return FontState.openDyslexic
} else if userPreferences.chosenFont?.fontName == "AtkinsonHyperlegible-Regular" {
return FontState.hyperLegible
}
return userPreferences.chosenFontData != nil ? FontState.custom : FontState.system
}, set: { newValue in
switch newValue {
case .system:
userPreferences.chosenFont = nil
case .openDyslexic:
userPreferences.chosenFont = UIFont(name: "OpenDyslexic", size: 1)
case .hyperLegible:
userPreferences.chosenFont = UIFont(name: "Atkinson Hyperlegible", size: 1)
case .custom:
isFontSelectorPresented = true
}
})) {
ForEach(FontState.allCases, id: \.rawValue) { fontState in
Text(fontState.title).tag(fontState)
}
VStack {
Slider(value: $localValues.fontSizeScale, in: 0.5 ... 1.5, step: 0.1)
Text("settings.display.font.scaling-\(String(format: "%.1f", localValues.fontSizeScale))")
.font(.scaledBody)
}
.alignmentGuide(.listRowSeparatorLeading) { d in
d[.leading]
}
VStack {
Slider(value: $localValues.lineSpacing, in: 0.4 ... 10.0, step: 0.2)
Text("settings.display.font.line-spacing-\(String(format: "%.1f", localValues.lineSpacing))")
.font(.scaledBody)
}
.alignmentGuide(.listRowSeparatorLeading) { d in
d[.leading]
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
@ViewBuilder
private var layoutSection: some View {
@Bindable var theme = theme
@Bindable var userPreferences = userPreferences
Section("settings.display.section.display") {
Picker("settings.display.avatar.position", selection: $theme.avatarPosition) {
ForEach(Theme.AvatarPosition.allCases, id: \.rawValue) { position in
Text(position.description).tag(position)
}
.navigationDestination(isPresented: $isFontSelectorPresented, destination: { FontPicker() })
Toggle("settings.display.font.rounded", isOn: $userPreferences.useSFRoundedFont)
.disabled(userPreferences.chosenFont != nil)
}
Picker("settings.display.avatar.shape", selection: $theme.avatarShape) {
ForEach(Theme.AvatarShape.allCases, id: \.rawValue) { shape in
Text(shape.description).tag(shape)
}
}
Toggle("settings.display.full-username", isOn: $theme.displayFullUsername)
Picker("settings.display.status.action-buttons", selection: $theme.statusActionsDisplay) {
ForEach(Theme.StatusActionsDisplay.allCases, id: \.rawValue) { buttonStyle in
Text(buttonStyle.description).tag(buttonStyle)
}
}
Picker("settings.display.status.action-secondary", selection: $theme.statusActionSecondary) {
ForEach(Theme.StatusActionSecondary.allCases, id: \.rawValue) { action in
Text(action.description).tag(action)
}
}
Picker("settings.display.status.media-style", selection: $theme.statusDisplayStyle) {
ForEach(Theme.StatusDisplayStyle.allCases, id: \.rawValue) { buttonStyle in
Text(buttonStyle.description).tag(buttonStyle)
}
}
Toggle("settings.display.translate-button", isOn: $userPreferences.showTranslateButton)
Toggle("settings.display.pending-at-bottom", isOn: $userPreferences.pendingShownAtBottom)
Toggle("settings.display.pending-left", isOn: $userPreferences.pendingShownLeft)
Toggle("settings.display.show-reply-indentation", isOn: $userPreferences.showReplyIndentation)
if userPreferences.showReplyIndentation {
VStack {
Slider(value: $userPreferences.fontSizeScale, in: 0.5 ... 1.5, step: 0.1)
Text("settings.display.font.scaling-\(String(format: "%.1f", userPreferences.fontSizeScale))")
Slider(value: .init(get: {
Double(userPreferences.maxReplyIndentation)
}, set: { newVal in
userPreferences.maxReplyIndentation = UInt(newVal)
}), in: 1 ... 20, step: 1)
Text("settings.display.max-reply-indentation-\(String(userPreferences.maxReplyIndentation))")
.font(.scaledBody)
}
.alignmentGuide(.listRowSeparatorLeading) { d in
d[.leading]
}
}
.listRowBackground(theme.primaryBackgroundColor)
Section("settings.display.section.display") {
Picker("settings.display.avatar.position", selection: $theme.avatarPosition) {
ForEach(Theme.AvatarPosition.allCases, id: \.rawValue) { position in
Text(position.description).tag(position)
}
}
Picker("settings.display.avatar.shape", selection: $theme.avatarShape) {
ForEach(Theme.AvatarShape.allCases, id: \.rawValue) { shape in
Text(shape.description).tag(shape)
}
}
Picker("settings.display.status.action-buttons", selection: $theme.statusActionsDisplay) {
ForEach(Theme.StatusActionsDisplay.allCases, id: \.rawValue) { buttonStyle in
Text(buttonStyle.description).tag(buttonStyle)
}
}
Picker("settings.display.status.media-style", selection: $theme.statusDisplayStyle) {
ForEach(Theme.StatusDisplayStyle.allCases, id: \.rawValue) { buttonStyle in
Text(buttonStyle.description).tag(buttonStyle)
}
}
Toggle("settings.display.translate-button", isOn: $userPreferences.showTranslateButton)
}
.listRowBackground(theme.primaryBackgroundColor)
if UIDevice.current.userInterfaceIdiom == .phone {
Section("iPhone") {
Toggle("settings.display.show-tab-label", isOn: $userPreferences.showiPhoneTabLabel)
}
.listRowBackground(theme.primaryBackgroundColor)
}
if UIDevice.current.userInterfaceIdiom == .pad {
Section("iPad") {
Toggle("settings.display.show-ipad-column", isOn: $userPreferences.showiPadSecondaryColumn)
}
.listRowBackground(theme.primaryBackgroundColor)
}
Section {
Button {
theme.followSystemColorScheme = true
theme.selectedSet = colorScheme == .dark ? .iceCubeDark : .iceCubeLight
theme.avatarShape = .rounded
theme.avatarPosition = .top
theme.statusActionsDisplay = .full
} label: {
Text("settings.display.restore")
}
}
.listRowBackground(theme.primaryBackgroundColor)
Toggle("settings.display.show-account-popover", isOn: $userPreferences.showAccountPopover)
}
.navigationTitle("settings.display.navigation-title")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
@ViewBuilder
private var platformsSection: some View {
@Bindable var userPreferences = userPreferences
if UIDevice.current.userInterfaceIdiom == .pad {
Section("settings.display.section.platform") {
Toggle("settings.display.show-ipad-column", isOn: $userPreferences.showiPadSecondaryColumn)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
}
private var resetSection: some View {
Section {
Button {
theme.restoreDefault()
} label: {
Text("settings.display.restore")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var themeSelectorButton: some View {

View file

@ -1,24 +1,30 @@
import DesignSystem
import Env
import Models
import Status
import StatusKit
import SwiftUI
@MainActor
struct HapticSettingsView: View {
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var userPreferences: UserPreferences
@Environment(Theme.self) private var theme
@Environment(UserPreferences.self) private var userPreferences
var body: some View {
@Bindable var userPreferences = userPreferences
Form {
Section {
Toggle("settings.haptic.timeline", isOn: $userPreferences.hapticTimelineEnabled)
Toggle("settings.haptic.tab-selection", isOn: $userPreferences.hapticTabSelectionEnabled)
Toggle("settings.haptic.buttons", isOn: $userPreferences.hapticButtonPressEnabled)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.navigationTitle("settings.haptic.navigation-title")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
}
}

View file

@ -1,6 +1,7 @@
import DesignSystem
import SwiftUI
@MainActor
struct IconSelectorView: View {
enum Icon: Int, CaseIterable, Identifiable {
var id: String {
@ -8,7 +9,7 @@ struct IconSelectorView: View {
}
init(string: String) {
if string == Icon.primary.appIconName {
if string == "AppIcon" {
self = .primary
} else {
self = .init(rawValue: Int(String(string.replacing("AppIconAlternate", with: "")))!)!
@ -16,25 +17,19 @@ struct IconSelectorView: View {
}
case primary = 0
case alt1, alt2, alt3, alt4, alt5, alt6, alt7, alt8
case alt9, alt10, alt11, alt12, alt13, alt14
case alt15, alt16, alt17, alt18, alt19, alt20, alt21
case alt22, alt23, alt24, alt25
case alt26, alt27, alt28
case alt29, alt30, alt31, alt32
case alt33
case alt1, alt2, alt3, alt4, alt5, alt6, alt7, alt8, alt9, alt10, alt11, alt12, alt13, alt14, alt15
case alt16, alt17, alt18, alt19, alt20, alt21
case alt22, alt23, alt24, alt25, alt26
case alt27, alt28, alt29
case alt30, alt31, alt32, alt33, alt34, alt35, alt36
case alt37
case alt38
case alt39, alt40, alt41, alt42, alt43
case alt44, alt45
case alt46
var appIconName: String {
switch self {
case .primary:
return "AppIcon"
default:
return "AppIconAlternate\(rawValue)"
}
}
var iconName: String {
"icon\(rawValue)"
return "AppIconAlternate\(rawValue)"
}
}
@ -44,17 +39,22 @@ struct IconSelectorView: View {
let icons: [Icon]
static let items = [
IconSelector(title: "settings.app.icon.official".localized, icons: [.primary, .alt1, .alt2, .alt3, .alt4, .alt5, .alt6, .alt7, .alt8,
.alt9, .alt10, .alt11, .alt12, .alt13, .alt14,
.alt15, .alt16, .alt17, .alt18, .alt19, .alt25]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) Albert Kinng", icons: [.alt20, .alt21, .alt22, .alt23, .alt24]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) Dan van Moll", icons: [.alt26, .alt27, .alt28]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) @te6-in (GitHub)", icons: [.alt29, .alt30, .alt31, .alt32]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) W. Kovács Ágnes (@wildgica)", icons: [.alt33]),
IconSelector(title: "settings.app.icon.official".localized, icons: [
.primary, .alt46, .alt1, .alt2, .alt3, .alt4,
.alt5, .alt6, .alt7, .alt8,
.alt9, .alt10, .alt11, .alt12, .alt13, .alt14, .alt15,
.alt16, .alt17, .alt18, .alt19, .alt20, .alt21]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) Albert Kinng", icons: [.alt22, .alt23, .alt24, .alt25, .alt26]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) Dan van Moll", icons: [.alt27, .alt28, .alt29]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) Chanhwi Joo (GitHub @te6-in)", icons: [.alt30, .alt31, .alt32, .alt33, .alt34, .alt35, .alt36]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) W. Kovács Ágnes (@wildgica)", icons: [.alt37]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) Duncan Horne", icons: [.alt38]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) BeAware@social.beaware.live", icons: [.alt39, .alt40, .alt41, .alt42, .alt43]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) Simone Margio", icons: [.alt44, .alt45]),
]
}
@EnvironmentObject private var theme: Theme
@Environment(Theme.self) private var theme
@State private var currentIcon = UIApplication.shared.alternateIconName ?? Icon.primary.appIconName
private let columns = [GridItem(.adaptive(minimum: 125, maximum: 1024))]
@ -74,7 +74,9 @@ struct IconSelectorView: View {
.padding(6)
.navigationTitle("settings.app.icon.navigation-title")
}
#if !os(visionOS)
.background(theme.primaryBackgroundColor)
#endif
}
private func makeIconGridView(icons: [Icon]) -> some View {
@ -85,11 +87,14 @@ struct IconSelectorView: View {
if icon.rawValue == Icon.primary.rawValue {
UIApplication.shared.setAlternateIconName(nil)
} else {
UIApplication.shared.setAlternateIconName(icon.appIconName)
UIApplication.shared.setAlternateIconName(icon.appIconName) { err in
guard let err else { return }
assertionFailure("\(err.localizedDescription) - Icon name: \(icon.appIconName)")
}
}
} label: {
ZStack(alignment: .bottomTrailing) {
Image(uiImage: .init(named: icon.iconName) ?? .init())
Image(uiImage: .init(named: icon.appIconName) ?? .init())
.resizable()
.aspectRatio(contentMode: .fit)
.frame(minHeight: 125, maxHeight: 1024)
@ -102,6 +107,7 @@ struct IconSelectorView: View {
}
}
}
.buttonStyle(.plain)
}
}
}
@ -109,6 +115,6 @@ struct IconSelectorView: View {
extension String {
var localized: String {
return NSLocalizedString(self, comment: "")
NSLocalizedString(self, comment: "")
}
}

View file

@ -4,7 +4,7 @@ import NukeUI
import SwiftUI
struct InstanceInfoView: View {
@EnvironmentObject private var theme: Theme
@Environment(Theme.self) private var theme
let instance: Instance
@ -13,13 +13,15 @@ struct InstanceInfoView: View {
InstanceInfoSection(instance: instance)
}
.navigationTitle("instance.info.navigation-title")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
}
}
public struct InstanceInfoSection: View {
@EnvironmentObject private var theme: Theme
@Environment(Theme.self) private var theme
let instance: Instance
@ -28,20 +30,32 @@ public struct InstanceInfoSection: View {
LabeledContent("instance.info.name", value: instance.title)
Text(instance.shortDescription)
LabeledContent("instance.info.email", value: instance.email)
LabeledContent("instance.info.version", value: instance.version)
LabeledContent("instance.info.users", value: "\(instance.stats.userCount)")
LabeledContent("instance.info.posts", value: "\(instance.stats.statusCount)")
LabeledContent("instance.info.domains", value: "\(instance.stats.domainCount)")
LabeledContent("instance.info.version") {
Text(instance.version).monospaced()
}
LabeledContent("instance.info.users", value: format(instance.stats.userCount))
LabeledContent("instance.info.posts", value: format(instance.stats.statusCount))
LabeledContent("instance.info.domains", value: format(instance.stats.domainCount))
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
if let rules = instance.rules {
Section("instance.info.section.rules") {
ForEach(rules) { rule in
Text(rule.text)
Text(rule.text.trimmingCharacters(in: .whitespacesAndNewlines))
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
}
private func format(_ int: Int) -> String {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
return formatter.string(from: NSNumber(value: int))!
}
}

View file

@ -7,12 +7,13 @@ import NukeUI
import SwiftUI
import UserNotifications
@MainActor
struct PushNotificationsView: View {
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var appAccountsManager: AppAccountsManager
@EnvironmentObject private var pushNotifications: PushNotificationsService
@Environment(Theme.self) private var theme
@Environment(AppAccountsManager.self) private var appAccountsManager
@Environment(PushNotificationsService.self) private var pushNotifications
@StateObject public var subscription: PushNotificationSubscriptionSettings
@State public var subscription: PushNotificationSubscriptionSettings
var body: some View {
Form {
@ -32,7 +33,9 @@ struct PushNotificationsView: View {
} footer: {
Text("settings.push.main-toggle.description")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
if subscription.isEnabled {
Section {
@ -66,7 +69,7 @@ struct PushNotificationsView: View {
subscription.isReblogNotificationEnabled = newValue
updateSubscription()
})) {
Label("settings.push.boosts", systemImage: "arrow.left.arrow.right.circle")
Label("settings.push.boosts", image: "Rocket")
}
Toggle(isOn: .init(get: {
subscription.isPollNotificationEnabled
@ -85,7 +88,9 @@ struct PushNotificationsView: View {
Label("settings.push.new-posts", systemImage: "bubble.right")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
Section {
@ -100,14 +105,18 @@ struct PushNotificationsView: View {
} footer: {
Text("settings.push.duplicate.footer")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.navigationTitle("settings.push.navigation-title")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.task {
await subscription.fetchSubscription()
}
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
.task {
await subscription.fetchSubscription()
}
}
private func updateSubscription() {

View file

@ -0,0 +1,44 @@
import DesignSystem
import Env
import Models
import SwiftData
import SwiftUI
struct RecenTagsSettingView: View {
@Environment(\.modelContext) private var context
@Environment(RouterPath.self) private var routerPath
@Environment(Theme.self) private var theme
@Query(sort: \RecentTag.lastUse, order: .reverse) var tags: [RecentTag]
var body: some View {
Form {
ForEach(tags) { tag in
VStack(alignment: .leading) {
Text("#\(tag.title)")
.font(.scaledBody)
.foregroundColor(.primary)
Text(tag.formattedDate)
.font(.scaledFootnote)
.foregroundStyle(.secondary)
}
}.onDelete { indexes in
if let index = indexes.first {
context.delete(tags[index])
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.navigationTitle("settings.general.recent-tags")
.scrollContentBackground(.hidden)
#if !os(visionOS)
.background(theme.secondaryBackgroundColor)
#endif
.toolbar {
EditButton()
}
}
}

View file

@ -0,0 +1,45 @@
import DesignSystem
import Env
import Models
import SwiftData
import SwiftUI
struct RemoteTimelinesSettingView: View {
@Environment(\.modelContext) private var context
@Environment(RouterPath.self) private var routerPath
@Environment(Theme.self) private var theme
@Query(sort: \LocalTimeline.creationDate, order: .reverse) var localTimelines: [LocalTimeline]
var body: some View {
Form {
ForEach(localTimelines) { timeline in
Text(timeline.instance)
}.onDelete { indexes in
if let index = indexes.first {
context.delete(localTimelines[index])
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Button {
routerPath.presentedSheet = .addRemoteLocalTimeline
} label: {
Label("settings.timeline.add", systemImage: "badge.plus.radiowaves.right")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.navigationTitle("settings.general.remote-timelines")
.scrollContentBackground(.hidden)
#if !os(visionOS)
.background(theme.secondaryBackgroundColor)
#endif
.toolbar {
EditButton()
}
}
}

View file

@ -5,26 +5,35 @@ import Env
import Foundation
import Models
import Network
import Nuke
import SwiftData
import SwiftUI
import Timeline
@MainActor
struct SettingsTabs: View {
@Environment(\.dismiss) private var dismiss
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
@EnvironmentObject private var pushNotifications: PushNotificationsService
@EnvironmentObject private var preferences: UserPreferences
@EnvironmentObject private var client: Client
@EnvironmentObject private var currentInstance: CurrentInstance
@EnvironmentObject private var appAccountsManager: AppAccountsManager
@EnvironmentObject private var theme: Theme
@StateObject private var routerPath = RouterPath()
@Environment(PushNotificationsService.self) private var pushNotifications
@Environment(UserPreferences.self) private var preferences
@Environment(Client.self) private var client
@Environment(CurrentInstance.self) private var currentInstance
@Environment(AppAccountsManager.self) private var appAccountsManager
@Environment(Theme.self) private var theme
@State private var routerPath = RouterPath()
@State private var addAccountSheetPresented = false
@State private var isEditingAccount = false
@State private var cachedRemoved = false
@State private var timelineCache = TimelineCache()
@Binding var popToRootTab: Tab
let isModal: Bool
@State private var startingPoint: SettingsStartingPoint? = nil
var body: some View {
NavigationStack(path: $routerPath.path) {
Form {
@ -32,23 +41,57 @@ struct SettingsTabs: View {
accountsSection
generalSection
otherSections
cacheSection
}
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.navigationTitle(Text("settings.title"))
.navigationBarTitleDisplayMode(.inline)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
.toolbar {
if UIDevice.current.userInterfaceIdiom == .phone {
ToolbarItem {
Button("action.done") {
dismiss()
#if !os(visionOS)
.background(theme.secondaryBackgroundColor)
#endif
.navigationTitle(Text("settings.title"))
.navigationBarTitleDisplayMode(.inline)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
.toolbar {
if isModal {
ToolbarItem {
Button {
dismiss()
} label: {
Text("action.done").bold()
}
}
}
if UIDevice.current.userInterfaceIdiom == .pad, !preferences.showiPadSecondaryColumn, !isModal {
SecondaryColumnToolbarItem()
}
}
.withAppRouter()
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
.onAppear {
startingPoint = RouterPath.settingsStartingPoint
RouterPath.settingsStartingPoint = nil
}
.navigationDestination(item: $startingPoint) { targetView in
switch targetView {
case .display:
DisplaySettingsView()
case .haptic:
HapticSettingsView()
case .remoteTimelines:
RemoteTimelinesSettingView()
case .tagGroups:
TagsGroupSettingView()
case .recentTags:
RecenTagsSettingView()
case .content:
ContentSettingsView()
case .swipeActions:
SwipeActionsSettingsView()
case .tabAndSidebarEntries:
EmptyView()
case .translation:
TranslationSettingsView()
}
}
}
.withAppRouter()
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
}
.onAppear {
routerPath.client = client
@ -59,9 +102,9 @@ struct SettingsTabs: View {
}
}
.withSafariRouter()
.environmentObject(routerPath)
.onChange(of: $popToRootTab.wrappedValue) { popToRootTab in
if popToRootTab == .notifications {
.environment(routerPath)
.onChange(of: $popToRootTab.wrappedValue) { _, newValue in
if newValue == .notifications {
routerPath.path = []
}
}
@ -82,7 +125,7 @@ struct SettingsTabs: View {
.tint(.red)
}
}
AppAccountView(viewModel: .init(appAccount: account))
AppAccountView(viewModel: .init(appAccount: account), isParentPresented: .constant(false))
}
}
.onDelete { indexSet in
@ -98,7 +141,9 @@ struct SettingsTabs: View {
}
addAccountButton
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private func logoutAccount(account: AppAccount) async {
@ -106,7 +151,7 @@ struct SettingsTabs: View {
let sub = pushNotifications.subscriptions.first(where: { $0.account.token == token })
{
let client = Client(server: account.server, oauthToken: token)
await TimelineCache.shared.clearCache(for: client.id)
await timelineCache.clearCache(for: client.id)
await sub.deleteSubscription()
appAccountsManager.delete(account: account)
}
@ -128,26 +173,50 @@ struct SettingsTabs: View {
Label("settings.general.haptic", systemImage: "waveform.path")
}
}
NavigationLink(destination: remoteLocalTimelinesView) {
NavigationLink(destination: RemoteTimelinesSettingView()) {
Label("settings.general.remote-timelines", systemImage: "dot.radiowaves.right")
}
NavigationLink(destination: TagsGroupSettingView()) {
Label("timeline.filter.tag-groups", systemImage: "number")
}
NavigationLink(destination: RecenTagsSettingView()) {
Label("settings.general.recent-tags", systemImage: "clock")
}
NavigationLink(destination: ContentSettingsView()) {
Label("settings.general.content", systemImage: "rectangle.on.rectangle")
Label("settings.general.content", systemImage: "rectangle.stack")
}
NavigationLink(destination: SwipeActionsSettingsView()) {
Label("settings.general.swipeactions", systemImage: "hand.draw")
}
Link(destination: URL(string: UIApplication.openSettingsURLString)!) {
Label("settings.system", systemImage: "gear")
if UIDevice.current.userInterfaceIdiom == .phone || horizontalSizeClass == .compact {
NavigationLink(destination: TabbarEntriesSettingsView()) {
Label("settings.general.tabbarEntries", systemImage: "platter.filled.bottom.iphone")
}
} else if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
NavigationLink(destination: SidebarEntriesSettingsView()) {
Label("settings.general.sidebarEntries", systemImage: "sidebar.squares.leading")
}
}
.tint(theme.labelColor)
NavigationLink(destination: TranslationSettingsView()) {
Label("settings.general.translate", systemImage: "captions.bubble")
}
#if !targetEnvironment(macCatalyst)
Link(destination: URL(string: UIApplication.openSettingsURLString)!) {
Label("settings.system", systemImage: "gear")
}
.tint(theme.labelColor)
#endif
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
@ViewBuilder
private var otherSections: some View {
Section("settings.section.other") {
if !ProcessInfo.processInfo.isiOSAppOnMac {
@Bindable var preferences = preferences
Section {
#if !targetEnvironment(macCatalyst)
Picker(selection: $preferences.preferredBrowser) {
ForEach(PreferredBrowser.allCases, id: \.rawValue) { browser in
switch browser {
@ -164,40 +233,49 @@ struct SettingsTabs: View {
Label("settings.general.browser.in-app.readerview", systemImage: "doc.plaintext")
}
.disabled(preferences.preferredBrowser != PreferredBrowser.inAppSafari)
}
#endif
Toggle(isOn: $preferences.isOpenAIEnabled) {
Label("settings.other.hide-openai", systemImage: "faxmachine")
}
Toggle(isOn: $preferences.isSocialKeyboardEnabled) {
Label("settings.other.social-keyboard", systemImage: "keyboard")
}
Toggle(isOn: $preferences.autoPlayVideo) {
Label("settings.other.autoplay-video", systemImage: "play.square.stack")
Toggle(isOn: $preferences.soundEffectEnabled) {
Label("settings.other.sound-effect", systemImage: "hifispeaker")
}
Toggle(isOn: $preferences.fastRefreshEnabled) {
Label("settings.other.fast-refresh", systemImage: "arrow.clockwise")
}
} header: {
Text("settings.section.other")
} footer: {
Text("settings.section.other.footer")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var appSection: some View {
Section {
if !ProcessInfo.processInfo.isiOSAppOnMac {
#if !targetEnvironment(macCatalyst) && !os(visionOS)
NavigationLink(destination: IconSelectorView()) {
Label {
Text("settings.app.icon")
} icon: {
if let icon = IconSelectorView.Icon(string: UIApplication.shared.alternateIconName ?? "AppIcon") {
Image(uiImage: .init(named: icon.iconName)!)
.resizable()
.frame(width: 25, height: 25)
.cornerRadius(4)
}
let icon = IconSelectorView.Icon(string: UIApplication.shared.alternateIconName ?? "AppIcon")
Image(uiImage: .init(named: icon.appIconName)!)
.resizable()
.frame(width: 25, height: 25)
.cornerRadius(4)
}
}
}
#endif
Link(destination: URL(string: "https://github.com/Dimillian/IceCubesApp")!) {
Label("settings.app.source", systemImage: "link")
}
.accessibilityRemoveTraits(.isButton)
.tint(theme.labelColor)
NavigationLink(destination: SupportAppView()) {
@ -208,6 +286,7 @@ struct SettingsTabs: View {
Link(destination: reviewURL) {
Label("settings.rate", systemImage: "link")
}
.accessibilityRemoveTraits(.isButton)
.tint(theme.labelColor)
}
@ -222,7 +301,9 @@ struct SettingsTabs: View {
Text("settings.section.app.footer \(appVersion)").frame(maxWidth: .infinity, alignment: .center)
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var addAccountButton: some View {
@ -250,25 +331,22 @@ struct SettingsTabs: View {
}
}
private var remoteLocalTimelinesView: some View {
Form {
ForEach(preferences.remoteLocalTimelines, id: \.self) { server in
Text(server)
}.onDelete { indexes in
if let index = indexes.first {
_ = preferences.remoteLocalTimelines.remove(at: index)
private var cacheSection: some View {
Section("settings.section.cache") {
if cachedRemoved {
Text("action.done")
.transition(.move(edge: .leading))
} else {
Button("settings.cache-media.clear", role: .destructive) {
ImagePipeline.shared.cache.removeAll()
withAnimation {
cachedRemoved = true
}
}
}
.listRowBackground(theme.primaryBackgroundColor)
Button {
routerPath.presentedSheet = .addRemoteLocalTimeline
} label: {
Label("settings.timeline.add", systemImage: "badge.plus.radiowaves.right")
}
.listRowBackground(theme.primaryBackgroundColor)
}
.navigationTitle("settings.general.remote-timelines")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
}

View file

@ -0,0 +1,40 @@
import DesignSystem
import Env
import SwiftUI
@MainActor
struct SidebarEntriesSettingsView: View {
@Environment(Theme.self) private var theme
@Environment(UserPreferences.self) private var userPreferences
@State private var sidebarTabs = SidebarTabs.shared
var body: some View {
@Bindable var userPreferences = userPreferences
Form {
Section {
ForEach($sidebarTabs.tabs, id: \.tab) { $tab in
if tab.tab != .profile && tab.tab != .settings {
Toggle(isOn: $tab.enabled) {
tab.tab.label
}
}
}
.onMove(perform: move)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.environment(\.editMode, .constant(.active))
.navigationTitle("settings.general.sidebarEntries")
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
}
func move(from source: IndexSet, to destination: Int) {
sidebarTabs.tabs.move(fromOffsets: source, toOffset: destination)
}
}

View file

@ -1,12 +1,12 @@
import DesignSystem
import Env
import RevenueCat
import Shimmer
import SwiftUI
@MainActor
struct SupportAppView: View {
enum Tips: String, CaseIterable {
case one, two, three, four
enum Tip: String, CaseIterable {
case one, two, three, four, supporter
init(productId: String) {
self = .init(rawValue: String(productId.split(separator: ".")[2]))!
@ -19,134 +19,265 @@ struct SupportAppView: View {
var title: LocalizedStringKey {
switch self {
case .one:
return "settings.support.one.title"
"settings.support.one.title"
case .two:
return "settings.support.two.title"
"settings.support.two.title"
case .three:
return "settings.support.three.title"
"settings.support.three.title"
case .four:
return "settings.support.four.title"
"settings.support.four.title"
case .supporter:
"settings.support.supporter.title"
}
}
var subtitle: LocalizedStringKey {
switch self {
case .one:
return "settings.support.one.subtitle"
"settings.support.one.subtitle"
case .two:
return "settings.support.two.subtitle"
"settings.support.two.subtitle"
case .three:
return "settings.support.three.subtitle"
"settings.support.three.subtitle"
case .four:
return "settings.support.four.subtitle"
"settings.support.four.subtitle"
case .supporter:
"settings.support.supporter.subtitle"
}
}
}
@EnvironmentObject private var theme: Theme
@Environment(Theme.self) private var theme
@Environment(\.openURL) private var openURL
@State private var loadingProducts: Bool = false
@State private var products: [StoreProduct] = []
@State private var subscription: StoreProduct?
@State private var customerInfo: CustomerInfo?
@State private var isProcessingPurchase: Bool = false
@State private var purchaseSuccessDisplayed: Bool = false
@State private var purchaseErrorDisplayed: Bool = false
var body: some View {
Form {
Section {
HStack(alignment: .top, spacing: 12) {
VStack(spacing: 18) {
Image("avatar")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image("icon0")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
}
Text("settings.support.message-from-dev")
}
}
.listRowBackground(theme.primaryBackgroundColor)
Section {
if loadingProducts {
HStack {
VStack(alignment: .leading) {
Text("placeholder.loading.short.")
.font(.scaledSubheadline)
Text("settings.support.placeholder.loading-subtitle")
.font(.scaledFootnote)
.foregroundColor(.gray)
}
.padding(.vertical, 8)
}
.redacted(reason: .placeholder)
.shimmering()
} else {
ForEach(products, id: \.productIdentifier) { product in
let tip = Tips(productId: product.productIdentifier)
HStack {
VStack(alignment: .leading) {
Text(tip.title)
.font(.scaledSubheadline)
Text(tip.subtitle)
.font(.scaledFootnote)
.foregroundColor(.gray)
}
Spacer()
Button {
if !isProcessingPurchase {
isProcessingPurchase = true
Task {
do {
let result = try await Purchases.shared.purchase(product: product)
if !result.userCancelled {
purchaseSuccessDisplayed = true
}
} catch {
purchaseErrorDisplayed = true
}
isProcessingPurchase = false
}
}
} label: {
if isProcessingPurchase {
ProgressView()
} else {
Text(product.localizedPriceString)
}
}
.buttonStyle(.bordered)
}
.padding(.vertical, 8)
}
}
}
.listRowBackground(theme.primaryBackgroundColor)
aboutSection
subscriptionSection
tipsSection
restorePurchase
linksSection
}
.navigationTitle("settings.support.navigation-title")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.alert("settings.support.alert.title", isPresented: $purchaseSuccessDisplayed, actions: {
Button { purchaseSuccessDisplayed = false } label: { Text("alert.button.ok") }
}, message: {
Text("settings.support.alert.message")
})
.alert("alert.error", isPresented: $purchaseErrorDisplayed, actions: {
Button { purchaseErrorDisplayed = false } label: { Text("alert.button.ok") }
}, message: {
Text("settings.support.alert.error.message")
})
.onAppear {
loadingProducts = true
Purchases.shared.getProducts(Tips.allCases.map { $0.productId }) { products in
self.products = products.sorted(by: { $0.price < $1.price })
withAnimation {
loadingProducts = false
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
.alert("settings.support.alert.title", isPresented: $purchaseSuccessDisplayed, actions: {
Button { purchaseSuccessDisplayed = false } label: { Text("alert.button.ok") }
}, message: {
Text("settings.support.alert.message")
})
.alert("alert.error", isPresented: $purchaseErrorDisplayed, actions: {
Button { purchaseErrorDisplayed = false } label: { Text("alert.button.ok") }
}, message: {
Text("settings.support.alert.error.message")
})
.onAppear {
loadingProducts = true
fetchStoreProducts()
refreshUserInfo()
}
}
private func purchase(product: StoreProduct) async {
if !isProcessingPurchase {
isProcessingPurchase = true
do {
let result = try await Purchases.shared.purchase(product: product)
if !result.userCancelled {
purchaseSuccessDisplayed = true
}
} catch {
purchaseErrorDisplayed = true
}
isProcessingPurchase = false
}
}
private func fetchStoreProducts() {
Purchases.shared.getProducts(Tip.allCases.map(\.productId)) { products in
subscription = products.first(where: { $0.productIdentifier == Tip.supporter.productId })
self.products = products.filter { $0.productIdentifier != Tip.supporter.productId }.sorted(by: { $0.price < $1.price })
withAnimation {
loadingProducts = false
}
}
}
private func refreshUserInfo() {
Purchases.shared.getCustomerInfo { info, _ in
customerInfo = info
}
}
private func makePurchaseButton(product: StoreProduct) -> some View {
Button {
Task {
await purchase(product: product)
refreshUserInfo()
}
} label: {
if isProcessingPurchase {
ProgressView()
} else {
Text(product.localizedPriceString)
}
}
.buttonStyle(.bordered)
}
private var aboutSection: some View {
Section {
HStack(alignment: .top, spacing: 12) {
VStack(spacing: 18) {
Image("avatar")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image("icon0")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
}
Text("settings.support.message-from-dev")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var subscriptionSection: some View {
Section {
if loadingProducts {
loadingPlaceholder
} else if let subscription {
HStack {
if customerInfo?.entitlements["Supporter"]?.isActive == true {
Text(Image(systemName: "checkmark.seal.fill"))
.foregroundColor(theme.tintColor)
.baselineOffset(-1) +
Text("settings.support.supporter.subscribed")
.font(.scaledSubheadline)
} else {
VStack(alignment: .leading) {
Text(Image(systemName: "checkmark.seal.fill"))
.foregroundColor(theme.tintColor)
.baselineOffset(-1) +
Text(Tip.supporter.title)
.font(.scaledSubheadline)
Text(Tip.supporter.subtitle)
.font(.scaledFootnote)
.foregroundStyle(.secondary)
}
Spacer()
makePurchaseButton(product: subscription)
}
}
.padding(.vertical, 8)
}
} footer: {
if customerInfo?.entitlements.active.isEmpty == true {
Text("settings.support.supporter.subscription-info")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var tipsSection: some View {
Section {
if loadingProducts {
loadingPlaceholder
} else {
ForEach(products, id: \.productIdentifier) { product in
let tip = Tip(productId: product.productIdentifier)
HStack {
VStack(alignment: .leading) {
Text(tip.title)
.font(.scaledSubheadline)
Text(tip.subtitle)
.font(.scaledFootnote)
.foregroundStyle(.secondary)
}
Spacer()
makePurchaseButton(product: product)
}
.padding(.vertical, 8)
}
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var restorePurchase: some View {
Section {
HStack {
Spacer()
Button {
Purchases.shared.restorePurchases { info, _ in
customerInfo = info
}
} label: {
Text("settings.support.restore-purchase.button")
}.buttonStyle(.bordered)
Spacer()
}
} footer: {
Text("settings.support.restore-purchase.explanation")
}
#if !os(visionOS)
.listRowBackground(theme.secondaryBackgroundColor)
#endif
}
private var linksSection: some View {
Section {
VStack(alignment: .leading, spacing: 16) {
Button {
openURL(URL(string: "https://github.com/Dimillian/IceCubesApp/blob/main/PRIVACY.MD")!)
} label: {
Text("settings.support.privacy-policy")
}
.buttonStyle(.borderless)
Button {
openURL(URL(string: "https://github.com/Dimillian/IceCubesApp/blob/main/TERMS.MD")!)
} label: {
Text("settings.support.terms-of-use")
}
.buttonStyle(.borderless)
}
}
#if !os(visionOS)
.listRowBackground(theme.secondaryBackgroundColor)
#endif
}
private var loadingPlaceholder: some View {
HStack {
VStack(alignment: .leading) {
Text("placeholder.loading.short")
.font(.scaledSubheadline)
Text("settings.support.placeholder.loading-subtitle")
.font(.scaledFootnote)
.foregroundStyle(.secondary)
}
.padding(.vertical, 8)
}
.redacted(reason: .placeholder)
.allowsHitTesting(false)
}
}

View file

@ -2,81 +2,91 @@ import DesignSystem
import Env
import SwiftUI
@MainActor
struct SwipeActionsSettingsView: View {
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var userPreferences: UserPreferences
@Environment(Theme.self) private var theme
@Environment(UserPreferences.self) private var userPreferences
var body: some View {
@Bindable var userPreferences = userPreferences
Form {
Section("settings.swipeactions.status") {
Label("settings.swipeactions.status.leading", systemImage: "arrow.right.circle")
Picker(selection: $userPreferences.swipeActionsStatusLeadingLeft, label: makeSwipeLabel(left: true, text: "settings.swipeactions.status.leading.left")) {
Section {
Text(StatusAction.none.displayName()).tag(StatusAction.none)
}
Section {
ForEach(StatusAction.allCases) { action in
if action != .none {
Text(action.displayName()).tag(action)
}
Section {
Label("settings.swipeactions.status.leading", systemImage: "arrow.right")
.foregroundColor(.secondary)
createStatusActionPicker(selection: $userPreferences.swipeActionsStatusLeadingLeft,
label: "settings.swipeactions.primary")
.onChange(of: userPreferences.swipeActionsStatusLeadingLeft) { _, action in
if action == .none {
userPreferences.swipeActionsStatusLeadingRight = .none
}
}
}
Picker(selection: $userPreferences.swipeActionsStatusLeadingRight, label: makeSwipeLabel(left: false, text: "settings.swipeactions.status.leading.right")) {
Section {
Text(StatusAction.none.displayName()).tag(StatusAction.none)
}
Section {
ForEach(StatusAction.allCases) { action in
if action != .none {
Text(action.displayName()).tag(action)
}
createStatusActionPicker(selection: $userPreferences.swipeActionsStatusLeadingRight,
label: "settings.swipeactions.secondary")
.disabled(userPreferences.swipeActionsStatusLeadingLeft == .none)
Label("settings.swipeactions.status.trailing", systemImage: "arrow.left")
.foregroundColor(.secondary)
createStatusActionPicker(selection: $userPreferences.swipeActionsStatusTrailingRight,
label: "settings.swipeactions.primary")
.onChange(of: userPreferences.swipeActionsStatusTrailingRight) { _, action in
if action == .none {
userPreferences.swipeActionsStatusTrailingLeft = .none
}
}
}
Label("settings.swipeactions.status.trailing", systemImage: "arrow.left.circle")
Picker(selection: $userPreferences.swipeActionsStatusTrailingLeft, label: makeSwipeLabel(left: true, text: "settings.swipeactions.status.trailing.left")) {
Section {
Text(StatusAction.none.displayName()).tag(StatusAction.none)
}
Section {
ForEach(StatusAction.allCases) { action in
if action != .none {
Text(action.displayName()).tag(action)
}
}
}
}
Picker(selection: $userPreferences.swipeActionsStatusTrailingRight, label: makeSwipeLabel(left: false, text: "settings.swipeactions.status.trailing.right")) {
Section {
Text(StatusAction.none.displayName()).tag(StatusAction.none)
}
Section {
ForEach(StatusAction.allCases) { action in
if action != .none {
Text(action.displayName()).tag(action)
}
}
}
}
Toggle(isOn: $userPreferences.swipeActionsUseThemeColor) {
Label("settings.swipeactions.status.use-theme-colors", systemImage: "paintbrush.pointed")
}
Picker(selection: $userPreferences.swipeActionsIconStyle, label: Label("settings.swipeactions.status.icon-style", systemImage: "text.below.photo")) {
createStatusActionPicker(selection: $userPreferences.swipeActionsStatusTrailingLeft,
label: "settings.swipeactions.secondary")
.disabled(userPreferences.swipeActionsStatusTrailingRight == .none)
} header: {
Text("settings.swipeactions.status")
} footer: {
Text("settings.swipeactions.status.explanation")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Section {
Picker(selection: $userPreferences.swipeActionsIconStyle, label: Text("settings.swipeactions.icon-style")) {
ForEach(UserPreferences.SwipeActionsIconStyle.allCases, id: \.rawValue) { style in
Text(style.description).tag(style)
}
}
Toggle(isOn: $userPreferences.swipeActionsUseThemeColor) {
Text("settings.swipeactions.use-theme-colors")
}
} header: {
Text("settings.swipeactions.appearance")
} footer: {
Text("settings.swipeactions.use-theme-colors-explanation")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.navigationTitle("settings.swipeactions.navigation-title")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
}
private func makeSwipeLabel(left: Bool, text: LocalizedStringKey) -> some View {
return Label(text, systemImage: left ? "rectangle.lefthalf.filled" : "rectangle.righthalf.filled")
.padding(.leading, 16)
private func createStatusActionPicker(selection: Binding<StatusAction>, label: LocalizedStringKey) -> some View {
Picker(selection: selection, label: Text(label)) {
Section {
Text(StatusAction.none.displayName()).tag(StatusAction.none)
}
Section {
ForEach(StatusAction.allCases) { action in
if action != .none {
Text(action.displayName()).tag(action)
}
}
}
}
}
}

View file

@ -0,0 +1,59 @@
import DesignSystem
import Env
import SwiftUI
@MainActor
struct TabbarEntriesSettingsView: View {
@Environment(Theme.self) private var theme
@Environment(UserPreferences.self) private var userPreferences
@State private var tabs = iOSTabs.shared
var body: some View {
@Bindable var userPreferences = userPreferences
Form {
Section {
Picker("settings.tabs.first-tab", selection: $tabs.firstTab) {
ForEach(Tab.allCases) { tab in
tab.label.tag(tab)
}
}
Picker("settings.tabs.second-tab", selection: $tabs.secondTab) {
ForEach(Tab.allCases) { tab in
tab.label.tag(tab)
}
}
Picker("settings.tabs.third-tab", selection: $tabs.thirdTab) {
ForEach(Tab.allCases) { tab in
tab.label.tag(tab)
}
}
Picker("settings.tabs.fourth-tab", selection: $tabs.fourthTab) {
ForEach(Tab.allCases) { tab in
tab.label.tag(tab)
}
}
Picker("settings.tabs.fifth-tab", selection: $tabs.fifthTab) {
ForEach(Tab.allCases) { tab in
tab.label.tag(tab)
}
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Section {
Toggle("settings.display.show-tab-label", isOn: $userPreferences.showiPhoneTabLabel)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.navigationTitle("settings.general.tabbarEntries")
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
}
}

View file

@ -0,0 +1,50 @@
import DesignSystem
import Env
import Models
import SwiftData
import SwiftUI
struct TagsGroupSettingView: View {
@Environment(\.modelContext) private var context
@Environment(RouterPath.self) private var routerPath
@Environment(Theme.self) private var theme
@Query(sort: \TagGroup.creationDate, order: .reverse) var tagGroups: [TagGroup]
var body: some View {
Form {
ForEach(tagGroups) { group in
Label(group.title, systemImage: group.symbolName)
.onTapGesture {
routerPath.presentedSheet = .editTagGroup(tagGroup: group, onSaved: nil)
}
}
.onDelete { indexes in
if let index = indexes.first {
context.delete(tagGroups[index])
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Button {
routerPath.presentedSheet = .addTagGroup
} label: {
Label("timeline.filter.add-tag-groups", systemImage: "plus")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.navigationTitle("timeline.filter.tag-groups")
.scrollContentBackground(.hidden)
#if !os(visionOS)
.background(theme.secondaryBackgroundColor)
#endif
.toolbar {
EditButton()
}
}
}

View file

@ -0,0 +1,153 @@
import DesignSystem
import Env
import SwiftUI
@MainActor
struct TranslationSettingsView: View {
@Environment(UserPreferences.self) private var preferences
@Environment(Theme.self) private var theme
@State private var apiKey: String = ""
var body: some View {
Form {
translationSelector
if preferences.preferredTranslationType == .useDeepl {
Section("settings.translation.user-api-key") {
deepLPicker
SecureField("settings.translation.user-api-key", text: $apiKey)
.textContentType(.password)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
if apiKey.isEmpty {
Section {
Link(destination: URL(string: "https://www.deepl.com/pro-api")!) {
Text("settings.translation.needed-message")
.foregroundColor(.red)
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
}
backgroundAPIKey
autoDetectSection
}
.navigationTitle("settings.translation.navigation-title")
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
.onChange(of: apiKey) {
writeNewValue()
}
.onAppear(perform: updatePrefs)
.onAppear(perform: readValue)
}
@ViewBuilder
private var translationSelector: some View {
@Bindable var preferences = preferences
Picker("Translation Service", selection: $preferences.preferredTranslationType) {
ForEach(allTTCases, id: \.self) { type in
Text(type.description).tag(type)
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
var allTTCases: [TranslationType] {
TranslationType.allCases.filter { type in
if type != .useApple {
return true
}
#if canImport(_Translation_SwiftUI)
if #available(iOS 17.4, *) {
return true
} else {
return false
}
#else
return false
#endif
}
}
@ViewBuilder
private var deepLPicker: some View {
@Bindable var preferences = preferences
Picker("settings.translation.api-key-type", selection: $preferences.userDeeplAPIFree) {
Text("DeepL API Free").tag(true)
Text("DeepL API Pro").tag(false)
}
}
@ViewBuilder
private var autoDetectSection: some View {
@Bindable var preferences = preferences
Section {
Toggle(isOn: $preferences.autoDetectPostLanguage) {
Text("settings.translation.auto-detect-post-language")
}
} footer: {
Text("settings.translation.auto-detect-post-language-footer")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
@ViewBuilder
private var backgroundAPIKey: some View {
if preferences.preferredTranslationType != .useDeepl,
!apiKey.isEmpty
{
Section {
Text("The DeepL API Key is still stored!")
if preferences.preferredTranslationType == .useServerIfPossible {
Text("It can however still be used as a fallback for your instance's translation service.")
}
Button(role: .destructive) {
withAnimation {
writeNewValue(value: "")
readValue()
}
} label: {
Text("action.delete")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
}
private func writeNewValue() {
writeNewValue(value: apiKey)
}
private func writeNewValue(value: String) {
DeepLUserAPIHandler.write(value: value)
}
private func readValue() {
apiKey = DeepLUserAPIHandler.readKey()
}
private func updatePrefs() {
DeepLUserAPIHandler.deactivateToggleIfNoKey()
}
}
struct TranslationSettingsView_Previews: PreviewProvider {
static var previews: some View {
TranslationSettingsView()
.environment(UserPreferences.shared)
}
}

View file

@ -1,15 +1,24 @@
import Account
import AppIntents
import DesignSystem
import Explore
import Foundation
import Status
import StatusKit
import SwiftUI
enum Tab: Int, Identifiable, Hashable {
@MainActor
enum Tab: Int, Identifiable, Hashable, CaseIterable, Codable {
case timeline, notifications, mentions, explore, messages, settings, other
case trending, federated, local
case profile
case bookmarks
case favorites
case post
case followedTags
case lists
case links
var id: Int {
nonisolated var id: Int {
rawValue
}
@ -17,16 +26,12 @@ enum Tab: Int, Identifiable, Hashable {
[.timeline, .settings]
}
static func loggedInTabs() -> [Tab] {
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
return [.timeline, .trending, .federated, .local, .notifications, .mentions, .explore, .messages, .settings]
} else {
return [.timeline, .notifications, .explore, .messages, .profile]
}
static func visionOSTab() -> [Tab] {
[.profile, .timeline, .notifications, .mentions, .explore, .post, .settings]
}
@ViewBuilder
func makeContentView(popToRootTab: Binding<Tab>) -> some View {
func makeContentView(selectedTab: Binding<Tab>, popToRootTab: Binding<Tab>) -> some View {
switch self {
case .timeline:
TimelineTab(popToRootTab: popToRootTab)
@ -37,17 +42,37 @@ enum Tab: Int, Identifiable, Hashable {
case .federated:
TimelineTab(popToRootTab: popToRootTab, timeline: .federated)
case .notifications:
NotificationsTab(popToRootTab: popToRootTab, lockedType: nil)
NotificationsTab(selectedTab: selectedTab, popToRootTab: popToRootTab, lockedType: nil)
case .mentions:
NotificationsTab(popToRootTab: popToRootTab, lockedType: .mention)
NotificationsTab(selectedTab: selectedTab, popToRootTab: popToRootTab, lockedType: .mention)
case .explore:
ExploreTab(popToRootTab: popToRootTab)
case .messages:
MessagesTab(popToRootTab: popToRootTab)
case .settings:
SettingsTabs(popToRootTab: popToRootTab)
SettingsTabs(popToRootTab: popToRootTab, isModal: false)
case .profile:
ProfileTab(popToRootTab: popToRootTab)
case .bookmarks:
NavigationTab {
AccountStatusesListView(mode: .bookmarks)
}
case .favorites:
NavigationTab {
AccountStatusesListView(mode: .favorites)
}
case .followedTags:
NavigationTab {
FollowedTagsListView()
}
case .lists:
NavigationTab {
ListsListView()
}
case .links:
NavigationTab { TrendingLinksListView(cards: []) }
case .post:
VStack {}
case .other:
EmptyView()
}
@ -55,56 +80,193 @@ enum Tab: Int, Identifiable, Hashable {
@ViewBuilder
var label: some View {
if self != .other {
Label(title, systemImage: iconName)
}
}
var title: LocalizedStringKey {
switch self {
case .timeline:
Label("tab.timeline", systemImage: iconName)
"tab.timeline"
case .trending:
Label("tab.trending", systemImage: iconName)
"tab.trending"
case .local:
Label("tab.local", systemImage: iconName)
"tab.local"
case .federated:
Label("tab.federated", systemImage: iconName)
"tab.federated"
case .notifications:
Label("tab.notifications", systemImage: iconName)
"tab.notifications"
case .mentions:
Label("tab.notifications", systemImage: iconName)
"tab.mentions"
case .explore:
Label("tab.explore", systemImage: iconName)
"tab.explore"
case .messages:
Label("tab.messages", systemImage: iconName)
"tab.messages"
case .settings:
Label("tab.settings", systemImage: iconName)
"tab.settings"
case .profile:
Label("tab.profile", systemImage: iconName)
"tab.profile"
case .bookmarks:
"accessibility.tabs.profile.picker.bookmarks"
case .favorites:
"accessibility.tabs.profile.picker.favorites"
case .post:
"menu.new-post"
case .followedTags:
"timeline.filter.tags"
case .lists:
"timeline.filter.lists"
case .links:
"explore.section.trending.links"
case .other:
EmptyView()
""
}
}
var iconName: String {
switch self {
case .timeline:
return "rectangle.stack"
"rectangle.stack"
case .trending:
return "chart.line.uptrend.xyaxis"
"chart.line.uptrend.xyaxis"
case .local:
return "person.2"
"person.2"
case .federated:
return "globe.americas"
"globe.americas"
case .notifications:
return "bell"
"bell"
case .mentions:
return "at"
"at"
case .explore:
return "magnifyingglass"
"magnifyingglass"
case .messages:
return "tray"
"tray"
case .settings:
return "gear"
"gear"
case .profile:
return "person.crop.circle"
"person.crop.circle"
case .bookmarks:
"bookmark"
case .favorites:
"star"
case .post:
"square.and.pencil"
case .followedTags:
"tag"
case .lists:
"list.bullet"
case .links:
"newspaper"
case .other:
return ""
""
}
}
}
@MainActor
@Observable
class SidebarTabs {
struct SidedebarTab: Hashable, Codable {
let tab: Tab
var enabled: Bool
}
class Storage {
@AppStorage("sidebar_tabs") var tabs: [SidedebarTab] = [
.init(tab: .timeline, enabled: true),
.init(tab: .trending, enabled: true),
.init(tab: .federated, enabled: true),
.init(tab: .local, enabled: true),
.init(tab: .notifications, enabled: true),
.init(tab: .mentions, enabled: true),
.init(tab: .messages, enabled: true),
.init(tab: .explore, enabled: true),
.init(tab: .bookmarks, enabled: true),
.init(tab: .favorites, enabled: true),
.init(tab: .followedTags, enabled: true),
.init(tab: .lists, enabled: true),
.init(tab: .settings, enabled: true),
.init(tab: .profile, enabled: true),
]
}
private let storage = Storage()
public static let shared = SidebarTabs()
var tabs: [SidedebarTab] {
didSet {
storage.tabs = tabs
}
}
func isEnabled(_ tab: Tab) -> Bool {
tabs.first(where: { $0.tab.id == tab.id })?.enabled == true
}
private init() {
tabs = storage.tabs
}
}
@MainActor
@Observable
class iOSTabs {
enum TabEntries: String {
case first, second, third, fourth, fifth
}
class Storage {
@AppStorage(TabEntries.first.rawValue) var firstTab = Tab.timeline
@AppStorage(TabEntries.second.rawValue) var secondTab = Tab.notifications
@AppStorage(TabEntries.third.rawValue) var thirdTab = Tab.explore
@AppStorage(TabEntries.fourth.rawValue) var fourthTab = Tab.messages
@AppStorage(TabEntries.fifth.rawValue) var fifthTab = Tab.profile
}
private let storage = Storage()
public static let shared = iOSTabs()
var tabs: [Tab] {
[firstTab, secondTab, thirdTab, fourthTab, fifthTab]
}
var firstTab: Tab {
didSet {
storage.firstTab = firstTab
}
}
var secondTab: Tab {
didSet {
storage.secondTab = secondTab
}
}
var thirdTab: Tab {
didSet {
storage.thirdTab = thirdTab
}
}
var fourthTab: Tab {
didSet {
storage.fourthTab = fourthTab
}
}
var fifthTab: Tab {
didSet {
storage.fifthTab = fifthTab
}
}
private init() {
firstTab = storage.firstTab
secondTab = storage.secondTab
thirdTab = storage.thirdTab
fourthTab = storage.fourthTab
fifthTab = storage.fifthTab
}
}

View file

@ -0,0 +1,448 @@
import Combine
import DesignSystem
import Env
import Models
import Network
import NukeUI
import SFSafeSymbols
import SwiftData
import SwiftUI
@MainActor
struct EditTagGroupView: View {
@Environment(\.dismiss) private var dismiss
@Environment(\.modelContext) private var context
@Environment(Theme.self) private var theme
@State private var tagGroup: TagGroup
private let onSaved: ((TagGroup) -> Void)?
private let isNewGroup: Bool
@FocusState private var focusedField: Focus?
var body: some View {
NavigationStack {
Form {
Section {
TitleInputView(
title: $tagGroup.title,
titleValidationStatus: tagGroup.titleValidationStatus,
focusedField: $focusedField,
isNewGroup: isNewGroup
)
SymbolInputView(
selectedSymbol: $tagGroup.symbolName,
selectedSymbolValidationStatus: tagGroup.symbolNameValidationStatus,
focusedField: $focusedField
)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Section("add-tag-groups.edit.tags") {
TagsInputView(
tags: $tagGroup.tags,
tagsValidationStatus: tagGroup.tagsValidationStatus,
focusedField: $focusedField
)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.formStyle(.grouped)
.navigationTitle(
isNewGroup
? "timeline.filter.add-tag-groups"
: "timeline.filter.edit-tag-groups"
)
.navigationBarTitleDisplayMode(.inline)
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.scrollDismissesKeyboard(.interactively)
#endif
.toolbar {
CancelToolbarItem()
ToolbarItem(placement: .navigationBarTrailing) {
Button("action.save", action: { save() })
.disabled(!tagGroup.isValid)
}
}
.onAppear {
focusedField = .title
}
}
}
init(tagGroup: TagGroup = .emptyGroup(), onSaved: ((TagGroup) -> Void)? = nil) {
_tagGroup = State(wrappedValue: tagGroup)
self.onSaved = onSaved
isNewGroup = tagGroup.title.isEmpty
}
private func save() {
tagGroup.format()
context.insert(tagGroup)
onSaved?(tagGroup)
dismiss()
}
enum Focus {
case title
case symbol
case new
}
}
struct AddTagGroupView_Previews: PreviewProvider {
static var previews: some View {
let container = try? ModelContainer(for: TagGroup.self, configurations: ModelConfiguration())
// need to use `sheet` to show `symbolsSuggestionView` in preview
return Text(verbatim: "parent view for EditTagGroupView")
.sheet(isPresented: .constant(true)) {
EditTagGroupView()
.withEnvironments()
.modelContainer(container!)
}
}
}
private struct TitleInputView: View {
@Binding var title: String
let titleValidationStatus: TagGroup.TitleValidationStatus
@FocusState.Binding var focusedField: EditTagGroupView.Focus?
@Query var tagGroups: [TagGroup]
let isNewGroup: Bool
var body: some View {
VStack(alignment: .leading) {
TextField("add-tag-groups.edit.title.field", text: $title, axis: .horizontal)
.focused($focusedField, equals: .title)
.onSubmit {
focusedField = .symbol
}
if focusedField == .title, warningText != "" {
Text(warningText).warningLabel()
}
}
}
var warningText: LocalizedStringKey {
if case let .invalid(description) = titleValidationStatus {
return description
} else if
isNewGroup,
tagGroups.contains(where: { $0.title == title })
{
return "\(title) add-tag-groups.edit.title.field.warning.already-exists"
}
return ""
}
}
private struct SymbolInputView: View {
@State private var symbolQuery = ""
@Binding var selectedSymbol: String
let selectedSymbolValidationStatus: TagGroup.SymbolNameValidationStatus
@FocusState.Binding var focusedField: EditTagGroupView.Focus?
var body: some View {
VStack(alignment: .leading) {
HStack {
TextField("add-tag-groups.edit.icon.field", text: $symbolQuery, axis: .horizontal)
.textInputAutocapitalization(.never)
.autocorrectionDisabled()
.focused($focusedField, equals: .symbol)
.onSubmit {
if TagGroup.allSymbols.contains(symbolQuery) {
selectedSymbol = symbolQuery
}
focusedField = .new
}
.onChange(of: focusedField) {
symbolQuery = selectedSymbol
}
Image(systemName: selectedSymbol)
.frame(height: 30)
}
if case let .invalid(description) = selectedSymbolValidationStatus,
focusedField == .symbol
{
Text(description).warningLabel()
}
if focusedField == .symbol {
SymbolSearchResultsView(
symbolQuery: $symbolQuery,
selectedSymbol: $selectedSymbol,
focusedField: $focusedField
)
.frame(maxWidth: .infinity, alignment: .leading)
.frame(height: 40)
}
}
}
}
private struct TagsInputView: View {
@State private var newTag: String = ""
@Binding var tags: [String]
let tagsValidationStatus: TagGroup.TagsValidationStatus
@FocusState.Binding var focusedField: EditTagGroupView.Focus?
var body: some View {
ForEach(tags, id: \.self) { tag in
HStack {
Text(tag)
Spacer()
Button { deleteTag(tag) } label: {
Image(systemName: "trash")
.foregroundStyle(.red)
}
.buttonStyle(.plain)
}
}
.onDelete { indexes in
if let index = indexes.first {
let tag = tags[index]
deleteTag(tag)
}
}
// this `VStack` need to be here to overcome a SwiftUI bug
// "add new tag" `TextField` is not focused after adding the first tag
VStack(alignment: .leading) {
HStack {
// this condition is using to overcome a SwiftUI bug
// "add new tag" `TextField` is not focused after adding the first tag
if tags.isEmpty {
addNewTagTextField()
} else {
addNewTagTextField()
.onAppear { focusedField = .new }
}
Spacer()
if !newTag.isEmpty, !tags.contains(newTag) {
Button { addNewTag() } label: {
Image(systemName: "checkmark.circle.fill").tint(.green)
}
}
}
if focusedField == .new, warningText != "" {
Text(warningText).warningLabel()
}
}
var warningText: LocalizedStringKey {
if tags.contains(newTag) {
return "add-tag-groups.edit.tags.field.warning.duplicated-tag"
} else if case let .invalid(description) = tagsValidationStatus {
return description
}
return ""
}
}
private func addNewTagTextField() -> some View {
VStack(alignment: .leading) {
TextField("add-tag-groups.edit.tags.add", text: $newTag, axis: .horizontal)
.textInputAutocapitalization(.never)
.autocorrectionDisabled()
.onSubmit {
addNewTag()
}
.focused($focusedField, equals: .new)
}
}
private func addNewTag() {
addTag(newTag.trimmingCharacters(in: .whitespaces).lowercased())
newTag = ""
focusedField = .new
}
private func addTag(_ tag: String) {
guard !tag.isEmpty,
!tags.contains(tag)
else { return }
tags.append(tag)
tags.sort()
}
private func deleteTag(_ tag: String) {
tags.removeAll(where: { $0 == tag })
}
}
private struct SymbolSearchResultsView: View {
@Binding var symbolQuery: String
@Binding var selectedSymbol: String
@State private var results: [String] = []
@FocusState.Binding var focusedField: EditTagGroupView.Focus?
var body: some View {
Group {
switch validationStatus {
case .valid:
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack {
ForEach(results, id: \.self) { name in
Button {
results = TagGroup.searchSymbol(for: symbolQuery, exclude: selectedSymbol)
selectedSymbol = name
symbolQuery = name
focusedField = .new
} label: {
Image(systemName: name)
}
.buttonStyle(.plain)
}
}
.animation(.spring(duration: 0.2), value: results)
}
.onAppear {
results = TagGroup.searchSymbol(for: symbolQuery, exclude: selectedSymbol)
}
case let .invalid(description):
Text(description)
.font(.subheadline)
.foregroundStyle(.secondary)
}
}
.onAppear {
results = TagGroup.searchSymbol(for: symbolQuery, exclude: selectedSymbol)
}
.onChange(of: symbolQuery) {
results = TagGroup.searchSymbol(for: symbolQuery, exclude: selectedSymbol)
}
}
// MARK: search results validation
enum ValidationStatus: Equatable {
case valid
case invalid(description: LocalizedStringKey)
}
var validationStatus: ValidationStatus {
if results.isEmpty {
if symbolQuery == selectedSymbol,
!symbolQuery.isEmpty,
results.count == 0
{
.invalid(description: "\(symbolQuery) add-tag-groups.edit.tags.field.warning.search-results.already-selected")
} else {
.invalid(description: "add-tag-groups.edit.tags.field.warning.search-results.no-symbol-found")
}
} else {
.valid
}
}
}
extension TagGroup {
// MARK: title validation
enum TitleValidationStatus: Equatable {
case valid
case invalid(description: LocalizedStringKey)
}
var titleValidationStatus: TitleValidationStatus {
title.isEmpty
? .invalid(description: "add-tag-groups.edit.title.field.warning.empty-title")
: .valid
}
// MARK: symbolName validation
enum SymbolNameValidationStatus: Equatable {
case valid
case invalid(description: LocalizedStringKey)
}
var symbolNameValidationStatus: SymbolNameValidationStatus {
if symbolName.isEmpty {
return .invalid(description: "add-tag-groups.edit.title.field.warning.no-symbol-selected")
} else if !Self.allSymbols.contains(symbolName) {
return .invalid(description: "\(symbolName) add-tag-groups.edit.title.field.warning.invalid-sfsymbol-name")
}
return .valid
}
// MARK: tags validation
enum TagsValidationStatus: Equatable {
case valid
case invalid(description: LocalizedStringKey)
}
var tagsValidationStatus: TagsValidationStatus {
if tags.count < 2 {
return .invalid(description: "add-tag-groups.edit.tags.field.warning.number-of-tags")
}
return .valid
}
// MARK: TagGroup validation
var isValid: Bool {
titleValidationStatus == .valid
&& symbolNameValidationStatus == .valid
&& tagsValidationStatus == .valid
}
// MARK: format
func format() {
title = title.trimmingCharacters(in: .whitespacesAndNewlines)
tags = tags.map { $0.lowercased() }
}
// MARK: static members
static func emptyGroup() -> TagGroup {
TagGroup(title: "", symbolName: "", tags: [])
}
static func searchSymbol(for query: String, exclude excludedSymbol: String) -> [String] {
guard !query.isEmpty else { return [] }
return allSymbols.filter {
$0.contains(query) &&
$0 != excludedSymbol
}
}
static let allSymbols: [String] = SFSymbol.allSymbols.map { symbol in
symbol.rawValue
}
}
extension Text {
func warningLabel() -> Text {
font(.caption)
.foregroundStyle(.red)
}
}

View file

@ -4,14 +4,15 @@ import Env
import Models
import Network
import NukeUI
import Shimmer
import SwiftUI
@MainActor
struct AddRemoteTimelineView: View {
@Environment(\.dismiss) private var dismiss
@Environment(\.modelContext) private var context
@EnvironmentObject private var preferences: UserPreferences
@EnvironmentObject private var theme: Theme
@Environment(UserPreferences.self) private var preferences
@Environment(Theme.self) private var theme
@State private var instanceName: String = ""
@State private var instance: Instance?
@ -38,7 +39,7 @@ struct AddRemoteTimelineView: View {
}
Button {
guard instance != nil else { return }
preferences.remoteLocalTimelines.append(instanceName)
context.insert(LocalTimeline(instance: instanceName))
dismiss()
} label: {
Text("timeline.add.action.add")
@ -50,30 +51,30 @@ struct AddRemoteTimelineView: View {
.formStyle(.grouped)
.navigationTitle("timeline.add-remote.title")
.navigationBarTitleDisplayMode(.inline)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.scrollDismissesKeyboard(.immediately)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button("action.cancel", action: { dismiss() })
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.scrollDismissesKeyboard(.immediately)
#endif
.toolbar {
CancelToolbarItem()
}
}
.onChange(of: instanceName) { newValue in
instanceNamePublisher.send(newValue)
}
.onReceive(instanceNamePublisher.debounce(for: .milliseconds(500), scheduler: DispatchQueue.main)) { newValue in
Task {
let client = Client(server: newValue)
instance = try? await client.get(endpoint: Instances.instance)
.onChange(of: instanceName) { _, newValue in
instanceNamePublisher.send(newValue)
}
}
.onAppear {
isInstanceURLFieldFocused = true
let client = InstanceSocialClient()
Task {
self.instances = await client.fetchInstances()
.onReceive(instanceNamePublisher.debounce(for: .milliseconds(500), scheduler: DispatchQueue.main)) { newValue in
Task {
let client = Client(server: newValue)
instance = try? await client.get(endpoint: Instances.instance)
}
}
.onAppear {
isInstanceURLFieldFocused = true
let client = InstanceSocialClient()
Task {
instances = await client.fetchInstances(keyword: instanceName)
}
}
}
}
}
@ -85,7 +86,7 @@ struct AddRemoteTimelineView: View {
} else {
ForEach(instanceName.isEmpty ? instances : instances.filter { $0.name.contains(instanceName.lowercased()) }) { instance in
Button {
self.instanceName = instance.name
instanceName = instance.name
} label: {
VStack(alignment: .leading, spacing: 4) {
Text(instance.name)
@ -93,13 +94,13 @@ struct AddRemoteTimelineView: View {
.foregroundColor(.primary)
Text(instance.info?.shortDescription ?? "")
.font(.scaledBody)
.foregroundColor(.gray)
.foregroundStyle(Color.secondary)
(Text("instance.list.users-\(instance.users)")
+ Text("")
+ Text("instance.list.posts-\(instance.statuses)"))
.font(.scaledFootnote)
.foregroundColor(.gray)
.foregroundStyle(Color.secondary)
}
}
.listRowBackground(theme.primaryBackgroundColor)

View file

@ -4,46 +4,59 @@ import DesignSystem
import Env
import Models
import Network
import SwiftData
import SwiftUI
import Timeline
@MainActor
struct TimelineTab: View {
@EnvironmentObject private var appAccount: AppAccountsManager
@EnvironmentObject private var theme: Theme
@EnvironmentObject private var currentAccount: CurrentAccount
@EnvironmentObject private var preferences: UserPreferences
@EnvironmentObject private var client: Client
@StateObject private var routerPath = RouterPath()
@Environment(\.modelContext) private var context
@Environment(AppAccountsManager.self) private var appAccount
@Environment(Theme.self) private var theme
@Environment(CurrentAccount.self) private var currentAccount
@Environment(UserPreferences.self) private var preferences
@Environment(Client.self) private var client
@State private var routerPath = RouterPath()
@Binding var popToRootTab: Tab
@State private var didAppear: Bool = false
@State private var timeline: TimelineFilter
@State private var timeline: TimelineFilter = .home
@State private var selectedTagGroup: TagGroup?
@State private var scrollToTopSignal: Int = 0
@AppStorage("last_timeline_filter") public var lastTimelineFilter: TimelineFilter = .home
@Query(sort: \LocalTimeline.creationDate, order: .reverse) var localTimelines: [LocalTimeline]
@Query(sort: \TagGroup.creationDate, order: .reverse) var tagGroups: [TagGroup]
@AppStorage("last_timeline_filter") var lastTimelineFilter: TimelineFilter = .home
@AppStorage("timeline_pinned_filters") private var pinnedFilters: [TimelineFilter] = []
private let canFilterTimeline: Bool
init(popToRootTab: Binding<Tab>, timeline: TimelineFilter? = nil) {
canFilterTimeline = timeline == nil
self.timeline = timeline ?? .home
_popToRootTab = popToRootTab
_timeline = .init(initialValue: timeline ?? .home)
}
var body: some View {
NavigationStack(path: $routerPath.path) {
TimelineView(timeline: $timeline, scrollToTopSignal: $scrollToTopSignal)
TimelineView(timeline: $timeline,
pinnedFilters: $pinnedFilters,
selectedTagGroup: $selectedTagGroup,
scrollToTopSignal: $scrollToTopSignal,
canFilterTimeline: canFilterTimeline)
.withAppRouter()
.withSheetDestinations(sheetDestinations: $routerPath.presentedSheet)
.toolbar {
toolbarView
}
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
.id(client.id)
}
.onAppear {
routerPath.client = client
if !didAppear && canFilterTimeline {
if !didAppear, canFilterTimeline {
didAppear = true
if client.isAuth {
timeline = lastTimelineFilter
@ -58,22 +71,14 @@ struct TimelineTab: View {
routerPath.presentedSheet = .addAccount
}
}
.onChange(of: client.isAuth, perform: { _ in
if client.isAuth {
timeline = lastTimelineFilter
} else {
timeline = .federated
}
})
.onChange(of: currentAccount.account?.id, perform: { _ in
if client.isAuth, canFilterTimeline {
timeline = lastTimelineFilter
} else {
timeline = .federated
}
})
.onChange(of: $popToRootTab.wrappedValue) { popToRootTab in
if popToRootTab == .timeline {
.onChange(of: client.isAuth) {
resetTimelineFilter()
}
.onChange(of: currentAccount.account?.id) {
resetTimelineFilter()
}
.onChange(of: $popToRootTab.wrappedValue) { _, newValue in
if newValue == .timeline {
if routerPath.path.isEmpty {
scrollToTopSignal += 1
} else {
@ -81,76 +86,51 @@ struct TimelineTab: View {
}
}
}
.onChange(of: client.id) { _ in
.onChange(of: client.id) {
routerPath.path = []
}
.onChange(of: timeline) { timeline in
if timeline == .home || timeline == .federated || timeline == .local {
lastTimelineFilter = timeline
.onChange(of: timeline) { _, newValue in
if client.isAuth, canFilterTimeline {
lastTimelineFilter = newValue
}
switch newValue {
case let .tagGroup(title, _, _):
if let group = tagGroups.first(where: { $0.title == title }) {
selectedTagGroup = group
}
default:
selectedTagGroup = nil
}
}
.onReceive(NotificationCenter.default.publisher(for: .refreshTimeline)) { _ in
timeline = .latest
}
.onReceive(NotificationCenter.default.publisher(for: .trendingTimeline)) { _ in
timeline = .trending
}
.onReceive(NotificationCenter.default.publisher(for: .localTimeline)) { _ in
timeline = .local
}
.onReceive(NotificationCenter.default.publisher(for: .federatedTimeline)) { _ in
timeline = .federated
}
.onReceive(NotificationCenter.default.publisher(for: .homeTimeline)) { _ in
timeline = .home
}
.withSafariRouter()
.environmentObject(routerPath)
.environment(routerPath)
}
@ViewBuilder
private var timelineFilterButton: some View {
if timeline == .home {
Button {
self.timeline = .latest
} label: {
Label(TimelineFilter.latest.localizedTitle(), systemImage: TimelineFilter.latest.iconName() ?? "")
}
.keyboardShortcut("r", modifiers: .command)
Divider()
}
ForEach(TimelineFilter.availableTimeline(client: client), id: \.self) { timeline in
Button {
self.timeline = timeline
} label: {
Label(timeline.localizedTitle(), systemImage: timeline.iconName() ?? "")
}
}
if !currentAccount.lists.isEmpty {
Menu("timeline.filter.lists") {
ForEach(currentAccount.sortedLists) { list in
Button {
timeline = .list(list: list)
} label: {
Label(list.title, systemImage: "list.bullet")
}
}
}
}
if !currentAccount.tags.isEmpty {
Menu("timeline.filter.tags") {
ForEach(currentAccount.sortedTags) { tag in
Button {
timeline = .hashtag(tag: tag.name, accountId: nil)
} label: {
Label("#\(tag.name)", systemImage: "number")
}
}
}
}
Menu("timeline.filter.local") {
ForEach(preferences.remoteLocalTimelines, id: \.self) { server in
Button {
timeline = .remoteLocal(server: server, filter: .local)
} label: {
VStack {
Label(server, systemImage: "dot.radiowaves.right")
}
}
}
Button {
routerPath.presentedSheet = .addRemoteLocalTimeline
} label: {
Label("timeline.filter.add-local", systemImage: "badge.plus.radiowaves.right")
}
}
headerGroup
timelineFiltersButtons
listsFiltersButons
tagsFiltersButtons
localTimelinesFiltersButtons
tagGroupsFiltersButtons
Divider()
contentFilterButton
}
private var addAccountButton: some View {
@ -170,14 +150,7 @@ struct TimelineTab: View {
}
}
if client.isAuth {
if UIDevice.current.userInterfaceIdiom != .pad {
ToolbarItem(placement: .navigationBarLeading) {
AppAccountsSelectorView(routerPath: routerPath)
.id(currentAccount.account?.id)
}
}
statusEditorToolbarItem(routerPath: routerPath,
visibility: preferences.postVisibility)
ToolbarTab(routerPath: $routerPath)
} else {
ToolbarItem(placement: .navigationBarTrailing) {
addAccountButton
@ -212,4 +185,147 @@ struct TimelineTab: View {
}
}
}
@ViewBuilder
private var headerGroup: some View {
ControlGroup {
if timeline.supportNewestPagination {
Button {
timeline = .latest
} label: {
Label(TimelineFilter.latest.localizedTitle(), systemImage: TimelineFilter.latest.iconName())
}
}
if timeline == .home {
Button {
timeline = .resume
} label: {
VStack {
Label(TimelineFilter.resume.localizedTitle(),
systemImage: TimelineFilter.resume.iconName())
}
}
}
pinButton
}
}
@ViewBuilder
private var pinButton: some View {
let index = pinnedFilters.firstIndex(where: { $0.id == timeline.id })
Button {
withAnimation {
if let index {
pinnedFilters.remove(at: index)
} else {
pinnedFilters.append(timeline)
}
}
} label: {
if index != nil {
Label("status.action.unpin", systemImage: "pin.slash")
} else {
Label("status.action.pin", systemImage: "pin")
}
}
}
private var timelineFiltersButtons: some View {
ForEach(TimelineFilter.availableTimeline(client: client), id: \.self) { timeline in
Button {
self.timeline = timeline
} label: {
Label(timeline.localizedTitle(), systemImage: timeline.iconName())
}
}
}
@ViewBuilder
private var listsFiltersButons: some View {
Menu("timeline.filter.lists") {
Button {
routerPath.presentedSheet = .listCreate
} label: {
Label("account.list.create", systemImage: "plus")
}
ForEach(currentAccount.sortedLists) { list in
Button {
timeline = .list(list: list)
} label: {
Label(list.title, systemImage: "list.bullet")
}
}
}
}
@ViewBuilder
private var tagsFiltersButtons: some View {
if !currentAccount.tags.isEmpty {
Menu("timeline.filter.tags") {
ForEach(currentAccount.sortedTags) { tag in
Button {
timeline = .hashtag(tag: tag.name, accountId: nil)
} label: {
Label("#\(tag.name)", systemImage: "number")
}
}
}
}
}
private var localTimelinesFiltersButtons: some View {
Menu("timeline.filter.local") {
ForEach(localTimelines) { remoteLocal in
Button {
timeline = .remoteLocal(server: remoteLocal.instance, filter: .local)
} label: {
VStack {
Label(remoteLocal.instance, systemImage: "dot.radiowaves.right")
}
}
}
Button {
routerPath.presentedSheet = .addRemoteLocalTimeline
} label: {
Label("timeline.filter.add-local", systemImage: "badge.plus.radiowaves.right")
}
}
}
private var tagGroupsFiltersButtons: some View {
Menu("timeline.filter.tag-groups") {
ForEach(tagGroups) { group in
Button {
timeline = .tagGroup(title: group.title, tags: group.tags, symbolName: group.symbolName)
} label: {
VStack {
let icon = group.symbolName.isEmpty ? "number" : group.symbolName
Label(group.title, systemImage: icon)
}
}
}
Button {
routerPath.presentedSheet = .addTagGroup
} label: {
Label("timeline.filter.add-tag-groups", systemImage: "plus")
}
}
}
private var contentFilterButton: some View {
Button(action: {
routerPath.presentedSheet = .timelineContentFilter
}, label: {
Label("timeline.content-filter.title", systemSymbol: .line3HorizontalDecrease)
})
}
private func resetTimelineFilter() {
if client.isAuth, canFilterTimeline {
timeline = lastTimelineFilter
} else if !client.isAuth {
timeline = .federated
}
}
}

View file

@ -0,0 +1,48 @@
import AppAccount
import DesignSystem
import Env
import SwiftUI
@MainActor
struct ToolbarTab: ToolbarContent {
@Environment(\.isSecondaryColumn) private var isSecondaryColumn: Bool
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
@Environment(UserPreferences.self) private var userPreferences
@Binding var routerPath: RouterPath
var body: some ToolbarContent {
if !isSecondaryColumn {
ToolbarItem(placement: .topBarLeading) {
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
Button {
withAnimation {
userPreferences.isSidebarExpanded.toggle()
}
} label: {
if userPreferences.isSidebarExpanded {
Image(systemName: "sidebar.squares.left")
} else {
Image(systemName: "sidebar.left")
}
}
}
}
statusEditorToolbarItem(routerPath: routerPath,
visibility: userPreferences.postVisibility)
if UIDevice.current.userInterfaceIdiom != .pad ||
(UIDevice.current.userInterfaceIdiom == .pad && horizontalSizeClass == .compact)
{
ToolbarItem(placement: .navigationBarLeading) {
AppAccountsSelectorView(routerPath: routerPath)
}
}
}
if UIDevice.current.userInterfaceIdiom == .pad && horizontalSizeClass == .regular {
if (!isSecondaryColumn && !userPreferences.showiPadSecondaryColumn) || isSecondaryColumn {
SecondaryColumnToolbarItem()
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 KiB

View file

@ -1,57 +1,67 @@
{
"images" : [
{
"filename" : "icon.png",
"filename" : "1024.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"filename" : "macos16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "macos32 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "macos32.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "macos64.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "macos128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "mac256 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "mac256.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "macOS512 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "macOS512.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "macOS1024.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 973 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 KiB

View file

@ -0,0 +1,13 @@
{
"images" : [
{
"filename" : "Background.png",
"idiom" : "vision",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,17 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"layers" : [
{
"filename" : "Front.solidimagestacklayer"
},
{
"filename" : "Mid.solidimagestacklayer"
},
{
"filename" : "Back.solidimagestacklayer"
}
]
}

View file

@ -0,0 +1,13 @@
{
"images" : [
{
"filename" : "Layer 1.png",
"idiom" : "vision",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 KiB

View file

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "vision",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 KiB

View file

@ -0,0 +1,14 @@
{
"images" : [
{
"filename" : "1024.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 KiB

View file

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "icon.png",
"filename" : "1024.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 KiB

View file

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Dimillian_Ice_Cubes_in_a_glass_neon_style_glyph_retro_4b25c3a5-7ae2-401b-9b2f-17c9832e175a.png",
"filename" : "AppIconAlternate10.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

View file

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Dimillian_Ice_Cubes_in_a_glass_neon_style_glyph_retro_7ca60288-3e96-43a3-a88b-f4c882ac2183.png",
"filename" : "icon15.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

View file

Before

Width:  |  Height:  |  Size: 406 KiB

After

Width:  |  Height:  |  Size: 406 KiB

View file

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Dimillian_Ice_Cubes_in_a_glass_neon_style_glyph_retro_2338f943-14f9-4639-aabf-70dc18cf4d52.png",
"filename" : "icon16.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

View file

Before

Width:  |  Height:  |  Size: 401 KiB

After

Width:  |  Height:  |  Size: 401 KiB

View file

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "icon13.png",
"filename" : "icon17.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

View file

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 259 KiB

View file

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "icon14.png",
"filename" : "icon18.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 KiB

View file

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

View file

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "icon15.png",
"filename" : "AppIconAlternate15.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

View file

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "icon16.png",
"filename" : "icon.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

View file

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

View file

@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "icon17.png",
"filename" : "Alternate43-fs8.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 KiB

Some files were not shown because too many files have changed in this diff Show more