Refine Dataview dashboard layout rules

This commit is contained in:
qyh15 2026-05-19 23:12:05 +08:00
parent 363e8396b7
commit 70978a3642
1 changed files with 32 additions and 2 deletions

View File

@ -78,7 +78,14 @@ TABLE rows.file.link AS 文章
GROUP BY journal GROUP BY journal
``` ```
It creates one huge list per table cell and makes journal rows look sparse. Prefer: Also avoid the same pattern with other short grouping fields such as `year`, `status`, or `rating`:
```dataview
TABLE rows.file.link AS 文章, rows.journal AS 期刊
GROUP BY year
```
These queries create one huge list per table cell. Short columns such as `year` then waste a large amount of horizontal space while the article list still wraps badly. Prefer a compact count table:
```dataview ```dataview
TABLE WITHOUT ID TABLE WITHOUT ID
@ -90,7 +97,19 @@ GROUP BY journal
SORT length(rows) DESC, key ASC SORT length(rows) DESC, key ASC
``` ```
Then add a separate detail table: For year grouping, use the same compact pattern:
```dataview
TABLE WITHOUT ID
key AS 年份,
length(rows) AS 篇数
FROM "01 文献阅读/00 AI总结笔记"
WHERE contains(tags, "literature") AND year
GROUP BY year
SORT key DESC
```
Then add a separate one-row-per-paper detail table:
```dataview ```dataview
TABLE WITHOUT ID TABLE WITHOUT ID
@ -102,6 +121,17 @@ WHERE contains(tags, "literature") AND journal
SORT journal ASC, year DESC, file.name ASC SORT journal ASC, year DESC, file.name ASC
``` ```
If the page is already organized by a short field such as `year`, use that field for sorting but do not repeat it as a wide table column:
```dataview
TABLE WITHOUT ID
file.link AS 文章,
journal AS 期刊
FROM "01 文献阅读/00 AI总结笔记"
WHERE contains(tags, "literature") AND year
SORT year DESC, journal ASC, file.name ASC
```
## Dataview Table Width ## Dataview Table Width
Keep main dashboard tables narrow. Put wide fields such as DOI, authors, and file modification times into separate detail pages. Keep main dashboard tables narrow. Put wide fields such as DOI, authors, and file modification times into separate detail pages.