Commit graph

161 commits

Author SHA1 Message Date
Thomas Ricouard 5a2478c791
VisionOS native support (#1758)
* Initial support

* UI Adjustments

* WIP icons

* More UI
2023-12-19 09:51:20 +01:00
Thomas Ricouard 8ff3e22d9f SwiftFormat 2023-12-18 08:22:59 +01:00
Thai D. V 81ba1e9bee
Add Select Status Text Action (#1731)
* add select text action

* Fixes

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-12-14 06:46:16 +01:00
Thai D. V 2e350f5fce
move environment runtime check to compile time (#1709) 2023-12-06 06:41:26 +01:00
Thomas Ricouard 76219f553b Add tag status indicator for home timeline 2023-12-04 09:52:18 +01:00
Hugo Saynac 69d5f265fe
Improve indentation level design for indentations level > 1 (#1695) 2023-11-29 09:02:01 +01:00
Thai D. V ea5480ef46
add account popovers for display name and handle (#1687) 2023-11-27 09:00:52 +01:00
Thomas Ricouard 47d54fd9e6 Fixes 2023-11-20 17:20:09 +01:00
Thai D. V 94172cef27
Feature: popover the account overview when hovering on the avatar (#1682)
* fix avatar scale

* refactor avatar  config data

* add `AvatarView_Previews`

* refactor shape and placeholder of avatar

* refactor `AvatarView` and add `AvatarPopup`

* add `hoverEffect` for iPad

* fix auto-dismiss bug

* fix `showPopup` bug

* disable inappropriate avatar popups
2023-11-20 10:59:49 +01:00
Paul Schuetz 8bf36709ea
Fix reply indentation when the post has pictures (#1678)
The size of the image is now set correctly to prevent the shifting of the
vertical bars. The handling of the compact view (regarding the indentation) is
now centrally handled in StatusDetailView.
2023-11-19 08:10:44 +01:00
Thomas Ricouard c1c7c666cb Disable indentation in compact post 2023-11-18 10:44:27 +01:00
Paul Schuetz 59e5eba860
Improve the display of replies (#1672)
Threads/replies are now shown more clearly. Each reply has an indentation level
(and therefore the number of vertical lines) one more than its direct parent.
This leads to siblings having the same indentation level. It makes
understanding somewhat complex thread structures way easier. Previously, a
reply was only indented if it came directly after its parent. If a toot had
more than one reply, the structure was nearly indecipherable, as it wasn't
clear which the parent post of the second (or later) toot was. An example is
"https://mastodon.social/@mhoye/110452462852364819" and all of its replies.

Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
2023-11-16 09:56:00 +01:00
Thomas Ricouard f451d7cb8c Bigger media viewer window 2023-11-14 19:48:14 +01:00
Théo Arrouye 4266ac4b42
Improve SoundEffectManager & HapticManager (#1662)
* Remove unnecessary vars and switches

* Improve SoundEffectManager call-site API

* Improve HapticManager call-site API
2023-11-07 11:22:36 +01:00
Thomas Ricouard 3e3c69c41c format 2023-11-01 18:58:44 +01:00
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