Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Clickable, saved markdown checklists in chat, carried into exports (0.261.543) - #2033

Merged
Paul Lizer (paullizer) merged 5 commits into
microsoft:Developmentfrom
paullizer:claude/markdown-checkbox-interactivity-14a99d
Dec 2, 2026
Merged

Paul Lizer (paullizer) merged 5 commits into
microsoft:Developmentfrom
paullizer:claude/markdown-checkbox-interactivity-14a99d

Conversation

@paullizer

Copy link
Copy Markdown
Collaborator

Summary

Markdown checklists (- [ ] / - [x]) in assistant replies rendered as checkboxes that could not be clicked. They can now be ticked and cleared in both the classic and V2 chat, the state is saved, and it carries into Word, PowerPoint, PDF and email exports.

How the state is stored

  • POST /api/message/<message_id>/task-item writes the state into the message's own markdown ([ ] ↔ [x]). Reloads, the copy button and every export read the same text.
  • Only one character changes, so the content length and any stored masked-range offsets stay valid.
  • The browser names a box by its position among the reply's boxes, its visible label and the box count. functions_markdown_task_lists.py matches those to one marker, outside fenced code, or refuses with 409; the browser then puts the box back and shows the reason.
  • The route uses the existing conversation authorization and persist_chat_reply (ETag check, retracted replies untouched). Only assistant replies can change.

Clients

  • Classic: chat-task-lists.js enables the boxes after a reply renders and after masking restores it. Saves run one at a time per message, and the copy-button markdown and masking snapshot are kept in step.
  • V2: the rehypeTaskListItems plugin numbers the boxes; AssistantMarkdown makes them clickable when MessageList passes a toggle (saved assistant replies in the open personal conversation, never while streaming); chatStore.setTaskListItem updates at once, saves, and rolls back with a toast on refusal.
  • Shared conversations stay read-only in both clients, since their messages live in the collaboration containers.

Exports

Export Result
Word Each item is a Word checkbox content control (w14:checkbox) that can still be ticked in Word. Items inside a block quote stay glyphs, since quotes are flattened to text.
PowerPoint, PDF, email ☐ Item / ☑ Item (the PDF renderer draws them with PyMuPDF's built-in symbol fallback).
Markdown, JSON Unchanged; they already carry [ ] / [x].

Inventory and pinned tests

  • cosmos_response_boundaries.json: adds the new route (owner-runtime evidence from the new test) and renews 42 owners in route_backend_chats.py and route_backend_conversation_export.py whose own boundary is unchanged; only the module fingerprint moved. check_cosmos_response_boundaries.py reports 0 gaps.
  • test_v2_rich_rendering.py and test_v2_media_gallery_wiring.py pin the V2 rehype pipeline; both now list the checklist plugin, with a note on what it does.
  • test_per_message_export.py and test_per_message_powerpoint_export.py load export helpers by name and now include the new ones.

Test plan

  • functional_tests/test_markdown_task_list_checkboxes.py (11 tests, also under python -O): matching rules, refusals, the route through Flask against the shared OfflineContainer, Word checkbox states, PowerPoint bullets, PDF text, classic and V2 wiring
  • functional_tests/test_v2_markdown_task_list_logic.mjs: plugin in the real react-markdown pipeline, and parity with the server's matching
  • Existing export tests and the 51 test files that read the changed V2 files (524 passed)
  • npm run typecheck, scripts/check_browser_assets.py, scripts/check_cosmos_response_boundaries.py
  • Classic client in a browser harness with the real marked, DOMPurify, Bootstrap and chat CSS: click saves, copy markdown follows, refused save rolls back with a toast
  • Not yet clicked through in a running app with a real Cosmos DB

🤖 Generated with Claude Code

….261.543)

Checkboxes that markdown task lists (`- [ ]` / `- [x]`) render in an
assistant reply can now be ticked and cleared in the classic and V2 chat.
POST /api/message/<id>/task-item writes the state into the message's own
markdown, swapping one character so masked-range offsets stay valid. The
browser names a box by its position, label and the reply's box count, and
the server matches those to one marker or refuses with 409.

Word exports each item as a Word checkbox content control; PowerPoint,
PDF and email show a ballot box glyph. Shared conversations and a user's
own messages stay read-only.

The Cosmos boundary inventory adds the new route and renews 42 owners
whose own code is unchanged (only their module fingerprint moved). Two
tests that pin the V2 rehype pipeline now include the checklist plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeQL flagged `(?:>[ \t]?[ \t]*)*`: the optional space and the run of
spaces after it can split the same whitespace many ways, so a line of
many `>\t` repeats backtracks exponentially. `(?:>[ \t]*)*` matches the
same lines with one way to split them. Fixed in the server helper, the
classic client and the V2 client, with a regression check in both tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeQL follow-ups on the checklist route:

- The markdown link pattern used to normalize labels could take
  polynomial time on long runs of brackets. Labels are now stripped of
  links in one left-to-right scan, in the server helper and both clients.
- The task-item route returned str(exception). Refusals now send the
  fixed TASK_LIST_ERROR_MESSAGES text for their error code.

Regression checks cover both, and the Cosmos boundary inventory records
the route change; 31 other owners only moved their module fingerprint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Development took 0.261.543, so the checklist feature moves to 0.261.544:
config.py, a new release-notes section above Development's 0.261.543
entry, the feature doc, the test version headers and the Cosmos
boundary re-review notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Development took 0.261.544, so the checklist feature moves to 0.261.545:
config.py, a new release-notes section above Development's 0.261.544
entry, the feature doc, the test version headers and the Cosmos
boundary re-review notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paullizer
Paul Lizer (paullizer) merged commit 0a73c16 into microsoft:Development Dec 2, 2026
17 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.

2 participants