Skip to content

Make TaskCheckBox render correctly #11214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Apr 25, 2020

  • Add correct styling to TaskCheckBoxes.
  • Restore the correct check order

Fix #11213

Signed-off-by: Andrew Thornton [email protected]

@zeripath zeripath added this to the 1.12.0 milestone Apr 25, 2020
Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath force-pushed the fix-11213-checkboxes-rendered-wrong-way-round branch from 774ce39 to 0351046 Compare April 25, 2020 15:36
@zeripath
Copy link
Contributor Author

zeripath commented Apr 25, 2020

For some unknown reason prior to 812cfd0 isChecked meant that the checkbox should be rendered not checked but after this commit it has returned to the correct sense. I have been unable to find any clear reason why this happened - presumably the change in the priority of the renderer here:

https://github.com/go-gitea/gitea/blob/774ce39d3f35286b2c22d37d5f4b585eeff6df7b/modules/markup/markdown/markdown.go#L74

from:

util.Prioritized(NewTaskCheckBoxHTMLRenderer(), 1000),

means that there was a renderer running before ours that is munging the AST in some way.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 25, 2020
@zeripath zeripath added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Apr 25, 2020
@CirnoT
Copy link
Contributor

CirnoT commented Apr 25, 2020

It would seem that tasklist renderer took over and renderTaskCheckBox was never executed in the first place.

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath changed the title Fix checkbox rendering Make TaskCheckBox render correctly Apr 25, 2020
@zeripath
Copy link
Contributor Author

As discussed on discord previously these checkboxes were rendered incorrectly - I have now restored the correct fomantic styling.

@zeripath zeripath removed the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Apr 25, 2020
@CirnoT
Copy link
Contributor

CirnoT commented Apr 25, 2020

Works fine here, but I have one small nitpick about how it looks on light style:

chrome_2020-04-25_22-30-57

I am wondering if it wouldn't be better to apply read-only instead of disabled:

chrome_2020-04-25_22-32-03

While I realize that disabled does a better job for cases like above, where it's a single checkbox, on a long lists of to-do items it might look a little weird.

@CirnoT
Copy link
Contributor

CirnoT commented Apr 25, 2020

^ Here's example with a rather long list, notice how links can't be clicked on when disabled is present:

chrome_2020-04-25_22-42-36

@zeripath
Copy link
Contributor Author

Thanks for checking that I had totally missed that problem!

@zeripath
Copy link
Contributor Author

Setting them to readonly instead appears to fix the problem.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 25, 2020
@codecov-io
Copy link

Codecov Report

Merging #11214 into master will decrease coverage by 0.02%.
The diff coverage is 10.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11214      +/-   ##
==========================================
- Coverage   43.22%   43.20%   -0.03%     
==========================================
  Files         604      604              
  Lines       86004    86050      +46     
==========================================
+ Hits        37175    37177       +2     
- Misses      44237    44283      +46     
+ Partials     4592     4590       -2     
Impacted Files Coverage Δ
modules/markup/markdown/ast.go 0.00% <0.00%> (ø)
modules/markup/markdown/goldmark.go 36.96% <2.08%> (-4.71%) ⬇️
modules/markup/sanitizer.go 93.10% <100.00%> (+0.33%) ⬆️
modules/charset/charset.go 69.56% <0.00%> (-3.27%) ⬇️
services/pull/check.go 52.43% <0.00%> (-3.05%) ⬇️
modules/git/command.go 86.95% <0.00%> (-2.61%) ⬇️
services/gitdiff/gitdiff.go 72.57% <0.00%> (-1.86%) ⬇️
modules/queue/workerpool.go 56.93% <0.00%> (-1.07%) ⬇️
models/issue.go 51.86% <0.00%> (+0.46%) ⬆️
modules/notification/webhook/webhook.go 40.20% <0.00%> (+0.58%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1f56da...fa3567c. Read the comment docs.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 26, 2020
@guillep2k guillep2k merged commit 9f959ac into go-gitea:master Apr 26, 2020
@zeripath zeripath deleted the fix-11213-checkboxes-rendered-wrong-way-round branch April 26, 2020 06:29
@lafriks lafriks added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Apr 26, 2020
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
* Fix checkbox rendering

Signed-off-by: Andrew Thornton <[email protected]>

* Normalize checkbox rendering

Signed-off-by: Andrew Thornton <[email protected]>

* set the checkboxes to readonly instead of disabled

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown checkboxes are inverted
6 participants