Skip to content

Conversation

sagar5534
Copy link

Resolves(?): #1537

βœ… Proposed Fix (via PR)

πŸ”§ The fix includes two strategies:

  1. Sanitize (Remove HTML Tags)

    • For areas where clean, plain text is preferred β€” like truncated labels or condensed views β€” we simply strip HTML tags.
    • This ensures no layout breaks and provides a more readable summary.
  2. Render as AttributedString (Rich Text Display)

    • In areas where there's more space (like full overview popups), we convert the HTML into an AttributedString.
    • This preserves formatting like line breaks, italics, etc., giving a richer and more faithful display of the original metadata.

✨ Benefits

  • Cleaner, more professional UI
  • Preserves intent of metadata providers when space allows
  • Prevents broken or ugly HTML from leaking into user-facing views

✨ Screenshots of fix:

Simulator Screenshot - iPhone 16 Pro - 2025-05-14 at 18 26 33
85)
Simulator Screenshot - iPhone 16 Pro - 2025-05-14 at 18 26 39

@JPKribs
Copy link
Member

JPKribs commented May 14, 2025

Hi, firstly thank you for your contribution! It's always awesome to see new contributors!

Just as a heads up, we have another open branch that also touches on this issue here: #1067. There are some comments and history there that may be relevant to your PR as well. I'm not personally opposed to taking taking one PR over the other, especially since our original one has had some outstanding changes approaching the 1 year mark. Most likely, I'm going to lean on @LePips just to confirm we're going the right direction here but that PR should give you a good indication of potential issues/concerns we may have for this PR.

I'm out of the state this week for work so I won't personally have a chance to look at this until probably next week!

@JPKribs JPKribs added enhancement New feature or request iOS Specific to only iOS or iPadOS tvOS Specific to only tvOS labels May 17, 2025
@sjorge
Copy link

sjorge commented May 18, 2025

Seems to work fine on tvOS. At least in the short summary.

Never found a way to read the whole description, but that was already the case before this change too.

Copy link
Member

@LePips LePips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution, but it still doesn't achieve the desired result when all formatting is immediately stripped. A final solution would have to look like a mashup between this and #1067 where we make a custom UILabel, get the environment Font, make the attributed string, and enumerate over it to apply bold, italics, and the environment font as desired.

I do like the consideration for a cleaned/parsed overview, and could move forward with that.


// Remove font attributes from the entire range
let fullRange = NSRange(location: 0, length: mutableAttributedString.length)
mutableAttributedString.removeAttribute(.font, range: fullRange)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This immediately removes all formatting.

@LePips
Copy link
Member

LePips commented Jul 20, 2025

If this has no movement soon, I will implement it with the enumerated formatting and the "cleaned" overview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request iOS Specific to only iOS or iPadOS tvOS Specific to only tvOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants