Commit graph

186 commits

Author SHA1 Message Date
Thomas Ricouard
fd55020533 New media viewer 2023-10-16 19:08:59 +02:00
Thomas Ricouard
23a83d69cc Remove legacy migrations 2023-10-01 09:48:27 +02:00
Paul Schuetz
0b5e764556
Automatically remove spaces in server names (#1600)
* Automatically remove spaces in server names

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

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

* Format

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-10-01 09:37:09 +02:00
Thomas Ricouard
4870b202d6 Migrate TagGroup to SwiftData 2023-09-22 19:33:53 +02:00
Thomas Ricouard
527d982dce Migrate LocalTimeline to SwiftData 2023-09-22 12:49:25 +02:00
Thomas Ricouard
4189a59cf6
iOS 17+ only support + migrating to Observation framework (#1571)
* Initial iOS 17 + Observable migration

* More Observation

* More observation

* Checkpoint

* Checkpoint

* Bump version to 1.8.0

* SwiftFormat

* Fix home timeline switch on login

* Fix sidebar routerPath

* Fixes on detail view

* Remove print changes

* Simply detail view

* More opt

* Migrate DisplaySettingsLocalValues

* Better post detail transition

* Status detail animation finally right

* Cleanup
2023-09-18 07:01:23 +02:00
Thomas Ricouard
8a3c971402 Swiftformat 2023-09-16 14:15:03 +02:00
Thomas Ricouard
8e3584ee79 Upgrade to Swift tools version 5.9 + strict Swift concurrency everywhere 2023-09-15 12:46:15 +02:00
Grant McSheffrey
077b0d269d
Bugfix 1459 - Escape ~ character as markdown (#1561)
* Add simple test for escaping markdown content in statuses

* Add ~ as markdown character to be escaped in statuses

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

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

* Add basic test for creating HTMLString objects

* Encode link paths and queries when parsing statuses

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

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

* Only encode link URLs as a backup

If a URL can be created from a status href, don't try URL encoding
it as this could result in double encoding. Only encode the string
if the creation of a URL fails. This is also more efficient.
2023-08-23 07:08:12 +02:00
Alessio Maffeis
d7c3a54b56
Update placeholder text (#1516)
* Update placeholder text

* Add newline
2023-07-20 14:27:18 +02:00
Thomas Ricouard
bb4453c811 Scrollable + interactive Tag Group timeline header 2023-07-19 08:30:47 +02:00
Thomas Ricouard
a2fe0511e0 Run swiftformat 2023-07-19 07:46:25 +02:00
Alejandro Martínez
5951bcec38
Tag groups (#1506)
* Implemented tag groups

* Cleanup

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-07-19 07:44:35 +02:00
Thomas Ricouard
a97868cab7 Fixes for bluesky bridge support 2023-07-04 08:37:30 +02:00
Thomas Ricouard
8eb9daac3e Fix ISO 639 languages 2023-04-25 15:39:17 +02:00
Chris Kolbu
7391c12644
Accessibility fix for Timeline StatusRowView and Status detail (#1355)
* Add StatusRowView accessibility action to open media attachment viewer

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

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

* Work around initial accessibility focus bug in StatusDetailView

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

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

* Respect filters in Timeline combined accessibility label

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

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-04-04 08:12:25 +02:00
Thomas Ricouard
2601764b28 Poll: Support hidden votesCount close #1354 2023-04-04 08:03:33 +02:00
Chris Kolbu
db81486f14
Restore HTMLString link parsing (#1347) 2023-04-01 15:47:12 +02:00
Thomas Ricouard
d3888d8c40 Accessibility: Disable links parsing for now 2023-03-30 16:29:44 +02:00
Chris Kolbu
9e347c75b9
Timeline & Timeline detail accessibility uplift (#1323)
* Improve accessibility of StatusPollView

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

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

* Add poll description in StatusRowView combinedAccessibilityLabel

This largely duplicates the logic in `StatusPollView`.

* Improve accessibility of media attachments

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

Now, they are presented with their attachment type.

* Change accessibilityRepresentation of AppAcountsSelectorView

* Change Notifications tab title view accessibility representation to Menu

Previously it would present as a button

* Hide layout `Rectangle`s from accessibility

* Consolidate `StatusRowDetailView` accessibility representation

* Improve readability of Poll accessibility label

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

* Improve accessibility of StatusRowCardView

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

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

* Improve accessibility of StatusRowHeaderView

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

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

It also has custom actions corresponding to its context menu

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

* Provide context for the application name

* Add pauses to StatusRowView combinedAccessibilityLabel

* Hide `TimelineView.scrollToTopView` from accessibility

* Set appropriate font style on Notification header

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

* Fix bug in accessibilityRepresentation of TimelineView nav bar title

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

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

* Ensure TextView responds to Environment.sizeCategory

This resolves #1309

* Fix button

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-28 18:48:58 +02:00
Thomas Ricouard
efb255eb62 Display settings: keep example post on the top 2023-03-26 19:19:59 +02:00
Chris Kolbu
b2f594f174
Accessibility tweaks + Notifications and Messages tab uplift (#1292)
* Improve StatusRowView accessibility actions

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

Now, these are added to the Actions rotor

* Hide `topPaddingView`s from accessibility

* Fix accessible header rendering in non-filterable TimelineViews

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

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

* Combine tagHeaderView text elements

Previously, these were two separate items

* Prefer shorter Quote action label

* Improve accessibility of StatusEmbeddedView

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

* Add haptics to StatusRowView accessibility actions

* Improve accessibility of ConversationsListRow

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

* Remove StatusRowView accessibilityActions if viewModel.showActions is false

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

* Combine NotificationRowView accessibility elements; add user actions

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

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

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

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

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-03-24 07:52:29 +01:00
Paul Schuetz
da0b92e13d
Allow translation of an account bio/note (#1276)
The bio (note) of an account can now be translated via DeepL. If the user has
put in his own DeepL API key, that is used, otherwise, the standard one is
used. See #1267

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-03-19 16:18:13 +01:00
Thomas Ricouard
aa120a48f7 ServerError: Fix 2023-03-13 13:42:32 +01:00
Thomas Ricouard
6c307aba63 SwiftFormat 2023-03-13 13:38:28 +01:00
Peter-Josef Meisch
db5d0b9274
Display and edit filter expirations (#1141) 2023-03-03 08:15:34 +01:00
Thomas Ricouard
37ed178c3f Various fixes + fix Explore navigation 2023-03-02 20:15:07 +01:00
Thomas Ricouard
30de766777 Remove Atomics 2023-02-27 06:40:30 +01:00
Jim Dovey
d1209e6704
Updated to resolve all possible Sendability warnings from Swift 6 compatibility mode. (#1072)
Co-authored-by: Jim Dovey <jimdovey@apple.com>
2023-02-27 06:39:07 +01:00
Thomas Ricouard
347335f770 Move userMentioned outside of Status 2023-02-26 09:38:26 +01:00
Thomas Ricouard
83e4e74329 Swiftformat 2023-02-26 06:45:57 +01:00
Paul Schuetz
06629cc397
Enhance the context menu for private messages (#1053)
* Enhance the message context menu

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

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

* Add options to the conversation list context menu

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

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

* Remove child view models

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

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

* Make unmodified var let

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

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

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-02-26 06:45:31 +01:00
Thomas Ricouard
63ff87f640 Move languages into Models 2023-02-24 08:24:51 +01:00
Thomas Ricouard
096e42b1c2 Profile edit: Add metadata editing 2023-02-24 07:55:24 +01:00
Thomas Ricouard
a4910037b8 Swiftformat . 2023-02-22 19:09:39 +01:00
Alex Grebenyuk
37a69650ef
Remove capture mode for images (#996)
* Remove capture mode for images

* Simplify how processor is created in StatusRowMediaPreviewView

* Optimize StatusViewId further
2023-02-22 07:09:56 +01:00
Thomas Ricouard
5d3b378373 Fix Equatable impl for Status and Account (thanks class) 2023-02-21 12:35:07 +01:00
Thomas Ricouard
b259b6739e Swiftformat 2023-02-21 07:23:42 +01:00
Peter-Josef Meisch
6aeb25885c
Fix display of multiple vote polls (#967)
Closes #952
2023-02-21 07:05:21 +01:00
Alex Grebenyuk
5faf793fe2
Optimize viewId (#942) 2023-02-19 07:25:27 +01:00
Thomas Ricouard
4000dc3650 Switch to targeted Swift concurrency warnings + fix them 2023-02-18 22:51:44 +01:00
Thomas Ricouard
b1424aadd0 Fix two crashes 2023-02-18 17:08:32 +01:00
Yusuke Arakawa
8d8955ee13
Fix leak memory (Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)) (#917)
Closes: #829

Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-18 08:53:11 +01:00
Thomas Ricouard
ca4e80101f Swiftformat 2023-02-18 07:26:48 +01:00
Alex Grebenyuk
dcf03b0f88
Status as class (performance improvement) (#925)
* Status as class (performance improvement)

* Also make account class

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-18 07:15:57 +01:00
Gareth Simpson
c1205036a2
This simplifies the parser. Having read the spec more closely as part of investigating bug 855, I was overcomplicating it. The server promises to send html so we should render it that way, not with heuristics. (#900)
This puts in line breaks exclusively where there are <br>s and takes out other line breaks that are in the body text.

*Doesn't* fix bug 855
2023-02-17 06:31:24 +01:00
Thomas Ricouard
ac32410200 Proper threading UI 2023-02-16 17:07:52 +01:00
Yusuke Arakawa
7bbe3cbc41
Fixed non-existing Json key decoding error (#832)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2023-02-14 12:19:23 +01:00
Thomas Ricouard
3d96d6997d Better handling of notifications 2023-02-13 22:30:06 +01:00