Support alternate bullet style per level#1354
Support alternate bullet style per level#1354cbess wants to merge 6 commits intowordpress-mobile:developfrom
Conversation
similar to web browsers, draw different bullets at different levels
|
@crazytonyli can this be merged? |
commit 4d0522d Merge: 2b54f87 59d5090 Author: Gio Lodi <gio.lodi@automattic.com> Date: Thu Mar 9 12:08:36 2023 +1100 Point `bash-cache` plugin to new `a8c-ci-toolkit` location (wordpress-mobile#1367) commit 59d5090 Author: Gio Lodi <gio@mokacoding.com> Date: Mon Mar 6 21:10:15 2023 +1100 Remove unused YAML anchor and fix indentation in pipeline commit e0526bf Author: Gio Lodi <gio@mokacoding.com> Date: Mon Mar 6 21:09:53 2023 +1100 Point `bash-cache` plugin to new `a8c-ci-toolkit` location While I was at it, I also updated the version to the latest, 2.13.0. This was done via: ``` find . -type f -name "*.yml" -exec sed -i '' 's/automattic\/bash-cache#[0-9.]\{1,\}/automattic\/a8c-ci-toolkit#2.13.0/g' {} + ``` commit 2b54f87 Merge: b7d8a70 d18d0a8 Author: Gio Lodi <giovanni.lodi42@gmail.com> Date: Thu Oct 20 16:59:18 2022 +1100 Add `CHANGELOG.md` (wordpress-mobile#1365) commit d18d0a8 Author: Gio Lodi <gio@mokacoding.com> Date: Thu Oct 20 15:18:16 2022 +1100 Update `PULL_REQUEST_TEMPLATE.md` with note about `CHANGELOG.md` commit 2c73ef5 Author: Gio Lodi <gio@mokacoding.com> Date: Thu Oct 20 14:32:38 2022 +1100 Add changelog entry about changelog itself commit 212ce2f Author: Gio Lodi <gio@mokacoding.com> Date: Thu Oct 20 14:15:12 2022 +1100 Update `CHANGELOG.md` with new format commit b7d8a70 Merge: 91cf065 40afa55 Author: Gio Lodi <giovanni.lodi42@gmail.com> Date: Tue Oct 4 10:29:42 2022 +1100 Tools upgrade: Ruby 2.7.4, bash-cache 2.8.0 (wordpress-mobile#1363) commit 40afa55 Author: Gio Lodi <gio@mokacoding.com> Date: Mon Oct 3 20:00:33 2022 +1100 Use `bash-cache` Buildkite plugin version 2.8.0 This version includes a fix that removes the need to run `gem install bundler` before each step. commit bd8840a Author: Gio Lodi <gio@mokacoding.com> Date: Mon Oct 3 19:59:52 2022 +1100 Use Ruby version 2.7.4 commit 91cf065 Merge: 9d8d9b8 1ce621c Author: Diego Rey Mendez <diegoreymendez@users.noreply.github.com> Date: Wed Aug 10 15:07:41 2022 +0200 Merge pull request wordpress-mobile#1353 from cbess/expose-indentation-actions Expose indentation operations commit 9d8d9b8 Merge: b16c763 7eb60c7 Author: Tony Li <i@crazytony.li> Date: Mon Jul 25 11:11:13 2022 +1200 Merge pull request wordpress-mobile#1359 from wordpress-mobile/remove/circle-ci Remove CircleCI commit 7eb60c7 Author: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Fri Jul 22 23:23:27 2022 -0600 Trigger Build commit f91511e Author: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Thu Jul 21 23:03:28 2022 -0600 Remove CircleCI commit 1ce621c Author: C. Bess <cbess@users.noreply.github.com> Date: Sat Mar 26 12:31:51 2022 -0500 cleanup whitespace commit ed55d4a Author: C. Bess <cbess@users.noreply.github.com> Date: Sat Mar 26 12:31:03 2022 -0500 cleanup whitespace commit 4561534 Author: C. Bess <cbess@users.noreply.github.com> Date: Sat Mar 26 12:01:30 2022 -0500 expose indentation operations - make increase/decrease indentation actions visible - cleanup code
- support indent style option
|
@diegoreymendez it is ready for review again |
|
@cbess - Unfortunately, after my departure from Automattic I'm no longer maintaining this project. You may need to ping one of the other maintainers to get this reviewed and merged. |
|
@mokagio I've made the necessary changes and its ready for review |
|
@jleandroperez, @frosty - Hey folks, any idea who could look at this one? |
|
@twstokes Do you think it'd be possible to validate this changeset? I'm afraid I haven't been involved with WPiOS / Jetpack in a long, long time, and we'd really need to ensure nothing else breaks. Thanks in advance!! P.s.: Hola @diegoreymendez !!! |
👋 Howdy @jleandroperez, will be happy to give it a look. I have a slight backlog due to the new year, but will check this soon. |
|
Thanks a million @twstokes !!! |
twstokes
left a comment
There was a problem hiding this comment.
Thank you for your contribution @cbess and sorry for the delays!
I have limited experience with this library's codebase, but conceptually what you've added makes sense to me and passed my manual tests. 🎉
I've added some comments that I think are optional, but could help make the changes more focused. Renaming IndentStyle to show it's the indentation style for unordered lists only could be an improvement. Making it an associated value for .unordered would be even better, but I understand that could add some complications to the Int raw type.
I'd also like to wait until this PR is finished (which is being actively worked on) so we can be sure of our unit tests.
|
|
||
| markerNumber += start | ||
| let markerString = list.style.markerText(forItemNumber: markerNumber) | ||
| let markerString = list.style.markerText(forItemNumber: markerNumber, indentLevel: indentLevel) |
There was a problem hiding this comment.
Nit: The indentLevel isn't accurate if the list style isn't unordered + standard, which could cause confusion.
|
|
||
| /// List Indent Styles | ||
| /// | ||
| public enum IndentStyle: Int { |
There was a problem hiding this comment.
Nit: Since this only applies to unordered lists, we should consider making this clearer.
|
|
||
| // calculate current indent level | ||
| let indentWidth = paragraphStyle.indentToLast(TextList.self) | ||
| if let firstLevelWidth = firstLevelWidth { |
There was a problem hiding this comment.
Nit: I'd consider refactoring this since we know that at this point firstLevelWidth should never be nil.
|
|
||
| /// The list indent style | ||
| /// Default is `default`, single style for each level. | ||
| public var listIndentStyle: TextList.IndentStyle { |
There was a problem hiding this comment.
Nit: Since this only applies to unordered lists, we should consider making this clearer.
|
|
||
| /// The list indent style | ||
| /// | ||
| var listIndentStyle: TextList.IndentStyle = .default |
There was a problem hiding this comment.
Nit: Since this only applies to unordered lists, we should consider making this clearer.
|
@twstokes I'll make those |
|
This PR has gotten stale so I'm going to close it, but please feel free to reopen when ready. |
Reopening: #1354 - Addressed each point in the above PR. - Added alternate ordered list style support per level --- Similar to web browsers, draw different bullets at different levels. To test: - Set the `listIndentStyle` to `.varied` - Create an ordered or unordered list - Add multiple levels to it - Notice the bullet style for level one is different than level two and three - Also, execute "Big Lists" demo, works as expected | Before | After | | ------ | ------ | |  |  | | <img width="383" alt="Screenshot 2025-02-22 at 4 53 29 PM" src="https://github.com/user-attachments/assets/c8ce0a76-5ff1-4523-a8b4-8547ba8905b6" /> | <img width="384" alt="Screenshot 2025-02-22 at 4 52 42 PM" src="https://github.com/user-attachments/assets/e20a54e3-682b-4f32-8425-22d8a3f0acde" /> | --- - [x] I have considered if this change warrants release notes and have added them to the appropriate section in the `CHANGELOG.md` if necessary.
Similar to web browsers, draw different bullets at different levels.
To test: