Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Codidact Meta!

Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Comments on TOC display problem after answer deletion

Post

TOC display problem after answer deletion

+3
−0

Describe the bug
After deleting an answer(s), the table of contents can still be displayed even if there are less answers than the "number of answers to trigger the TOC" and even if there is no answer to the question (in this case the Table of Contents button is displayed but clicking it has no effect other than a slight colour change).

To Reproduce
Steps to reproduce the behavior:

  1. To see an example, go to this post and click on the Table of Contents button to see that there is only one answer (it would be nice if a Mod can confirm that there is at least 1 deleted answer to this question). Another post with all answers deleted has been created at https://b.dev.codidact.org/ (feel free to play with it).
  2. Create a new question post.
  3. Add answers to this post until the Table of Contents button is displayed.
  4. Delete one answer (the Table of Contents should still be displayed but with less answers).
  5. Delete all answers (the Table of Contents button is displayed but clicking it only changes the colour rather than opening a table).

Expected behavior
The Table of Contents button should be removed if, after an answer deletion, the number of remaining answers is lower than the number of answers to trigger the TOC (settable parameter).

Screenshots
Below an example with the linked question:

Example from https://meta.codidact.com/posts/288826

EDIT after answer: Here an example where all the answers have been deleted (accessible here), the Table of Contents button is just set to gray after clicking on it (this is the view of the user who delete all the answers, then this user see all deleted answers but these answers are not displayed in the TOC):

Example of the Table of Contents button display after clicking on it when all answers are deleted

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Credits (1 comment)
Credits
zetyty‭ wrote over 1 year ago · edited over 1 year ago

The work to find and reproduce the problem was made by @trichoplax (see this post on chat).