Skip to content

[Mobile] Comments and markdown rendering - #26

Merged
wak327 merged 1 commit into
mobile-issue-detailfrom
mobile-comments
Sep 11, 2026
Merged

wak327 merged 1 commit into
mobile-issue-detailfrom
mobile-comments

Conversation

@wak327

@wak327 wak327 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Closes #8.

GFM comes from react-native-marked, except task lists, which it cannot render: its parser drops marked's task/checked flags before the renderer sees them, so a checklist would come out as bare bullets with no box. The source is lexed at block level here, task lists are drawn directly — which is also what makes them tappable — and every other block is handed back to the library by its own raw text.

Mentions and TEAMKEY-123 links are resolved in the renderer's text() hook, which only ever receives text tokens. That keeps @demo inside backticks or a fenced block literal — the same property the web gets from a remark plugin rather than a regex over the source, and an issue tracker is full of shell snippets.

Ticking a checkbox edits the source at that one character rather than re-serialising the parsed markdown, so bullets, indentation and trailing spaces stay exactly as typed. Verified byte for byte against a live instance.

A correction

I assumed commenting always starts you watching. It does not — auto_watch only adds a row when you have never expressed a preference, so unwatching and then answering a question does not resubscribe you. The test now pins that actual contract.

Closes #8.

GFM comes from react-native-marked, except task lists, which it cannot render:
its parser drops marked's `task` and `checked` flags before the renderer sees
them, so a checklist would come out as bare bullets with no box. The source is
lexed at block level here, task lists are drawn directly -- which is also what
makes them tappable -- and every other block is handed back to the library by
its own raw text.

Mentions and TEAMKEY-123 links are resolved in the renderer's text() hook, which
only ever receives text tokens. That is what keeps `@demo` inside backticks or a
fenced block literal -- the same property the web gets from running this as a
remark plugin rather than a regex over the source, and an issue tracker is full
of shell snippets.

Ticking a checkbox edits the source at that one character rather than
re-serialising the parsed markdown, so bullets, indentation and trailing spaces
the author chose stay exactly as typed. Verified byte for byte against a live
instance.

The `@` menu is driven by the caret rather than the last keystroke, so it also
opens when you move back into a half-written handle, and stays shut on the
second `@` of an email address.

An unknown handle stays plain text: far more likely an email fragment or a shell
variable than a person.

Comments with no author are automation rules, and render as such.

One correction on the way: I assumed commenting always starts you watching. It
does not -- auto_watch only adds a row when you have never expressed a
preference, so unwatching and then answering a question does not resubscribe
you. The test now pins that actual contract.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@wak327
wak327 merged commit 2990d5f into mobile-issue-detail Sep 11, 2026
2 checks passed
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