-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
Intended behaviour of data-visibility="uncounted" with progress and slide numbers #2675
Comments
Thanks for the detailed report! The issue was that the slide numbering naively assumed that it should increment the current slide number by 1 to account for the current slide. It didn't consider that the current slide may be uncounted. This meant that the first uncounted horizontal slide ended up increasing the count by one, even if subsequent uncounted slides were not counted. This issue has been fixed as well as the faulty condition you reported. Fragments should be visible in the toolbar on the last slide. Will make a note to add that for a future enhancement. |
## Changelog for reveal.js: Commits: [hakimel/reveal.js@15815efe...e09437f4](hakimel/reveal.js@15815ef...e09437f) * [`942304d8`](hakimel/reveal.js@942304d) add --slide-width/height css variables * [`cd5c9c5b`](hakimel/reveal.js@cd5c9c5) build js * [`61624aea`](hakimel/reveal.js@61624ae) 🤦 * [`7ebade72`](hakimel/reveal.js@7ebade7) remove 20px vertical padding on slide sections * [`c9107476`](hakimel/reveal.js@c910747) don't write '#/' to url on first slide, remove history api feature detection * [`d272628f`](hakimel/reveal.js@d272628) add support for data-visibility=hidden * [`ac79c7cd`](hakimel/reveal.js@ac79c7c) leave the progress bar empty if there's < 2 slides * [`166af893`](hakimel/reveal.js@166af89) all themes now have contrasting text colors based on slide bg * [`37d83374`](hakimel/reveal.js@37d8337) add support for wrapping code in script tempalte to avoid html parser hakimel/reveal.js#2684 * [`66cbd66f`](hakimel/reveal.js@66cbd66) fix slide numbering issue with uncounted horizontal slides (fixes hakimel/reveal.js#2675) * [`1b6a3b1e`](hakimel/reveal.js@1b6a3b1) add support for auto-sized big text via r-fit-text * [`aa667791`](hakimel/reveal.js@aa66779) fit-text helper now triggers lazyily when slide enters view distance * [`be460814`](hakimel/reveal.js@be46081) correct scope for fit-text selector * [`cd2a7924`](hakimel/reveal.js@cd2a792) allow images inside of h/vstacks to be proportionally downsized * [`2fccb774`](hakimel/reveal.js@2fccb77) add 'playsinline' to all inline videos, dont mute background videos on mobile * [`9ff27cfb`](hakimel/reveal.js@9ff27cf) bg videos remain muted on mobile, otherwise broken when navigating with swipe gestures * [`2bfe705e`](hakimel/reveal.js@2bfe705) include /css and /js in npm package hakimel/reveal.js#2712 * [`b05e530f`](hakimel/reveal.js@b05e530) Fix URL to pdf-export documentation * [`3a99a7b7`](hakimel/reveal.js@3a99a7b) shuffle now applies to vertical slides as well * [`a150d0c5`](hakimel/reveal.js@a150d0c) Start relative paths in CSS with ./ * [`80d96b4f`](hakimel/reveal.js@80d96b4) upgrade rollup-plugin-terser to fix npm warning hakimel/reveal.js#2751 * [`faa8b56e`](hakimel/reveal.js@faa8b56) dependency upgrades * [`aa62bd42`](hakimel/reveal.js@aa62bd4) Update README.md * [`2c121d22`](hakimel/reveal.js@2c121d2) docs: Fix simple typo, transiition -> transition * [`676936e3`](hakimel/reveal.js@676936e) revert debug change to index.html * [`e09437f4`](hakimel/reveal.js@e09437f) escape HTML entities in code parsed from markdown, fixes hakimel/reveal.js#2744
## Changelog for reveal.js: Commits: [hakimel/reveal.js@15815efe...e09437f4](hakimel/reveal.js@15815ef...e09437f) * [`942304d8`](hakimel/reveal.js@942304d) add --slide-width/height css variables * [`cd5c9c5b`](hakimel/reveal.js@cd5c9c5) build js * [`61624aea`](hakimel/reveal.js@61624ae) 🤦 * [`7ebade72`](hakimel/reveal.js@7ebade7) remove 20px vertical padding on slide sections * [`c9107476`](hakimel/reveal.js@c910747) don't write '#/' to url on first slide, remove history api feature detection * [`d272628f`](hakimel/reveal.js@d272628) add support for data-visibility=hidden * [`ac79c7cd`](hakimel/reveal.js@ac79c7c) leave the progress bar empty if there's < 2 slides * [`166af893`](hakimel/reveal.js@166af89) all themes now have contrasting text colors based on slide bg * [`37d83374`](hakimel/reveal.js@37d8337) add support for wrapping code in script tempalte to avoid html parser hakimel/reveal.js#2684 * [`66cbd66f`](hakimel/reveal.js@66cbd66) fix slide numbering issue with uncounted horizontal slides (fixes hakimel/reveal.js#2675) * [`1b6a3b1e`](hakimel/reveal.js@1b6a3b1) add support for auto-sized big text via r-fit-text * [`aa667791`](hakimel/reveal.js@aa66779) fit-text helper now triggers lazyily when slide enters view distance * [`be460814`](hakimel/reveal.js@be46081) correct scope for fit-text selector * [`cd2a7924`](hakimel/reveal.js@cd2a792) allow images inside of h/vstacks to be proportionally downsized * [`2fccb774`](hakimel/reveal.js@2fccb77) add 'playsinline' to all inline videos, dont mute background videos on mobile * [`9ff27cfb`](hakimel/reveal.js@9ff27cf) bg videos remain muted on mobile, otherwise broken when navigating with swipe gestures * [`2bfe705e`](hakimel/reveal.js@2bfe705) include /css and /js in npm package hakimel/reveal.js#2712 * [`b05e530f`](hakimel/reveal.js@b05e530) Fix URL to pdf-export documentation * [`3a99a7b7`](hakimel/reveal.js@3a99a7b) shuffle now applies to vertical slides as well * [`a150d0c5`](hakimel/reveal.js@a150d0c) Start relative paths in CSS with ./ * [`80d96b4f`](hakimel/reveal.js@80d96b4) upgrade rollup-plugin-terser to fix npm warning hakimel/reveal.js#2751 * [`faa8b56e`](hakimel/reveal.js@faa8b56) dependency upgrades * [`aa62bd42`](hakimel/reveal.js@aa62bd4) Update README.md * [`2c121d22`](hakimel/reveal.js@2c121d2) docs: Fix simple typo, transiition -> transition * [`676936e3`](hakimel/reveal.js@676936e) revert debug change to index.html * [`e09437f4`](hakimel/reveal.js@e09437f) escape HTML entities in code parsed from markdown, fixes hakimel/reveal.js#2744
## Changelog for reveal.js: Commits: [hakimel/reveal.js@15815efe...e09437f4](hakimel/reveal.js@15815ef...e09437f) * [`942304d8`](hakimel/reveal.js@942304d) add --slide-width/height css variables * [`cd5c9c5b`](hakimel/reveal.js@cd5c9c5) build js * [`61624aea`](hakimel/reveal.js@61624ae) 🤦 * [`7ebade72`](hakimel/reveal.js@7ebade7) remove 20px vertical padding on slide sections * [`c9107476`](hakimel/reveal.js@c910747) don't write '#/' to url on first slide, remove history api feature detection * [`d272628f`](hakimel/reveal.js@d272628) add support for data-visibility=hidden * [`ac79c7cd`](hakimel/reveal.js@ac79c7c) leave the progress bar empty if there's < 2 slides * [`166af893`](hakimel/reveal.js@166af89) all themes now have contrasting text colors based on slide bg * [`37d83374`](hakimel/reveal.js@37d8337) add support for wrapping code in script tempalte to avoid html parser hakimel/reveal.js#2684 * [`66cbd66f`](hakimel/reveal.js@66cbd66) fix slide numbering issue with uncounted horizontal slides (fixes hakimel/reveal.js#2675) * [`1b6a3b1e`](hakimel/reveal.js@1b6a3b1) add support for auto-sized big text via r-fit-text * [`aa667791`](hakimel/reveal.js@aa66779) fit-text helper now triggers lazyily when slide enters view distance * [`be460814`](hakimel/reveal.js@be46081) correct scope for fit-text selector * [`cd2a7924`](hakimel/reveal.js@cd2a792) allow images inside of h/vstacks to be proportionally downsized * [`2fccb774`](hakimel/reveal.js@2fccb77) add 'playsinline' to all inline videos, dont mute background videos on mobile * [`9ff27cfb`](hakimel/reveal.js@9ff27cf) bg videos remain muted on mobile, otherwise broken when navigating with swipe gestures * [`2bfe705e`](hakimel/reveal.js@2bfe705) include /css and /js in npm package hakimel/reveal.js#2712 * [`b05e530f`](hakimel/reveal.js@b05e530) Fix URL to pdf-export documentation * [`3a99a7b7`](hakimel/reveal.js@3a99a7b) shuffle now applies to vertical slides as well * [`a150d0c5`](hakimel/reveal.js@a150d0c) Start relative paths in CSS with ./ * [`80d96b4f`](hakimel/reveal.js@80d96b4) upgrade rollup-plugin-terser to fix npm warning hakimel/reveal.js#2751 * [`faa8b56e`](hakimel/reveal.js@faa8b56) dependency upgrades * [`aa62bd42`](hakimel/reveal.js@aa62bd4) Update README.md * [`2c121d22`](hakimel/reveal.js@2c121d2) docs: Fix simple typo, transiition -> transition * [`676936e3`](hakimel/reveal.js@676936e) revert debug change to index.html * [`e09437f4`](hakimel/reveal.js@e09437f) escape HTML entities in code parsed from markdown, fixes hakimel/reveal.js#2744
Dear @hakimel ,
In the 4.0.0 release notes, one of the changes is:
data-visibility="uncounted"
to exclude slides from the progress bar and slide number count. Allow slides to be uncounted #2543 by lassepeI just wanted to seek some clarification regarding the intended behaviour of this new feature and its interactions with the progress bar and slide number count. Sorry for the walls of text, please respond at your leisure (or not at all).
Thank you for your time and attention,
Sheng
Uncounted slides at the end of the presentation
Reading the original PR, it seems that the intended application of this attribute is to exclude backup/appendix slides at the end of the presentation from the denominator/divisor of the progress calculation. The change to
getSlides()
seems to be sufficient for this. It also has the effect of changing the total slides (thet
in the slide number) whenslideNumber
is set to'c/t'
in the configuration.However, there are also changes to
getSlidePastCount()
to exclude vertical and horizontal uncounted slides from the numerator/dividend of the progress calculation. It also has the effect of changing the current slide (thec
in the slide number) whenslideNumber
is set to'c'
or'c/t'
in the configuration. If uncounted slides appear only at presentation end, these changes seem unnecessary for the progress calculation as current slides beyond the total slides (c>t) are ignored.Currently, when
slideNumber
is set to'c'
or'c/t'
in the configuration, the current slide (thec
in the slide number) does not increment for uncounted vertical slides but does increment for uncounted horizontal slides. The expression!horizontalSlide.dataset.visibility !== 'uncounted'
always evaluates totrue
(strict comparison of boolean left operand and string right operand) in the change togetSlidePastCount()
horizontal slide counting.I am guessing this is a bug, but I wanted clarification before submitting a PR as continuing to increment current slide numbers in the appendix could be an intended behaviour.
Uncounted slides at start or middle of the presentation
The changes to
getSlidePastCount()
suggest to me that uncounted slides are not only allowed at the end of the presentation but also at the start or the middle as well. If that is the case, then!horizontalSlide.dataset.visibility !== 'uncounted'
discussed above is clearly a bug as it can cause the progress bar to fill way before the presentation end as the total slides does exclude uncounted but the current slide does not exclude uncounted horizontal slides.If uncounted slides can appear in the middle of the presentation, another bug can occur in
getProgress()
if the last counted (without the uncounted attribute) slide in the presentation with a series of uncounted slides immediately before it. The progress bar will complete as soon as it reaches the first in the series of uncounted slides before the last slide. This is becausegetProgress()
checks that it has passed the penultimate counted slide (the counted slide before the last counted slide).These may or may not be bugs depending if uncounted slides are allowed anywhere except the end of the presentation. Personally, I am using uncounted on title pages at the start and at some points in the middle of the presentation in addition to the originally intended backup/appendix pages at the end of the presentation. I have also modified the slide numbers to be hidden on uncounted pages as the repeated slide numbers become quite redundant.
Tangent: Progress on the last slide of the presentation
While experimenting with
getProgress()
to address the possible issues above, I noticed that it does not account for fragments if there are fragments on the last slide in the presentation. Instead, the progress bar will complete as soon as it reaches the last slide in the presentation. Again, this is becausegetProgress()
only checks that it has passed the penultimate slide. Not sure if this is intended behaviour or not, I personally would expect the progress bar to complete on the last fragment of the last slide (if there are fragments on the last slide).The text was updated successfully, but these errors were encountered: