* 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.
* 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.
* Allow specifying the visibility of replies
Replies can now have their own default visibility. This visibility is always at
least as restrictive as the default post visibility. When posting a reply, the
visibility is pre-populated with the more restrictive out of the default and
the visibility of the original post.
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
* Use iOS-specific modifier
If the app is run on iOS 17, the new onChange(...)-modifier is used.
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
* Restrict the extension of the onChange-Modifier
The extension of the view to allow the use of the version-appropriate
onChange-modifier is now only available in the relevant file.
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
* Reset to use Xcode 14 / iOS 16
The iOS 17 specific changes are removed to allow building in the older Xcode 14.
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
* Make the default reply visibility public
The standard default reply visibility is now public, the behavior of the app
isn't changed for a user who just updated.
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
---------
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
* 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.
* Add setting to control share button default behavior
This adds a setting to control the behavior of the share button on the status row actions view.
Currently, it always shares the link to the post as well as the post text.
In iOS 16.4, Apple added iMessage unfurling for Mastodon URLs.
When sharing posts from Ice Cubes via iMessage, this leads to the recipient seeing two copies of the post: one from the unfurled link and one from Ice Cubes including the post text.
Users will now have the option to exclude the post text from their sharing.
This is easier than tapping the 3-dots button on the post (which is kind of small) and then expanding the Share menu in the context menu, which is the other way to access this functionality at the
moment.
The default value for the new option will be "Link and Text", which is the current behavior - so we won't change the behavior on existing users.
* Add new strings to other language localizations
* Show verified URLs in account lists
This allows the user to quickly assess which account of multiple is the official
one, especially when searching for a person with multiple search results.
Fixes#1361
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
* Replace the verified urls text with a checkmark
This makes it easy for the user to directly see why the urls are listed.
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
* Swiftformat
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
---------
Signed-off-by: Paul Schuetz <pa.schuetz@web.de>
* 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>
* Fix bug affecting accessibillityRepresentation of type Toggle
Previously, the action on the button would not get executed. This is a SwiftUI bug, as views passed into `accessibilityRepresentation` should not have any behaviour.
Now, we set an equivalent `accessibilityValue` on|off to emulate the same functionality.
* Remove conditional ViewModifier in favour of inlined modifier
Since this view is part of the `StatusRowView` it’s better to err on the side of less branching with ModifiedContent<>
* Avoid combining StatusRowMediaPreviewView accessibility children
By combining the elements, the end result was that the intended action (opening QuickLook) was swallowed in favour of displaying the alt text alert of images.