2023-10-24 06:36:56 +00:00
|
|
|
$icons: (
|
|
|
|
collection, duplicates, feed, feed-error, feed-library, feed-updating, groups, library,
|
|
|
|
library-group, publications, trash-full, trash, unfiled, retracted, search,
|
|
|
|
);
|
|
|
|
|
2023-12-14 08:43:11 +00:00
|
|
|
@each $icon in $icons {
|
|
|
|
.icon-css.icon-#{$icon} {
|
|
|
|
@include focus-states using ($color) {
|
|
|
|
@include svgicon($icon, $color, "16", "collection-tree");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-24 08:22:17 +00:00
|
|
|
#zotero-collections-pane {
|
|
|
|
min-width: $min-width-collections-pane;
|
|
|
|
width: $min-width-collections-pane;
|
2024-05-01 19:30:12 +00:00
|
|
|
flex-shrink: 0;
|
2024-03-02 07:51:55 +00:00
|
|
|
background: var(--material-sidepane);
|
2024-01-24 08:22:17 +00:00
|
|
|
}
|
|
|
|
|
XUL -> JS tree megacommit
- Just a single huge commit. This has been developed over too long a
time, required many tiny changes across too many files and has seen too
many iterations to be separated into separate commits.
The original branch with all the messy commits will be kept around for
posterity
https://github.com/zotero/zotero/compare/bb220ad0f2d6bf0eca6df6d225d3d358cb50a27b...adomasven:feature/react-item-tree
- Replaces XUL <tree> element across the whole zotero client codebase
with a custom supermegafast virtualized-table inspired by
react-virtualized yet mimicking old XUL treeview API. The
virtualized-table sits on top on a raw-to-the-metal,
interpreted-at-runtime JS based windowing solution inspired by
react-window. React-based solutions could not be used because they were
slow and Zotero UI needs to be responsive and be able to
display thousands of rows in a treeview without any slowdowns.
- Attempts were made at making this screen-reader friendly, but yet to
be tested with something like JAWS
- RTL-friendly
- Styling and behaviour across all platforms was copied as closely as
possible to the original XUL tree
- Instead of row-based scroll snapping this has smooth-scrolling. If
you're using arrow keys to browse through the tree then it effectively
snap-scrolls. Current CSS snap scroll attributes do not seem to work in
the way we would require even on up-to-date browsers, yet alone the ESR
version of FX that Zotero is on. JS solutions are either terrible for
performance or produce inexcusable jitter.
- When dragging-and-dropping items the initial drag freezes the UI for
a fairly jarring amount of time. Does not seem to be fixable due to
the synchronous code that needs to be run in the dragstart handler.
Used to be possible to run that code async with the XUL tree.
- Item tree column picker no longer has a dedicated button. Just
right-click the columns. The column preferences (width, order, etc) are
no longer handled by XUL, which required a custom serialization and
storage solution that throws warnings in the developer console due to
the amount of data being stored. Might cause temporary freezing on HDDs
upon column resize/reorder/visibility toggling.
- Context menu handling code basically unchanged, but any UI changes
that plugins may have wanted to do (including adding new columns) will
have to be redone by them. No serious thought has gone into how plugin
developers would achieve that yet.
- Opens up the possibility for awesome alternative ways to render the
tree items, including things like multiple-row view for the item tree,
which has been requested for a long while especially by users switching
from other referencing software
2020-06-03 07:29:46 +00:00
|
|
|
#zotero-collections-tree-container {
|
2021-04-09 09:00:34 +00:00
|
|
|
height: 5.2em;
|
XUL -> JS tree megacommit
- Just a single huge commit. This has been developed over too long a
time, required many tiny changes across too many files and has seen too
many iterations to be separated into separate commits.
The original branch with all the messy commits will be kept around for
posterity
https://github.com/zotero/zotero/compare/bb220ad0f2d6bf0eca6df6d225d3d358cb50a27b...adomasven:feature/react-item-tree
- Replaces XUL <tree> element across the whole zotero client codebase
with a custom supermegafast virtualized-table inspired by
react-virtualized yet mimicking old XUL treeview API. The
virtualized-table sits on top on a raw-to-the-metal,
interpreted-at-runtime JS based windowing solution inspired by
react-window. React-based solutions could not be used because they were
slow and Zotero UI needs to be responsive and be able to
display thousands of rows in a treeview without any slowdowns.
- Attempts were made at making this screen-reader friendly, but yet to
be tested with something like JAWS
- RTL-friendly
- Styling and behaviour across all platforms was copied as closely as
possible to the original XUL tree
- Instead of row-based scroll snapping this has smooth-scrolling. If
you're using arrow keys to browse through the tree then it effectively
snap-scrolls. Current CSS snap scroll attributes do not seem to work in
the way we would require even on up-to-date browsers, yet alone the ESR
version of FX that Zotero is on. JS solutions are either terrible for
performance or produce inexcusable jitter.
- When dragging-and-dropping items the initial drag freezes the UI for
a fairly jarring amount of time. Does not seem to be fixable due to
the synchronous code that needs to be run in the dragstart handler.
Used to be possible to run that code async with the XUL tree.
- Item tree column picker no longer has a dedicated button. Just
right-click the columns. The column preferences (width, order, etc) are
no longer handled by XUL, which required a custom serialization and
storage solution that throws warnings in the developer console due to
the amount of data being stored. Might cause temporary freezing on HDDs
upon column resize/reorder/visibility toggling.
- Context menu handling code basically unchanged, but any UI changes
that plugins may have wanted to do (including adding new columns) will
have to be redone by them. No serious thought has gone into how plugin
developers would achieve that yet.
- Opens up the possibility for awesome alternative ways to render the
tree items, including things like multiple-row view for the item tree,
which has been requested for a long while especially by users switching
from other referencing software
2020-06-03 07:29:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#zotero-collections-tree {
|
2021-04-09 09:00:34 +00:00
|
|
|
width: 100%;
|
2024-01-12 12:32:35 +00:00
|
|
|
|
|
|
|
#main-window & {
|
|
|
|
// virtualized-table has a default background (--material-background)
|
|
|
|
// which is what we want in most places, including dialogs that include
|
|
|
|
// #zotero-collections-tree, however main window collection tree is an
|
|
|
|
// exception
|
|
|
|
background: transparent;
|
|
|
|
}
|
2021-04-09 09:00:34 +00:00
|
|
|
|
|
|
|
.virtualized-table {
|
|
|
|
overflow-y: auto;
|
|
|
|
flex: 1 0;
|
|
|
|
text-overflow: ellipsis;
|
2023-10-24 06:36:56 +00:00
|
|
|
|
|
|
|
.row {
|
|
|
|
.icon-css:not(.twisty) {
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@each $icon in $icons {
|
2023-12-14 08:43:11 +00:00
|
|
|
.icon-css.icon-#{$icon} {
|
2023-10-24 06:36:56 +00:00
|
|
|
@include focus-states using ($color) {
|
|
|
|
@include svgicon($icon, $color, "16", "collection-tree");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.virtualized-table-body {
|
2024-01-12 05:20:34 +00:00
|
|
|
padding: 0 8px 8px;
|
2024-05-15 04:45:57 +00:00
|
|
|
scrollbar-color: var(--color-scrollbar) var(--color-scrollbar-background);
|
2021-04-09 09:00:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.cell.primary {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
:not(.cell-text) {
|
|
|
|
flex-shrink: 0
|
|
|
|
}
|
|
|
|
|
|
|
|
.cell-text {
|
|
|
|
flex-shrink: 1;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
2024-01-12 05:20:34 +00:00
|
|
|
margin-left: 4px;
|
2021-04-09 09:00:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
input.cell-text {
|
|
|
|
border: 1px highlight solid;
|
|
|
|
padding: 1px 2px;
|
|
|
|
margin-right: 5px;
|
|
|
|
width: 100%;
|
|
|
|
font-size: inherit;
|
2022-04-14 14:03:52 +00:00
|
|
|
pointer-events: auto;
|
2021-04-09 09:00:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.cell-icon {
|
|
|
|
min-width: 16px;
|
|
|
|
}
|
|
|
|
}
|
2024-01-04 10:38:12 +00:00
|
|
|
}
|