`:current-page` is not always the current page; is this intentional?

If you add the following advanced query to an old journal page:

#+BEGIN_QUERY
{
  :title [:h4 "MWE for " [:tt ":current-page"]]
  :query [
    :find ?page
    :in $ ?current-page
    :where
      [(ground ?current-page) ?page]
  ]
  :inputs [:current-page]
}
#+END_QUERY

and then visit the journal pages and scroll down to the old day, it’ll show today’s journal page not the old journal page. Is this intentional? :query-page does not have this problem.

It is expected behavior. :current-page and :query-page serve different needs, exactly when two or more pages are visible at the same time.

I thought the difference between :current-page and :query-page was for embedded blocks: :current-page would be the page doing the embedding, while :query-page would be the page whose block is embedded. Is that not the case?

To me, it doesn’t make sense for :current-page to be anything other than the name of the page currently being rendered.

  • The :query-page is the page where the query is defined.
    • Each page is the :query-page of all the queries defined inside it.
  • The :current-page is the primary page being rendered in the main pane.
    • At any given moment, only one page in the whole application is the :current-page.
    • Zero or more other pages may also be rendered, without being the :current-page.
      • Embedded pages can be rendered without being the :current-page.
      • Non-embedded pages can also be rendered without being the :current-page.