Compare commits

...

491 commits
1.9.17 ... 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
574 changed files with 25365 additions and 10226 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"

File diff suppressed because it is too large Load diff

View file

@ -9,13 +9,31 @@
"version" : "2.1.0"
}
},
{
"identity" : "buttonkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Dean151/ButtonKit",
"state" : {
"revision" : "377f5bab4ed047704316d531e0826d4de5ebf6a4",
"version" : "0.1.1"
}
},
{
"identity" : "emojitext",
"kind" : "remoteSourceControl",
"location" : "https://github.com/divadretlaw/EmojiText",
"state" : {
"revision" : "65b570ea0b0d9fc89a000900691a73a16c0baa54",
"version" : "3.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"
}
},
{
@ -27,6 +45,15 @@
"revision" : "f38cb0ada97847ac5068b915b8d2793b35435668"
}
},
{
"identity" : "libwebp-xcode",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SDWebImage/libwebp-Xcode",
"state" : {
"revision" : "b2b1d20a90b14d11f6ef4241da6b81c1d3f171e4",
"version" : "1.3.2"
}
},
{
"identity" : "lrucache",
"kind" : "remoteSourceControl",
@ -41,17 +68,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/kean/Nuke",
"state" : {
"revision" : "1694798e876113d44f6ec6ead965d7286695981d",
"version" : "12.2.0"
"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" : "b8d20ba1c8e13cc73d72e37cf98607d01fd357b6",
"version" : "4.31.2"
"revision" : "a9763ca482d52ea3d59aa2dfd2fc23427b02dada",
"version" : "4.40.1"
}
},
{
@ -72,6 +99,24 @@
"version" : "0.14.1"
}
},
{
"identity" : "swift-cmark",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-cmark.git",
"state" : {
"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"
}
},
{
"identity" : "swiftsoup",
"kind" : "remoteSourceControl",
@ -89,15 +134,6 @@
"revision" : "9e1cc02a65b22e09a8251261cccbccce02731fc5",
"version" : "1.1.1"
}
},
{
"identity" : "swiftui-shimmer",
"kind" : "remoteSourceControl",
"location" : "https://github.com/markiv/SwiftUI-Shimmer",
"state" : {
"revision" : "965a7cbcbf094cbcf22b9251a2323bdc3432e171",
"version" : "1.1.0"
}
}
],
"version" : 2

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

@ -8,7 +8,8 @@ import LinkPresentation
import Lists
import MediaUI
import Models
import Status
import Notifications
import StatusKit
import SwiftUI
import Timeline
@ -33,11 +34,13 @@ extension View {
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)
@ -53,63 +56,114 @@ extension View {
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):
CardsListView(cards: 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
Group {
switch destination {
case let .replyToStatusEditor(status):
StatusEditorView(mode: .replyTo(status: status))
case let .newStatusEditor(visibility):
StatusEditorView(mode: .new(visibility: visibility))
case let .editStatusEditor(status):
StatusEditorView(mode: .edit(status: status))
case let .quoteStatusEditor(status):
StatusEditorView(mode: .quote(status: status))
case let .mentionStatusEditor(account, visibility):
StatusEditorView(mode: .mention(account: account, visibility: visibility))
case .listCreate:
ListCreateView()
case let .listEdit(list):
ListEditView(list: list)
case let .listAddAccount(account):
ListAddAccountView(account: account)
case .addAccount:
AddAccountView()
case .addRemoteLocalTimeline:
AddRemoteTimelineView()
case .addTagGroup:
EditTagGroupView()
case let .statusEditHistory(status):
StatusEditHistoryView(statusId: status)
case .settings:
SettingsTabs(popToRootTab: .constant(.settings), isModal: true)
.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)
} else {
EmptyView()
}
case let .report(status):
ReportView(status: status)
case let .shareImage(image, status):
ActivityView(image: image, status: status)
case let .editTagGroup(tagGroup, onSaved):
EditTagGroupView(tagGroup: tagGroup, onSaved: onSaved)
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()
}
.withEnvironments()
}
}
@ -129,6 +183,7 @@ extension View {
Draft.self,
LocalTimeline.self,
TagGroup.self,
RecentTag.self,
])
}
}

View file

@ -24,7 +24,7 @@
<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/>

View file

@ -6,7 +6,7 @@
<string>development</string>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.$(BUNDLE_ID_PREFIX).IceCubesApp</string>
<string>iCloud.icecubesapp</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
@ -24,7 +24,7 @@
<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/>

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

@ -10,11 +10,11 @@ extension IceCubesApp {
}
.keyboardShortcut("n", modifiers: .shift)
Button("menu.new-post") {
#if targetEnvironment(macCatalyst)
openWindow(value: WindowDestinationEditor.newStatusEditor(visibility: userPreferences.postVisibility))
#else
sidebarRouterPath.presentedSheet = .newStatusEditor(visibility: userPreferences.postVisibility)
#endif
#if targetEnvironment(macCatalyst)
openWindow(value: WindowDestinationEditor.newStatusEditor(visibility: userPreferences.postVisibility))
#else
appRouterPath.presentedSheet = .newStatusEditor(visibility: userPreferences.postVisibility)
#endif
}
.keyboardShortcut("n", modifiers: .command)
}
@ -54,5 +54,11 @@ extension IceCubesApp {
}
.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

@ -1,12 +1,13 @@
import AppIntents
import Env
import MediaUI
import Status
import StatusKit
import SwiftUI
extension IceCubesApp {
var appScene: some Scene {
WindowGroup(id: "MainWindow") {
appView
AppView(selectedTab: $selectedTab, appRouterPath: $appRouterPath)
.applyTheme(theme)
.onAppear {
setNewClientsInEnv(client: appAccountsManager.currentClient)
@ -22,6 +23,7 @@ extension IceCubesApp {
.environment(theme)
.environment(watcher)
.environment(pushNotificationsService)
.environment(appIntentService)
.environment(\.isSupporter, isSupporter)
.sheet(item: $quickLook.selectedMediaAttachment) { selectedMediaAttachment in
MediaUIView(selectedAttachment: selectedMediaAttachment,
@ -47,8 +49,19 @@ extension IceCubesApp {
}
}
}
.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
}
@ -63,40 +76,38 @@ extension IceCubesApp {
}
}
@ViewBuilder
private var appView: some View {
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
sidebarView
} else {
tabBarView
}
}
@SceneBuilder
var otherScenes: some Scene {
WindowGroup(for: WindowDestinationEditor.self) { destination in
Group {
switch destination.wrappedValue {
case let .newStatusEditor(visibility):
StatusEditorView(mode: .new(visibility: 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):
StatusEditorView(mode: .edit(status: status))
StatusEditor.MainView(mode: .edit(status: status))
case let .quoteStatusEditor(status):
StatusEditorView(mode: .quote(status: status))
StatusEditor.MainView(mode: .quote(status: status))
case let .replyToStatusEditor(status):
StatusEditorView(mode: .replyTo(status: 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 {
@ -115,4 +126,23 @@ extension IceCubesApp {
.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

@ -1,49 +0,0 @@
import Env
import SwiftUI
extension IceCubesApp {
var sidebarView: some View {
SideBarView(selectedTab: $selectedTab,
popToRootTab: $popToRootTab,
tabs: availableTabs)
{
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 appAccountsManager.currentClient.isAuth,
userPreferences.showiPadSecondaryColumn
{
Divider().edgesIgnoringSafeArea(.all)
notificationsSecondaryColumn
}
}
}.onChange(of: $appAccountsManager.currentAccount.id) {
sideBarLoadedTabs.removeAll()
}
.environment(sidebarRouterPath)
}
var notificationsSecondaryColumn: some View {
NotificationsTab(popToRootTab: $popToRootTab, lockedType: nil)
.environment(\.isSecondaryColumn, true)
.frame(maxWidth: .secondaryColumnWidth)
.id(appAccountsManager.currentAccount.id)
}
}

View file

@ -1,57 +0,0 @@
import Env
import SwiftUI
extension IceCubesApp {
var tabBarView: some View {
TabView(selection: .init(get: {
selectedTab
}, set: { newTab in
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
DispatchQueue.main.async {
if selectedTab == .notifications,
let token = appAccountsManager.currentAccount.oauthToken
{
userPreferences.notificationsCount[token] = 0
watcher.unreadNotificationsCount = 0
}
}
})) {
ForEach(availableTabs) { tab in
tab.makeContentView(popToRootTab: $popToRootTab)
.tabItem {
if userPreferences.showiPhoneTabLabel {
tab.label
} else {
Image(systemName: tab.iconName)
}
}
.tag(tab)
.badge(badgeFor(tab: tab))
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .tabBar)
}
}
.id(appAccountsManager.currentClient.id)
}
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
}
}

View file

@ -7,7 +7,7 @@ import KeychainSwift
import MediaUI
import Network
import RevenueCat
import Status
import StatusKit
import SwiftUI
import Timeline
@ -23,19 +23,15 @@ struct IceCubesApp: App {
@State var currentAccount = CurrentAccount.shared
@State var userPreferences = UserPreferences.shared
@State var pushNotificationsService = PushNotificationsService.shared
@State var watcher = StreamWatcher()
@State var appIntentService = AppIntentService.shared
@State var watcher = StreamWatcher.shared
@State var quickLook = QuickLook.shared
@State var theme = Theme.shared
@State var sidebarRouterPath = RouterPath()
@State var selectedTab: Tab = .timeline
@State var popToRootTab: Tab = .other
@State var sideBarLoadedTabs: Set<Tab> = Set()
@State var isSupporter: Bool = false
@State var appRouterPath = RouterPath()
var availableTabs: [Tab] {
appAccountsManager.currentClient.isAuth ? Tab.loggedInTabs() : Tab.loggedOutTab()
}
@State var isSupporter: Bool = false
var body: some Scene {
appScene
@ -84,11 +80,12 @@ struct IceCubesApp: App {
}
}
class AppDelegate: NSObject, UIApplicationDelegate {
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_: UIApplication,
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool
{
try? AVAudioSession.sharedInstance().setCategory(.ambient)
try? AVAudioSession.sharedInstance().setCategory(.ambient, options: .mixWithOthers)
try? AVAudioSession.sharedInstance().setActive(true)
PushNotificationsService.shared.setAccounts(accounts: AppAccountsManager.shared.pushAccounts)
return true
}
@ -117,4 +114,11 @@ class AppDelegate: NSObject, UIApplicationDelegate {
}
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

@ -2,7 +2,7 @@ import DesignSystem
import Env
import Models
import Network
import Status
import StatusKit
import SwiftUI
public struct ReportView: View {
@ -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,9 +1,9 @@
import DesignSystem
import Env
import Models
import Observation
import SafariServices
import SwiftUI
import Models
extension View {
@MainActor func withSafariRouter() -> some View {
@ -13,23 +13,28 @@ extension View {
@MainActor
private struct SafariRouter: ViewModifier {
@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 safariManager = InAppSafariManager()
#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 { url in
// Open external URL (from icecubesapp://)
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
@ -43,76 +48,86 @@ private struct SafariRouter: ViewModifier {
return .handled
}
}
#if !targetEnvironment(macCatalyst)
guard preferences.preferredBrowser == .inAppSafari else { return .systemAction }
#endif
// 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
}
return safariManager.open(url)
#endif
}
}
#if !os(visionOS)
.background {
WindowReader { window in
safariManager.windowScene = window.windowScene
}
}
#endif
}
}
@MainActor
@Observable private class InAppSafariManager: NSObject, SFSafariViewControllerDelegate {
var windowScene: UIWindowScene?
let viewController: UIViewController = .init()
var window: UIWindow?
#if !os(visionOS)
@MainActor
func open(_ url: URL) -> OpenURLAction.Result {
guard let windowScene else { return .systemAction }
@Observable private class InAppSafariManager: NSObject, SFSafariViewControllerDelegate {
var windowScene: UIWindowScene?
let viewController: UIViewController = .init()
var window: UIWindow?
window = setupWindow(windowScene: windowScene)
@MainActor
func open(_ url: URL) -> OpenURLAction.Result {
guard let windowScene else { return .systemAction }
let configuration = SFSafariViewController.Configuration()
configuration.entersReaderIfAvailable = UserPreferences.shared.inAppBrowserReaderView
window = setupWindow(windowScene: windowScene)
let safari = SFSafariViewController(url: url, configuration: configuration)
safari.preferredBarTintColor = UIColor(Theme.shared.primaryBackgroundColor)
safari.preferredControlTintColor = UIColor(Theme.shared.tintColor)
safari.delegate = self
let configuration = SFSafariViewController.Configuration()
configuration.entersReaderIfAvailable = UserPreferences.shared.inAppBrowserReaderView
DispatchQueue.main.async { [weak self] in
self?.viewController.present(safari, animated: true)
let safari = SFSafariViewController(url: url, configuration: configuration)
safari.preferredBarTintColor = UIColor(Theme.shared.primaryBackgroundColor)
safari.preferredControlTintColor = UIColor(Theme.shared.tintColor)
safari.delegate = self
DispatchQueue.main.async { [weak self] in
self?.viewController.present(safari, animated: true)
}
return .handled
}
return .handled
}
func setupWindow(windowScene: UIWindowScene) -> UIWindow {
let window = window ?? UIWindow(windowScene: windowScene)
func setupWindow(windowScene: UIWindowScene) -> UIWindow {
let window = window ?? UIWindow(windowScene: windowScene)
window.rootViewController = viewController
window.makeKeyAndVisible()
window.rootViewController = viewController
window.makeKeyAndVisible()
switch Theme.shared.selectedScheme {
case .dark:
window.overrideUserInterfaceStyle = .dark
case .light:
window.overrideUserInterfaceStyle = .light
}
switch Theme.shared.selectedScheme {
case .dark:
window.overrideUserInterfaceStyle = .dark
case .light:
window.overrideUserInterfaceStyle = .light
self.window = window
return window
}
self.window = window
return window
}
nonisolated func safariViewControllerDidFinish(_: SFSafariViewController) {
Task { @MainActor in
window?.resignKey()
window?.isHidden = false
window = nil
nonisolated func safariViewControllerDidFinish(_: SFSafariViewController) {
Task { @MainActor in
window?.resignKey()
window?.isHidden = false
window = nil
}
}
}
}
#endif
private struct WindowReader: UIViewRepresentable {
var onUpdate: (UIWindow) -> Void

View file

@ -4,10 +4,12 @@ import DesignSystem
import Env
import Models
import SwiftUI
import SwiftUIIntrospect
@MainActor
struct SideBarView<Content: View>: View {
@Environment(\.openWindow) private var openWindow
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
@Environment(AppAccountsManager.self) private var appAccounts
@Environment(CurrentAccount.self) private var currentAccount
@ -21,6 +23,8 @@ struct SideBarView<Content: View>: View {
var tabs: [Tab]
@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
@ -31,16 +35,25 @@ struct SideBarView<Content: View>: View {
}
private func makeIconForTab(tab: Tab) -> some View {
ZStack(alignment: .topTrailing) {
SideBarIcon(systemIconName: tab.iconName,
isSelected: tab == selectedTab)
let badge = badgeFor(tab: tab)
if 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 {
@ -57,18 +70,20 @@ struct SideBarView<Content: View>: View {
private var postButton: some View {
Button {
#if targetEnvironment(macCatalyst)
openWindow(value: WindowDestinationEditor.newStatusEditor(visibility: userPreferences.postVisibility))
#else
routerPath.presentedSheet = .newStatusEditor(visibility: userPreferences.postVisibility)
#endif
#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)
.help(Tab.post.title)
}
private func makeAccountButton(account: AppAccount, showBadge: Bool) -> some View {
@ -85,8 +100,19 @@ struct SideBarView<Content: View>: View {
}
} label: {
ZStack(alignment: .topTrailing) {
AppAccountView(viewModel: .init(appAccount: account, isCompact: true))
if showBadge,
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
@ -94,69 +120,95 @@ struct SideBarView<Content: View>: View {
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 {
// ensure keyboard is always dismissed when selecting a tab
hideKeyboard()
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
if tab == selectedTab {
popToRootTab = .other
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
popToRootTab = tab
}
}
}
selectedTab = tab
SoundEffectManager.shared.playSound(.tabSelection)
if tab == .notifications {
if let token = appAccounts.currentAccount.oauthToken {
userPreferences.notificationsCount[token] = 0
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)
}
}
@ -174,12 +226,14 @@ 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)
}
}

View file

@ -4,7 +4,6 @@ import Env
import Explore
import Models
import Network
import Shimmer
import SwiftUI
@MainActor
@ -22,18 +21,9 @@ struct ExploreTab: View {
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)
}
}
if UIDevice.current.userInterfaceIdiom == .pad, !preferences.showiPadSecondaryColumn {
SecondaryColumnToolbarItem()
}
ToolbarTab(routerPath: $routerPath)
}
}
.withSafariRouter()

View file

@ -5,7 +5,6 @@ import DesignSystem
import Env
import Models
import Network
import Shimmer
import SwiftUI
@MainActor
@ -25,13 +24,9 @@ struct MessagesTab: View {
.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) { _, newValue in

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

@ -21,6 +21,8 @@ struct NotificationsTab: View {
@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?
@ -31,29 +33,21 @@ struct NotificationsTab: View {
.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)
}
}
}
if UIDevice.current.userInterfaceIdiom == .pad {
if (!isSecondaryColumn && !userPreferences.showiPadSecondaryColumn) || isSecondaryColumn {
SecondaryColumnToolbarItem()
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
if isSecondaryColumn {
clearNotifications()
}
clearNotifications()
}
.withSafariRouter()
.environment(routerPath)
@ -66,6 +60,9 @@ struct NotificationsTab: View {
}
}
}
.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) {
@ -94,7 +91,7 @@ struct NotificationsTab: View {
}
private func clearNotifications() {
if isSecondaryColumn {
if selectedTab == .notifications || isSecondaryColumn {
if let token = appAccount.currentAccount.oauthToken {
userPreferences.notificationsCount[token] = 0
}

View file

@ -5,7 +5,6 @@ import DesignSystem
import Env
import Models
import Network
import Shimmer
import SwiftUI
@MainActor
@ -24,7 +23,7 @@ struct ProfileTab: View {
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(), scrollToTopSignal: $scrollToTopSignal)

View file

@ -1,9 +1,9 @@
import Account
import DesignSystem
import Env
import SwiftUI
import Account
import Network
import Models
import Network
import SwiftUI
@MainActor
struct AboutView: View {
@ -13,7 +13,7 @@ struct AboutView: View {
@State private var dimillianAccount: AccountsListRowViewModel?
@State private var iceCubesAccount: AccountsListRowViewModel?
let versionNumber: String
init() {
@ -27,26 +27,28 @@ struct AboutView: View {
var body: some View {
List {
Section {
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()
}
#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")
}
@ -55,11 +57,12 @@ struct AboutView: View {
Label("settings.support.terms-of-use", systemImage: "checkmark.shield")
}
} footer: {
Text("\(versionNumber)©2023 Thomas Ricouard")
Text("\(versionNumber)© 2024 Thomas Ricouard")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
followAccountsSection
Section {
@ -95,22 +98,25 @@ struct AboutView: View {
Text("settings.about.built-with")
.textCase(nil)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.task {
await fetchAccounts()
}
.listStyle(.insetGrouped)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.navigationTitle(Text("settings.about.title"))
.navigationBarTitleDisplayMode(.large)
.environment(\.openURL, OpenURLAction { url in
routerPath.handle(url: url)
})
#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 {
@ -118,12 +124,16 @@ struct AboutView: View {
AccountsListRow(viewModel: iceCubesAccount)
AccountsListRow(viewModel: dimillianAccount)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
} else {
Section {
ProgressView()
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
}
@ -132,18 +142,18 @@ struct AboutView: View {
group.addTask {
let viewModel = try await fetchAccountViewModel(account: "dimillian@mastodon.social")
await MainActor.run {
self.dimillianAccount = viewModel
dimillianAccount = viewModel
}
}
group.addTask {
let viewModel = try await fetchAccountViewModel(account: "icecubesapp@mastodon.online")
await MainActor.run {
self.iceCubesAccount = viewModel
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]))

View file

@ -17,9 +17,8 @@ struct AccountSettingsView: View {
@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()
@ -30,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)
@ -40,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)
@ -96,12 +95,6 @@ struct AccountSettingsView: View {
}
.listRowBackground(theme.primaryBackgroundColor)
}
.sheet(isPresented: $isEditingAccount, content: {
EditAccountView()
})
.sheet(isPresented: $isEditingFilters, content: {
FiltersListView()
})
.toolbar {
ToolbarItem(placement: .principal) {
HStack {
@ -115,7 +108,9 @@ struct AccountSettingsView: View {
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,7 +6,6 @@ import Models
import Network
import NukeUI
import SafariServices
import Shimmer
import SwiftUI
@MainActor
@ -28,6 +27,9 @@ struct AddAccountView: View {
@State private var signInClient: Client?
@State private var instances: [InstanceSocial] = []
@State private var instanceFetchError: LocalizedStringKey?
@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>()
@ -53,7 +55,9 @@ struct AddAccountView: View {
NavigationStack {
Form {
TextField("instance.url", text: $instanceName)
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
.keyboardType(.URL)
.textContentType(.URL)
.textInputAutocapitalization(.never)
@ -77,65 +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)) { _ in
// let newValue = newValue
// .replacingOccurrences(of: "http://", with: "")
// .replacingOccurrences(of: "https://", with: "")
let client = Client(server: sanitizedName)
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
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
.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) { _, newValue in
switch newValue {
case .active:
isSigninIn = false
default:
break
.onChange(of: scenePhase) { _, newValue in
switch newValue {
case .active:
isSigninIn = false
default:
break
}
}
}
}
}
@ -164,7 +179,9 @@ struct AddAccountView: View {
}
.buttonStyle(.borderedProminent)
}
#if !os(visionOS)
.listRowBackground(theme.tintColor)
#endif
}
private var instancesListView: some View {
@ -172,30 +189,65 @@ struct AddAccountView: View {
if instances.isEmpty {
placeholderRow
} else {
ForEach(sanitizedName.isEmpty ? instances : instances.filter { $0.name.contains(sanitizedName.lowercased()) }) { instance in
ForEach(instances) { instance in
Button {
instanceName = instance.name
} label: {
VStack(alignment: .leading, spacing: 4) {
Text(instance.name)
.font(.scaledHeadline)
.foregroundColor(.primary)
Text(instance.info?.shortDescription ?? "")
.font(.scaledBody)
.foregroundStyle(Color.secondary)
(Text("instance.list.users-\(instance.users)")
+ Text("")
+ Text("instance.list.posts-\(instance.statuses)"))
.font(.scaledFootnote)
.foregroundStyle(Color.secondary)
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")
@ -210,15 +262,17 @@ struct AddAccountView: View {
}
.redacted(reason: .placeholder)
.allowsHitTesting(false)
.shimmering()
.listRowBackground(theme.primaryBackgroundColor)
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private func signIn() async {
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: "")){
callbackURLScheme: AppInfo.scheme.replacingOccurrences(of: "://", with: ""))
{
await continueSignIn(url: url)
} else {
isSigninIn = false
@ -248,13 +302,3 @@ struct AddAccountView: View {
}
}
}
struct SafariView: UIViewControllerRepresentable {
let url: URL
func makeUIViewController(context _: UIViewControllerRepresentableContext<SafariView>) -> SFSafariViewController {
SFSafariViewController(url: url)
}
func updateUIViewController(_: SFSafariViewController, context _: UIViewControllerRepresentableContext<SafariView>) {}
}

View file

@ -5,6 +5,7 @@ import Models
import Network
import NukeUI
import SwiftUI
import Timeline
import UserNotifications
@MainActor
@ -12,23 +13,25 @@ struct ContentSettingsView: View {
@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) {
@ -38,20 +41,25 @@ struct ContentSettingsView: View {
}
}
}
#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)
#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
}
}
@ -76,7 +84,9 @@ struct ContentSettingsView: View {
} 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) {
@ -103,12 +113,37 @@ struct ContentSettingsView: View {
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

@ -4,9 +4,10 @@ import Env
import Models
import Network
import Observation
import Status
import StatusKit
import SwiftUI
@MainActor
@Observable class DisplaySettingsLocalValues {
var tintColor = Theme.shared.tintColor
var primaryBackgroundColor = Theme.shared.primaryBackgroundColor
@ -35,44 +36,50 @@ struct DisplaySettingsView: View {
var body: some View {
ZStack(alignment: .top) {
Form {
StatusRowView(viewModel: previewStatusViewModel)
.allowsHitTesting(false)
.opacity(0)
.hidden()
themeSection
#if !os(visionOS)
StatusRowView(viewModel: previewStatusViewModel)
.allowsHitTesting(false)
.opacity(0)
.hidden()
themeSection
#endif
fontSection
layoutSection
platformsSection
resetSection
}
.navigationTitle("settings.display.navigation-title")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.task(id: localValues.tintColor) {
do { try await Task.sleep(for: .microseconds(500)) } catch {}
theme.tintColor = localValues.tintColor
}
.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
}
examplePost
#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
}
.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
}
}
@ -121,7 +128,9 @@ struct DisplaySettingsView: View {
Text("settings.display.section.theme.footer")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var fontSection: some View {
@ -173,7 +182,9 @@ struct DisplaySettingsView: View {
d[.leading]
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
@ViewBuilder
@ -197,6 +208,11 @@ struct DisplaySettingsView: View {
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)
@ -207,55 +223,51 @@ struct DisplaySettingsView: View {
Toggle("settings.display.pending-left", isOn: $userPreferences.pendingShownLeft)
Toggle("settings.display.show-reply-indentation", isOn: $userPreferences.showReplyIndentation)
if userPreferences.showReplyIndentation {
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)
VStack {
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]
}
}
Toggle("settings.display.show-account-popover", isOn: $userPreferences.showAccountPopover)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
@ViewBuilder
private var platformsSection: some View {
@Bindable var userPreferences = userPreferences
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") {
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.followSystemColorScheme = true
theme.applySet(set: colorScheme == .dark ? .iceCubeDark : .iceCubeLight)
theme.avatarShape = .rounded
theme.avatarPosition = .top
theme.statusActionsDisplay = .full
localValues.tintColor = theme.tintColor
localValues.primaryBackgroundColor = theme.primaryBackgroundColor
localValues.secondaryBackgroundColor = theme.secondaryBackgroundColor
localValues.labelColor = theme.labelColor
theme.restoreDefault()
} label: {
Text("settings.display.restore")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var themeSelectorButton: some View {

View file

@ -1,7 +1,7 @@
import DesignSystem
import Env
import Models
import Status
import StatusKit
import SwiftUI
@MainActor
@ -17,10 +17,14 @@ struct HapticSettingsView: View {
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

@ -9,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: "")))!)!
@ -17,31 +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 alt34, alt35
case alt36
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, alt39
case alt40, alt41, alt42
case alt43, alt44, alt45, alt46, alt47, alt48, alt49
case alt38
case alt39, alt40, alt41, alt42, alt43
case alt44, alt45
case alt46
var appIconName: String {
switch self {
case .primary:
"AppIcon"
default:
"AppIconAlternate\(rawValue)"
}
}
var iconName: String {
"icon\(rawValue)"
return "AppIconAlternate\(rawValue)"
}
}
@ -51,17 +39,18 @@ 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,
.alt43, .alt44, .alt45, .alt46, .alt47]),
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) Chanhwi Joo (GitHub @te6-in)", icons: [.alt29, .alt34, .alt31, .alt35, .alt30, .alt32, .alt40]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) W. Kovács Ágnes (@wildgica)", icons: [.alt33]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) Duncan Horne", icons: [.alt36]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) BeAware@social.beaware.live", icons: [.alt37, .alt41, .alt42, .alt48, .alt49]),
IconSelector(title: "\("settings.app.icon.designed-by".localized) Simone Margio", icons: [.alt38, .alt39]),
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]),
]
}
@ -85,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 {
@ -103,7 +94,7 @@ struct IconSelectorView: View {
}
} 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)
@ -116,6 +107,7 @@ struct IconSelectorView: View {
}
}
}
.buttonStyle(.plain)
}
}
}

View file

@ -13,8 +13,10 @@ 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
}
}
@ -35,7 +37,9 @@ public struct InstanceInfoSection: View {
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") {
@ -43,7 +47,9 @@ public struct InstanceInfoSection: View {
Text(rule.text.trimmingCharacters(in: .whitespacesAndNewlines))
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
}

View file

@ -33,7 +33,9 @@ struct PushNotificationsView: View {
} footer: {
Text("settings.push.main-toggle.description")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
if subscription.isEnabled {
Section {
@ -86,7 +88,9 @@ struct PushNotificationsView: View {
Label("settings.push.new-posts", systemImage: "bubble.right")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
Section {
@ -101,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

@ -13,7 +13,7 @@ import Timeline
@MainActor
struct SettingsTabs: View {
@Environment(\.dismiss) private var dismiss
@Environment(\.modelContext) private var context
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
@Environment(PushNotificationsService.self) private var pushNotifications
@Environment(UserPreferences.self) private var preferences
@ -29,12 +29,11 @@ struct SettingsTabs: View {
@State private var timelineCache = TimelineCache()
@Binding var popToRootTab: Tab
let isModal: Bool
@Query(sort: \LocalTimeline.creationDate, order: .reverse) var localTimelines: [LocalTimeline]
@Query(sort: \TagGroup.creationDate, order: .reverse) var tagGroups: [TagGroup]
@State private var startingPoint: SettingsStartingPoint? = nil
var body: some View {
NavigationStack(path: $routerPath.path) {
Form {
@ -45,26 +44,54 @@ struct SettingsTabs: View {
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 || isModal {
ToolbarItem {
Button {
dismiss()
} label: {
Text("action.done").bold()
#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()
}
}
if UIDevice.current.userInterfaceIdiom == .pad, !preferences.showiPadSecondaryColumn {
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
@ -98,7 +125,7 @@ struct SettingsTabs: View {
.tint(.red)
}
}
AppAccountView(viewModel: .init(appAccount: account))
AppAccountView(viewModel: .init(appAccount: account), isParentPresented: .constant(false))
}
}
.onDelete { indexSet in
@ -114,7 +141,9 @@ struct SettingsTabs: View {
}
addAccountButton
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private func logoutAccount(account: AppAccount) async {
@ -144,53 +173,67 @@ 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: tagGroupsView) {
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.stack")
}
NavigationLink(destination: SwipeActionsSettingsView()) {
Label("settings.general.swipeactions", systemImage: "hand.draw")
}
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")
}
}
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)
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 {
@Bindable var preferences = preferences
Section("settings.section.other") {
#if !targetEnvironment(macCatalyst)
Picker(selection: $preferences.preferredBrowser) {
ForEach(PreferredBrowser.allCases, id: \.rawValue) { browser in
switch browser {
case .inAppSafari:
Text("settings.general.browser.in-app").tag(browser)
case .safari:
Text("settings.general.browser.system").tag(browser)
Section {
#if !targetEnvironment(macCatalyst)
Picker(selection: $preferences.preferredBrowser) {
ForEach(PreferredBrowser.allCases, id: \.rawValue) { browser in
switch browser {
case .inAppSafari:
Text("settings.general.browser.in-app").tag(browser)
case .safari:
Text("settings.general.browser.system").tag(browser)
}
}
} label: {
Label("settings.general.browser", systemImage: "network")
}
} label: {
Label("settings.general.browser", systemImage: "network")
}
Toggle(isOn: $preferences.inAppBrowserReaderView) {
Label("settings.general.browser.in-app.readerview", systemImage: "doc.plaintext")
}
.disabled(preferences.preferredBrowser != PreferredBrowser.inAppSafari)
#endif
Toggle(isOn: $preferences.inAppBrowserReaderView) {
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")
}
@ -203,25 +246,31 @@ struct SettingsTabs: View {
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 !targetEnvironment(macCatalyst)
NavigationLink(destination: IconSelectorView()) {
Label {
Text("settings.app.icon")
} icon: {
let icon = IconSelectorView.Icon(string: UIApplication.shared.alternateIconName ?? "AppIcon")
Image(uiImage: .init(named: icon.iconName)!)
.resizable()
.frame(width: 25, height: 25)
.cornerRadius(4)
#if !targetEnvironment(macCatalyst) && !os(visionOS)
NavigationLink(destination: IconSelectorView()) {
Label {
Text("settings.app.icon")
} icon: {
let icon = IconSelectorView.Icon(string: UIApplication.shared.alternateIconName ?? "AppIcon")
Image(uiImage: .init(named: icon.appIconName)!)
.resizable()
.frame(width: 25, height: 25)
.cornerRadius(4)
}
}
}
#endif
#endif
Link(destination: URL(string: "https://github.com/Dimillian/IceCubesApp")!) {
Label("settings.app.source", systemImage: "link")
@ -252,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 {
@ -280,61 +331,6 @@ struct SettingsTabs: View {
}
}
private var tagGroupsView: 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])
}
}
.listRowBackground(theme.primaryBackgroundColor)
Button {
routerPath.presentedSheet = .addTagGroup
} label: {
Label("timeline.filter.add-tag-groups", systemImage: "plus")
}
.listRowBackground(theme.primaryBackgroundColor)
}
.navigationTitle("timeline.filter.tag-groups")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.toolbar {
EditButton()
}
}
private var remoteLocalTimelinesView: some View {
Form {
ForEach(localTimelines) { timeline in
Text(timeline.instance)
}.onDelete { indexes in
if let index = indexes.first {
context.delete(localTimelines[index])
}
}
.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)
.toolbar {
EditButton()
}
}
private var cacheSection: some View {
Section("settings.section.cache") {
if cachedRemoved {
@ -349,6 +345,8 @@ struct SettingsTabs: View {
}
}
}
#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,7 +1,6 @@
import DesignSystem
import Env
import RevenueCat
import Shimmer
import SwiftUI
@MainActor
@ -69,23 +68,25 @@ struct SupportAppView: View {
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
fetchStoreProducts()
refreshUserInfo()
}
#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 {
@ -151,7 +152,9 @@ struct SupportAppView: View {
Text("settings.support.message-from-dev")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var subscriptionSection: some View {
@ -188,7 +191,9 @@ struct SupportAppView: View {
Text("settings.support.supporter.subscription-info")
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var tipsSection: some View {
@ -213,7 +218,9 @@ struct SupportAppView: View {
}
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
private var restorePurchase: some View {
@ -232,7 +239,9 @@ struct SupportAppView: View {
} footer: {
Text("settings.support.restore-purchase.explanation")
}
#if !os(visionOS)
.listRowBackground(theme.secondaryBackgroundColor)
#endif
}
private var linksSection: some View {
@ -252,7 +261,9 @@ struct SupportAppView: View {
.buttonStyle(.borderless)
}
}
#if !os(visionOS)
.listRowBackground(theme.secondaryBackgroundColor)
#endif
}
private var loadingPlaceholder: some View {
@ -268,6 +279,5 @@ struct SupportAppView: View {
}
.redacted(reason: .placeholder)
.allowsHitTesting(false)
.shimmering()
}
}

View file

@ -46,7 +46,9 @@ struct SwipeActionsSettingsView: View {
} footer: {
Text("settings.swipeactions.status.explanation")
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Section {
Picker(selection: $userPreferences.swipeActionsIconStyle, label: Text("settings.swipeactions.icon-style")) {
@ -62,11 +64,15 @@ struct SwipeActionsSettingsView: View {
} 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 createStatusActionPicker(selection: Binding<StatusAction>, label: LocalizedStringKey) -> some View {

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

@ -11,17 +11,16 @@ struct TranslationSettingsView: View {
var body: some View {
Form {
deepLToggle
if preferences.alwaysUseDeepl {
translationSelector
if preferences.preferredTranslationType == .useDeepl {
Section("settings.translation.user-api-key") {
deepLPicker
SecureField("settings.translation.user-api-key", text: $apiKey)
.textContentType(.password)
}
.onAppear {
readValue()
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
if apiKey.isEmpty {
Section {
@ -30,27 +29,54 @@ struct TranslationSettingsView: View {
.foregroundColor(.red)
}
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
}
backgroundAPIKey
autoDetectSection
}
.navigationTitle("settings.translation.navigation-title")
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.onChange(of: apiKey) {
writeNewValue()
}
.onAppear(perform: updatePrefs)
#if !os(visionOS)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
.onChange(of: apiKey) {
writeNewValue()
}
.onAppear(perform: updatePrefs)
.onAppear(perform: readValue)
}
@ViewBuilder
private var deepLToggle: some View {
private var translationSelector: some View {
@Bindable var preferences = preferences
Toggle(isOn: $preferences.alwaysUseDeepl) {
Text("settings.translation.always-deepl")
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
@ -72,6 +98,34 @@ struct TranslationSettingsView: View {
} 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() {
@ -83,11 +137,7 @@ struct TranslationSettingsView: View {
}
private func readValue() {
if let apiKey = DeepLUserAPIHandler.readIfAllowed() {
self.apiKey = apiKey
} else {
apiKey = ""
}
apiKey = DeepLUserAPIHandler.readKey()
}
private func updatePrefs() {

View file

@ -1,15 +1,22 @@
import Account
import AppIntents
import DesignSystem
import Explore
import Foundation
import Status
import StatusKit
import SwiftUI
@MainActor
enum Tab: Int, Identifiable, Hashable {
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
nonisolated var id: Int {
rawValue
@ -19,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)
@ -39,9 +42,9 @@ 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:
@ -50,6 +53,26 @@ enum Tab: Int, Identifiable, Hashable {
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()
}
@ -57,29 +80,47 @@ 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()
""
}
}
@ -105,8 +146,127 @@ enum Tab: Int, Identifiable, Hashable {
"gear"
case .profile:
"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:
""
}
}
}
@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

@ -4,10 +4,9 @@ import Env
import Models
import Network
import NukeUI
import Shimmer
import SwiftUI
import SwiftData
import SFSafeSymbols
import SwiftData
import SwiftUI
@MainActor
struct EditTagGroupView: View {
@ -39,7 +38,9 @@ struct EditTagGroupView: View {
focusedField: $focusedField
)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
Section("add-tag-groups.edit.tags") {
TagsInputView(
@ -48,37 +49,39 @@ struct EditTagGroupView: View {
focusedField: $focusedField
)
}
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
#endif
}
.formStyle(.grouped)
.navigationTitle(
isNewGroup
? "timeline.filter.add-tag-groups"
: "timeline.filter.edit-tag-groups"
? "timeline.filter.add-tag-groups"
: "timeline.filter.edit-tag-groups"
)
.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(.interactively)
#endif
.toolbar {
CancelToolbarItem()
ToolbarItem(placement: .navigationBarTrailing) {
Button("action.save", action: { save() })
.disabled(!tagGroup.isValid)
}
}
ToolbarItem(placement: .navigationBarTrailing) {
Button("action.save", action: { save() })
.disabled(!tagGroup.isValid)
.onAppear {
focusedField = .title
}
}
.onAppear {
focusedField = .title
}
}
}
init(tagGroup: TagGroup = .emptyGroup(), onSaved: ((TagGroup) -> Void)? = nil) {
self._tagGroup = State(wrappedValue: tagGroup)
_tagGroup = State(wrappedValue: tagGroup)
self.onSaved = onSaved
self.isNewGroup = tagGroup.title.isEmpty
isNewGroup = tagGroup.title.isEmpty
}
private func save() {
@ -101,7 +104,7 @@ struct AddTagGroupView_Previews: PreviewProvider {
let container = try? ModelContainer(for: TagGroup.self, configurations: ModelConfiguration())
// need to use `sheet` to show `symbolsSuggestionView` in preview
return Text("parent view for EditTagGroupView")
return Text(verbatim: "parent view for EditTagGroupView")
.sheet(isPresented: .constant(true)) {
EditTagGroupView()
.withEnvironments()
@ -320,7 +323,7 @@ private struct SymbolSearchResultsView: View {
.onAppear {
results = TagGroup.searchSymbol(for: symbolQuery, exclude: selectedSymbol)
}
case .invalid(let description):
case let .invalid(description):
Text(description)
.font(.subheadline)
.foregroundStyle(.secondary)
@ -335,6 +338,7 @@ private struct SymbolSearchResultsView: View {
}
// MARK: search results validation
enum ValidationStatus: Equatable {
case valid
case invalid(description: LocalizedStringKey)
@ -342,22 +346,23 @@ private struct SymbolSearchResultsView: View {
var validationStatus: ValidationStatus {
if results.isEmpty {
if symbolQuery == selectedSymbol
&& !symbolQuery.isEmpty
&& results.count == 0
if symbolQuery == selectedSymbol,
!symbolQuery.isEmpty,
results.count == 0
{
return .invalid(description: "\(symbolQuery) add-tag-groups.edit.tags.field.warning.search-results.already-selected")
.invalid(description: "\(symbolQuery) add-tag-groups.edit.tags.field.warning.search-results.already-selected")
} else {
return .invalid(description: "add-tag-groups.edit.tags.field.warning.search-results.no-symbol-found")
.invalid(description: "add-tag-groups.edit.tags.field.warning.search-results.no-symbol-found")
}
} else {
return .valid
.valid
}
}
}
extension TagGroup {
// MARK: title validation
enum TitleValidationStatus: Equatable {
case valid
case invalid(description: LocalizedStringKey)
@ -365,11 +370,12 @@ extension TagGroup {
var titleValidationStatus: TitleValidationStatus {
title.isEmpty
? .invalid(description: "add-tag-groups.edit.title.field.warning.empty-title")
: .valid
? .invalid(description: "add-tag-groups.edit.title.field.warning.empty-title")
: .valid
}
// MARK: symbolName validation
enum SymbolNameValidationStatus: Equatable {
case valid
case invalid(description: LocalizedStringKey)
@ -386,6 +392,7 @@ extension TagGroup {
}
// MARK: tags validation
enum TagsValidationStatus: Equatable {
case valid
case invalid(description: LocalizedStringKey)
@ -399,19 +406,22 @@ extension TagGroup {
}
// MARK: TagGroup validation
var isValid: Bool {
titleValidationStatus == .valid
&& symbolNameValidationStatus == .valid
&& tagsValidationStatus == .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: [])
}
@ -419,9 +429,9 @@ extension TagGroup {
static func searchSymbol(for query: String, exclude excludedSymbol: String) -> [String] {
guard !query.isEmpty else { return [] }
return Self.allSymbols.filter {
return allSymbols.filter {
$0.contains(query) &&
$0 != excludedSymbol
$0 != excludedSymbol
}
}
@ -432,7 +442,7 @@ extension TagGroup {
extension Text {
func warningLabel() -> Text {
self.font(.caption)
font(.caption)
.foregroundStyle(.red)
}
}

View file

@ -4,7 +4,6 @@ import Env
import Models
import Network
import NukeUI
import Shimmer
import SwiftUI
@MainActor
@ -52,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 {
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)
}
}
}
}
}

View file

@ -29,6 +29,7 @@ struct TimelineTab: View {
@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
@ -41,6 +42,7 @@ struct TimelineTab: View {
var body: some View {
NavigationStack(path: $routerPath.path) {
TimelineView(timeline: $timeline,
pinnedFilters: $pinnedFilters,
selectedTagGroup: $selectedTagGroup,
scrollToTopSignal: $scrollToTopSignal,
canFilterTimeline: canFilterTimeline)
@ -49,7 +51,7 @@ struct TimelineTab: View {
.toolbar {
toolbarView
}
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.50), for: .navigationBar)
.toolbarBackground(theme.primaryBackgroundColor.opacity(0.30), for: .navigationBar)
.id(client.id)
}
.onAppear {
@ -92,8 +94,10 @@ struct TimelineTab: View {
lastTimelineFilter = newValue
}
switch newValue {
case .tagGroup:
break
case let .tagGroup(title, _, _):
if let group = tagGroups.first(where: { $0.title == title }) {
selectedTagGroup = group
}
default:
selectedTagGroup = nil
}
@ -119,86 +123,14 @@ struct TimelineTab: View {
@ViewBuilder
private var timelineFilterButton: some View {
if timeline.supportNewestPagination {
Button {
timeline = .latest
} label: {
Label(TimelineFilter.latest.localizedTitle(), systemImage: TimelineFilter.latest.iconName() ?? "")
}
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")
}
}
Button {
routerPath.presentedSheet = .listCreate
} label: {
Label("account.list.create", systemImage: "plus")
}
}
}
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(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")
}
}
Menu("timeline.filter.tag-groups") {
ForEach(tagGroups) { group in
Button {
selectedTagGroup = group
timeline = .tagGroup(title: group.title, tags: group.tags)
} 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")
}
}
headerGroup
timelineFiltersButtons
listsFiltersButons
tagsFiltersButtons
localTimelinesFiltersButtons
tagGroupsFiltersButtons
Divider()
contentFilterButton
}
private var addAccountButton: some View {
@ -218,17 +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)
if UIDevice.current.userInterfaceIdiom == .pad, !preferences.showiPadSecondaryColumn {
SecondaryColumnToolbarItem()
}
ToolbarTab(routerPath: $routerPath)
} else {
ToolbarItem(placement: .navigationBarTrailing) {
addAccountButton
@ -264,10 +186,145 @@ 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 {
} 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.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
IceCubesApp/Assets.xcassets/AppIcon.appiconset/1024.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 KiB

After

Width:  |  Height:  |  Size: 991 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,211 +1,67 @@
{
"images" : [
{
"filename" : "40.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "60.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "87.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "80.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "57.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "57x57"
},
{
"filename" : "114.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "57x57"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "40.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "40.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "80.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "50.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "50x50"
},
{
"filename" : "100.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "50x50"
},
{
"filename" : "72.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "72x72"
},
{
"filename" : "144.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "72x72"
},
{
"filename" : "76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "152.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "167.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"filename" : "Icon-16.png",
"filename" : "macos16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "Icon-32.png",
"filename" : "macos32 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "Icon-32 1.png",
"filename" : "macos32.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "Icon-64.png",
"filename" : "macos64.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "Icon-128.png",
"filename" : "macos128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "Icon-256 1.png",
"filename" : "mac256 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "Icon-256.png",
"filename" : "mac256.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "Icon-512 1.png",
"filename" : "macOS512 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "Icon-512.png",
"filename" : "macOS512.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "Icon-1024.png",
"filename" : "macOS1024.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 749 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 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

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

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

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