Skip to content

Add headline-line-through to list items - #109

Draft
simonhamp wants to merge 1 commit into
mainfrom
feat/list-item-strikethrough
Draft

simonhamp wants to merge 1 commit into
mainfrom
feat/list-item-strikethrough

Conversation

@simonhamp

@simonhamp simonhamp commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

A list row had no way to show a done item with its title struck through. In our todo app benchmark runs, several of the agent runs rebuilt rows by hand from basic elements just to get this.

This adds headline-line-through (also headlineLineThrough, fluent ->headlineLineThrough()). It follows the line-through name that <native:text> already uses for the same decoration. It only affects the headline, which is the title in a todo row. It goes over the wire as headline_line_through. iOS applies .strikethrough() to the headline Text, the same way NativeUITextRenderer does. Android sets TextDecoration.LineThrough on the headline.

Bind it to your state so done and open rows share one tag:

<native:list-item headline="{{ $todo->title }}" :headline-line-through="$todo->done" />

The value goes through FILTER_VALIDATE_BOOLEAN, so a string "false" switches it off instead of counting as truthy. The prop is only sent when the attribute is set, so existing rows go over the wire unchanged.

Testing:

  • New tests/ListItemLineThroughTest.php covers the default, both spellings, bound true/false/string/int values and the fluent builder. The full suite passes against nativephp/mobile 4.5.2.
  • On an iPhone 17 simulator, a super-native screen with three todo rows showed the two done titles struck through and the open one plain.
  • Swift: swiftc -typecheck -wmo over core's NativeRender sources plus this package's resources/ios. The error list is identical to main (all baseline errors from core types outside that folder), and a planted canary in the list item renderer was reported, so the file was checked.
  • Kotlin: compileDebugKotlin passes in super-native's Android project with the change cherry-picked onto the macOS renderer branch. I didn't run it on an emulator.

🤖 Generated with Claude Code

A done todo usually shows a struck-through title, and the list row had
no way to do it, so people rebuilt rows by hand. The new
headline-line-through attribute (fluent headlineLineThrough()) follows
the line-through naming used by native:text and draws a strikethrough
on the headline on iOS and Android.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

1 participant