Add :group-collapsed? parameter for grouped query results#12216
Open
jannek wants to merge 2 commits intologseq:masterfrom
Open
Add :group-collapsed? parameter for grouped query results#12216jannek wants to merge 2 commits intologseq:masterfrom
jannek wants to merge 2 commits intologseq:masterfrom
Conversation
- Add :group-collapsed? query parameter to control initial collapse state - Apply to page groups when :group-by-page? is true - Update custom query, ref block, and general group rendering paths - Add exporter support to strip parameter during export - Add tests to verify parameter doesn't affect result transformation
Reduce left padding in custom-query-page-result containers to better align foldable arrows with content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new
:group-collapsed?parameter to Logseq queries that controls whether grouped query results (when using:group-by-page? true) are initially collapsed or expanded.Fixes #12274.
Changes
Core Feature
:group-collapsed?query parameter:group-by-page? trueUI Enhancement
Usage Example
#+BEGIN_QUERY {:title "📅 Journal Entries by Date" :query [:find (pull ?b [*]) :where [?b :block/page ?p] [?p :block/journal? true]] :group-by-page? true :group-collapsed? true} #+END_QUERYBehavior
:group-collapsed? true: Page groups start collapsed (▶ Page Name):group-collapsed? falseor without the parameter: Page groups start expanded (▼ Page Name with visible blocks)false(maintains current behavior):group-by-page?istrue:collapsed?parameterFiles Changed
src/main/frontend/components/query.cljs- Parameter extraction and propagationsrc/main/frontend/components/block.cljs- Rendering logic updatesdeps/graph-parser/src/logseq/graph_parser/exporter.cljs- Export handlingsrc/test/frontend/components/query/result_test.cljs- Testssrc/main/frontend/components/reference.css- UI alignment improvementTesting
:group-by-page?is false