Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jcoc611-microsoft
Copy link
Contributor

Before, Lists were implemented using InlineUIContainer and grid layouts. This looks great, but breaks selection and accessibility. This PR rewrites lists all-up to use a combination of Paragraph, the list bullet character (either a "dot" or the index number/alpha/roman), and smart use of margins and indents.

WinUIRenderer keeps track of lists in a stack fashion, and MyParagraph uses the info from the renderer to offset the text and prepend the bullet character(s).

Copy link
Member

@michael-hawker michael-hawker left a comment

Choose a reason for hiding this comment

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

I love the idea of translating lists into text instead of custom UI, makes a lot of sense and resolves a lot of issues with accessibility and copying.

Seeing how this works, I think the crux of the issue is that a List is contained in a Paragraph and we need to modify the properties of the parent paragraph to make this work/look good.

I'm wondering if we can be better here about using parsing to detect this or having the List Renderer make/be a paragraph vs. having to connect state between the paragraph and lists between the renderer. @nerocui any insights here?

I'd have to look at the parsing tree here (I wrote a tool for that actually a few weekends back, but still need to publish it.) Like I just wonder if in all cases a list is just encapsulated by a paragraph and any text before/after is a separate paragraph. If so, we should just make a dedicated "BulletedParagraph" type which will just output the final result that he Listrenderer does vs. it being a thing which needs to coordinate with the general paragraph.

Copy link
Member

@Arlodotexe Arlodotexe left a comment

Choose a reason for hiding this comment

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

Tested locally, no bugs or regressions. Text selection across and between lists now works as expected.

@Arlodotexe
Copy link
Member

Arlodotexe commented Jun 18, 2025

cc @michael-hawker We could probably pull your work on tree parsing into a separate issue/PR to keep things moving.

@Arlodotexe
Copy link
Member

New issue opened to cleanup the state management. Should give us space to continue the discussion properly and allow us to close this off.

@Arlodotexe Arlodotexe enabled auto-merge (squash) June 18, 2025 22:43
Copy link
Member

@michael-hawker michael-hawker left a comment

Choose a reason for hiding this comment

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

As discussed, we'll merge for now and work towards to see if we can clean-up the state a bit in the future. Functionality wise, worked great.

@Arlodotexe Arlodotexe merged commit 5b91ace into CommunityToolkit:main Jun 18, 2025
22 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.

3 participants