Skip to content

Conversation

@catgirlinspace
Copy link

Hi, this is a start to #2839. I've never done iOS development before (outside of playing around with the templates in Xcode years ago) but I tried to follow what was already there. Currently the string has the spoilered parts get marked with the attribute but I have no idea how to actually hide them (I'm guessing I need a pill thing?).

Currently:
Element Web
CleanShot 2025-10-20 at 16 56 27@2x

Current Element X (spoilered text is shown as nothing)
CleanShot 2025-10-20 at 16 57 39@2x

This pull request currently (spoilered text is shown plain)
CleanShot 2025-10-20 at 16 57 55@2x

Leaving this as a draft for now while I figure out how to make it actually appear hidden. Also guessing maybe stuff for notifications would need changed to hide spoilered text? Any advice would be appreciated!

Pull Request Checklist

UI changes have been tested with:

  • iPhone and iPad simulators in portrait and landscape orientations.
  • Dark mode enabled and disabled.
  • Various sizes of dynamic type.
  • Voiceover enabled.

@CLAassistant
Copy link

CLAassistant commented Oct 20, 2025

CLA assistant check
All committers have signed the CLA.

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@stefanceriu
Copy link
Member

Nice start, thank you 🙏

Unfortunately this is indeed the easy part.

As you need the spoiler view to be interactive (so you can tap to show) your only option is a custom NSTextAttachment and their NSTextAttachmentViewProvider, which, as you noticed, we also use for mention pills.
I would however suggest you build the spoiler completely separate from all of that i.e. introduce a new type, a new provider and view.

I might also be a good idea to hold the spoiler text within the attribute so you can build the right size view.
Also, keep in mind that text can wrap and your spoiler should too. TextRenderer might prove useful.

@catgirlinspace
Copy link
Author

Hi, sorry for the late reply--have been pretty busy.

Thank you for those pointers! I'll try implementing something soon-ish (whenever I have free time, have been pretty busy with uni) but I'll admit I don't have much confidence in myself with my lack of iOS experience :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants