First a disclaimer: I speak here of ideals and intentions in the design, there may still be bugs here and there with the scope of what I’m saying. For instance:
But… P.S. So, in the end, we actually do need to have the “count current compile group only” option checked for the “compile” tab to take inclusions/exclusions into account.
Well, yes and no. That is a bug, likely related to the already mentioned bug, so in the end end, it should have no bearing. The correct behaviour is as described in the documentation for this checkbox. It only impacts the group selector at the top, not filter settings, not include/exclude, nor front/back matter, etc. We would word this setting differently were that the intention.
I haven’t gone through all of the text here, but to interject on the question of what the purpose is for the Compiled tab vs other counting mechanisms: simply put there are things that happen during compile that cannot be factored for in real-time counters, such as the editor footer bar with Scrivenings mode or the overall project goal bar. Some examples:
- A Replacement might turn one word into three.
- Section Layouts might insert headings or other material from metadata fields or Document Notes that add to the word count.
- Likewise a Layout might only print a heading and exclude the main text, in the use case for folders by default, where text typed into a folder’s content area is treated as a form of inline “chapter notes” or what have you.
- Styles may delete text that is in the editor (same goes for inline annotations).
- Style prefix and suffix values will add characters or words.
- There are many more, the point is suitably made.
The Selected Documents tab operates much more like the footer bar output in Scrivenings mode, though with additional options for excluding offline notes, annotations and such in the Options tab—mostly stuff that would cause significant typing lag if it were to be constantly running these filters. It also gives one a way to gather stats on stuff that will never compile, such as a large repository of world-building notes in the Research folder.
So overall the difference between Statistics and the real-time stats boils down to that point: real-time stuff must be super fast, since it recalculates with every single keypress. Statistics, being a panel you pull up, can be slower (much slower in large projects), but it will usually be more accurate.
That said, the Draft tab will not always be subjectively accurate, as compile settings can have a massive impact on things. Consider for example applying the “Enumerated Outline” compile format, which prints only headings and maybe synopses for each item. A 100k manuscript will drop down to a small fraction of that, so long as that format remains applied. Not ideal—but at the same time not really something the software can discern between what is intentional or not. We leave it up to you to decide when that is no longer relevant and switch Formats to something less radical. This gives you control you may need. You may want a word count on your outline output. You may want to create a special format that manipulates the word count a certain way.
To dive more deeply into accuracy, it will only account for source output, not subsequent or final output which results from post-processing. In the vast majority of cases the two will be one and the same. But there may be small variations with some formats, like ebooks, where Scrivener cannot and is not counting what is in the actual .epub file, but what goes into making it. Also consider with plain-text, Markdown and such workflows where custom post-compile automation is a possibility, vast changes may be incurred by tools that operate on Scrivener’s source output. One can essentially program the compiler, at a certain level of usage. The final output that is saved to the disk by the compiler is not what Scrivener uses for stats, in other words, nor could it be as it may well have no clue how to parse the final output usefully (like a .tex file).
And this way a user wouldn’t have to check “count current compile group only” from the option should he wish to have stats that take inclusions/exclusions into account for his draft folder, without having to go back to the compile settings, should he have the compile dialog set to a section of the project rather than the draft, just like says the manual it should be.
The manual states things in terms of the default behaviour, here. If you enable the option that only uses the compile group, then like many things in the manual that state default behaviour, the literal reading will be “incorrect”. An improvement I can see to this paragraph you’ve snipped is adding the words “by default” in there, which I’ve done.
As to further thoughts on whether we should start porting compile settings that impact word count into the Statistics options area, I don’t see the objection to having those factors driven by the compiler. It is not difficult to change a setting in the compiler, and as you can see from the list above, there are a lot of potential factors that can change the statistics. The main reason we have the compile group setting is given in the manual: in most cases one firing off a proof of chapter 18 won’t want their statistics impacted by that choice.
How could we justify stopping with just include/exclude checkbox, as you suggest? The governing logic here is that if something should not be counted as part of the compiled draft output, then you probably very much want that to be set in what actually produces the output, as a formal compile setting, rather than having a set of overrides that “fakes” their omission, leading one to confusion and surprise when they get a totally different result in the end.
For most everyone, what you get when you compile is what you want to have counted. Sure there might be edge cases, but one can end up with a nightmare of an interface if you cater to every edge case specifically. So to that end, we cater to them by proxy: need a weird workflow where you want Document Notes in the final output but don’t want them counted in statistics? You can do that: just have two compile Formats set up that are otherwise identical, and save the one that includes Notes for when you actually compile.