Commit graph

146 commits

Author SHA1 Message Date
Thomas Ricouard 07bfd8cd0e Initial macOS Catalyst support 2023-10-23 19:12:25 +02:00
Thomas Ricouard fd55020533 New media viewer 2023-10-16 19:08:59 +02:00
Thomas Ricouard 017275ec69 Fix status embed 2023-10-16 09:26:49 +02:00
Thomas Ricouard f9c0355f1d Convert Theme to Observable 2023-09-18 21:03:52 +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 98035e8530 Better status focused screen transition 2023-09-16 15:04:42 +02:00
Thomas Ricouard 8a3c971402 Swiftformat 2023-09-16 14:15:03 +02:00
Chanhwi Joo 5fb9ab1c5e
Fix quote button not showing for unlisted posts (#1537) 2023-08-10 08:58:43 +02:00
Thomas Ricouard a2fe0511e0 Run swiftformat 2023-07-19 07:46:25 +02:00
Nathan Reed 194e3aea74
Add feature to block or mute user directly from post (#1460)
* Make status context menu button frame tap target larger

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

* Add feature to block or mute user directly from post

To avoid calling the /accounts/relationships endpoint for every single status displayed, the data is only loaded when the menu is activated.
When the API call comes back, the items are added to the menu (updating the view model appears to cause the menu to update, even while it is displayed)
Borrowed blocking & muting logic/menu items from AccountDetailContextMenu.
2023-07-03 07:40:49 +02:00
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 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
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
Chris Kolbu 3a3d0a7b55
Fix: Inline StatusRowView accessibilityLabel modifier to avoid flashing (#1278)
* Inline StatusRowView accessibilityLabel modifier

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

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

* Inline StatusRowView accessibilityLabel modifier

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

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

* Wrap

---------

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

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

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

* Improve the accessibility of the AccountDetailHeaderView

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

This commit also handles the checkmark for supporter users

* Tweak accessibility of Profile CustomInfoLabels

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

* Make Profile tab header image into a Button

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

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

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

“More” is considered overly generic.

This commit also adds two additional user input label options

* Add accessibility labels for the Profile tab `Picker`

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

* Remove StatusRowView swipe actions if VoiceOver is running

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

* Fix typo in StatusRowView.accessibilityActions

* Add accessibilityLabels to all StatusRowActionsView actions

* Provide explicit combined accessibility label for unfocused StatusRowView

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

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

* Improve accessibility of StatusRow(Reblog|Reply)View

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

* Add missing punctuation to accessibility hints

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

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

* Prefer spoiler warning for StatusRowView accessibility label

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

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

* Represent `FollowButton` elements as Toggles to accessibility

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

* Remove errant comment

* Add “Verified” accessibilityValue to profile fields

* Fix bug StatusRowView default action bug affecting VoiceOver users

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

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

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

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

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

* Add accessibility container that contextualises the user-defined fields

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

* Improve StatusRowView combined accessibility label

It will now start with:

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

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

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

* Revert changes from ZStack with tap gesture to Button

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

* Add image alt text to StatusRowView and StatusRowMediaPreviewView

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

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

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

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

* Add header trait to Profile “pinned post”

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

* Replace spaces with commas in StatusRowView.combinedAccessibilityLabel
2023-03-19 16:27:18 +01:00
Thomas Ricouard 6c307aba63 SwiftFormat 2023-03-13 13:38:28 +01:00
Thomas Ricouard 6f484fa6c5 Status row: fix navigating to account from remote timeline 2023-03-12 08:04:20 +01:00
Thomas Ricouard 58957c779a Align reblog / reply view in leading mode Fix #1186 2023-03-07 07:10:57 +01:00
Thomas Ricouard df80321433 StatusRow: Remove client env object 2023-03-02 21:16:03 +01:00
Thomas Ricouard 37ed178c3f Various fixes + fix Explore navigation 2023-03-02 20:15:07 +01:00
Thomas Ricouard 15b7954705 StatusRowViewModel: Cleanup 2023-03-02 06:56:25 +01:00
Thomas Ricouard 43a4551d9b StatusRow: Flatify the hierarchy to work around iOS 16.4 issues 2023-03-01 17:34:03 +01:00
Thomas Ricouard f93e4063f2 Consistent favorites / boosts / bookmark state / count for statuses + refactor close #889 2023-02-28 06:58:52 +01:00
Thomas Ricouard 29aaa7c5cb Optimisations: Autoclosure for StatusRowViewModel 2023-02-24 13:25:21 +01:00
Thomas Ricouard a4910037b8 Swiftformat . 2023-02-22 19:09:39 +01:00
Daniel Dickison bdf5d3c783
Always show buttons on focus status (#1015)
I think it's helpful to have the buttons and their numeric badges visible when showing a status detail view for the focused status, even if the user has opted to hide them in timeline display settings.

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-22 19:00:29 +01:00
Thomas Ricouard c8c7f2d29d Don't include post actions button in capture mode 2023-02-22 18:49:17 +01:00
Thomas Ricouard ca4e80101f Swiftformat 2023-02-18 07:26:48 +01:00
Thomas Ricouard f09781582f Various optimizations to views & images rendering 2023-02-17 18:17:51 +01:00
Thomas Ricouard a3744525df StatusRow: Split into proper view struct 2023-02-17 13:30:56 +01:00
Thomas Ricouard 41fdb3adde Various timeline fixes for smoother scrolling 2023-02-16 08:52:11 +01:00
Thomas Ricouard ba7b76f5a1 Various optimizations for StatusRow 2023-02-15 19:27:26 +01:00
Thomas Ricouard c40ca6eb4d Fix filtered / hidden view for status 2023-02-15 19:10:34 +01:00
Thomas Ricouard d958d10036 Remove Client and RouterPath from StatusRowView env object 2023-02-15 08:46:14 +01:00
Chanhwi Joo af61ff7914
Improve swipe actions (#825)
* Remove icons from settings

* Add new toggle for using the theme tint

* Localizations

* Add icon style picker

* Localizations

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-14 07:01:55 +01:00
Thomas Ricouard 9867faa6de Show inline actions for remote local timeline + fetch remote status 2023-02-13 06:48:29 +01:00
Thomas Ricouard ef37db496c Swiftformat 2023-02-12 18:24:09 +01:00
Paul Schuetz cd3c50e151
Automatically detect language of posts, improve language detection when posting (#800)
* Use language detection to translate posts

The source language of a post is now determined via Apples internal language
detection, translation from the transmitted language is still possible.

* Make language detection posting more accessible

Language recognition is now always applied before posting, even if the user has
explicitly selected a different language. However, the user is always asked in
which of the two languages he wants to post.

* Add localizations

* Remove language detection in the timeline for now

The language detection in the timeline is for now removed to increase
timeline-performance.

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

* Show translate button even if no language is sent

The translate-button is shown even if no language is sent with the post.

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

* Adjust to new commits on main

Adjustments are made in regards to new developments on main.

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

---------

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-12 18:23:29 +01:00
Thomas Ricouard eb6050a38f Swiftformat 2023-02-12 16:29:41 +01:00
Thomas Ricouard 41058919bd Reworked translate: Use Mastodon API when available + always show the action in the post context menu 2023-02-12 13:22:36 +01:00
Chanhwi Joo 0b3319c2e1
Improve swipe actions and settings (#808)
* Remove an unnecessary space from string

settings.swipeactions.status.trailing

* Make SwipeActionsSettingsView to be consistent with others

* Divide none as another section

* Add icons

* Make hollow icons work

* Show different button label by its status

* Use different colors by actions

* Fix swapped icons in settings

* Refactor
2023-02-12 10:37:09 +01:00
Thomas Ricouard 9b21ac3e95 Fix 2023-02-11 22:17:46 +01:00
Peter-Josef Meisch 124aeef7fb
swipe actions improvements (#785)
* swipe actions improvements

* use old values as default settings

* Polish swipe actions settings

* Fix background color

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-11 21:48:08 +01:00
Thomas Ricouard feefb02456 Status detail: Switch to List container + refactor to something much better 2023-02-10 18:21:05 +01:00
Thomas Ricouard b963a74dc4 Menu is back close #757 2023-02-10 08:10:10 +01:00
Thomas Ricouard 5b7bfba444 More optimizations to StatusRowView 2023-02-09 12:24:18 +01:00
Thomas Ricouard 013410a80e Faster / Cached ServerDate decoding 2023-02-09 09:12:44 +01:00