Commit graph

248 commits

Author SHA1 Message Date
Adomas Venčkauskas
deaeb46ae8 Increase Linux twisty size 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
55c758c9d0 Fix header columns being misaligned with table columns in item tree
And reindent _virtualized-table.scss
2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
36ed9d302b Make item tree header height adjust based on font size 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
b671611b51 Fix item tree message not being centered outside of main window 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
47094fc4c3 Misc new tree cleanup 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
cbbff600a6 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
bb220ad0f2...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
2021-08-21 06:58:12 -04:00
Dan Stillman
9a7016ad64 Spell checker improvements
- Add/Remove Dictionaries window
- Better account for the (unlikely) possibility that a dictionary could
  be replaced by another more popular dictionary provided by a different
  extension id (tested)
- Better account for the (very unlikely) possibility that an extension
  could bundle multiple dictionaries (untested)
- Use toolkit version comparator for proper extension version
  comparisons
- Localize strings
- Add tests for updating
2021-06-23 21:56:11 -04:00
Dan Stillman
06b28194da Show annotation widget in conflict resolution window
This adds a very basic reimplementation of the annotation widget for use
in the CR window. It's not pixel-perfect, but it's close enough that
most people probably won't notice. We'll want to replace this with a
real version that's shared between the PDF reader and the rest of the
codebase.

Image annotations currently show an "[image not shown]" placeholder.
Showing images is tricky: we don't have the remote cache image, so if
the remote position has changed, we could only show an image by
rendering it from the file, and only if the file itself hasn't changed.
Just for a better user experience, we could use the local image as long
as the position and file are both the same, but that would take some
rejiggering of the CR window.

Tags aren't shown because they're not shown for CR at all, though that
could be changed in the future.
2021-03-21 14:36:43 -04:00
Dan Stillman
d47ec92116 Tweak notes pane styling 2021-03-02 18:12:24 -05:00
Dan Stillman
590b6b4a34 Adjust sizing of notes pane search bar and + buttons 2021-03-02 18:12:24 -05:00
Martynas Bagdonas
7bdd34596d Improve notes list UI:
- Always show both sections
- Do not show empty sections when searching
- Collapse notes list when all tabs are closed
- Work around search input to take full width without breaking its stuff
2021-03-02 18:12:24 -05:00
Martynas Bagdonas
5a6424e591 Limit notes count in contextPane notes list 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
b00325942a Improve reworked context pane:
- Show child notes at top of notes list, with separate headers for "Item
  Notes" and "All Notes"
- Fix "New Child Note" option
- Add parent item title above note editor when editing child note
- Cleanup

TODO:
- Search on parent item title for child notes
2021-03-02 18:10:44 -05:00
Dan Stillman
7b794cecd7 PDF reader: Fix 2x icon size in notes list 2021-03-02 18:10:44 -05:00
Dan Stillman
dba841770c Rework context pane in PDF reader
- Remove item pane tabs
- Show all notes in notes pane, showing the parent title where
  appropriate
- Show drop-down menu for "New Note" button in notes pane that allows
  creating standalone or child notes
- Add some temporary styling for notes in the notes pane

TODO:

- Show child notes at top of notes list, with separate headers for "Item
  Notes" and "All Notes"
- Fix "New Child Note" option
- Add parent item title above note editor when editing child note
- Search on parent item title for child notes
2021-03-02 18:10:44 -05:00
Dan Stillman
28c1504cdd Use old toolbar if not a PDF build 2021-03-02 18:10:44 -05:00
Dan Stillman
55c6de23ba Add "Include Annotations" checkbox to export options dialog
This changes the attachment saveFile() function in translators to be
async. In order for errors to be properly caught, translators will need
to be changed to make doExport() async and await on saveFile() calls.
(The translation architecture theoretically already allows doExport() to
be async.)
2021-03-02 17:58:28 -05:00
Martynas Bagdonas
51f760fe1a Improve the new UI:
- Revert `notesList` to standalone notes mode only
- Fix splitter styling on Windows
- Fix `contextPane` performance fixes
- Add a customizable throttle function to `Zotero.Utilities`
- Fix reader tab selection issues
- Improve error handling in the new editor
- Update pdf-reader and zotero-note-editor submodules
- Fix contextPane child notes list
- Properly notify editor about new images
- Fix note title and body snippet extraction
- Persist right-hand pane state when switching tab
- Hopefully fix two panes visible at the same time
2021-03-02 17:58:28 -05:00
Martynas Bagdonas
c6a196b999 Tab bar: Improve tab close button 2021-03-02 17:58:28 -05:00
Martynas Bagdonas
45a3e96e68 Improve the new UI:
- Rollback all redundant changes made in the last few months
- Introduce `contextPane`
- Show child notes in the notes pane
- Fix splitter styling
- Various bug fixes
- Fix contextPane switching and states persistence
- Persist reader sidebar open/close state
- Fix bottom pane placeholder updating concurrency issues
- Fix toolbar placeholder width updating
- Display titles for split button
- Fix toolbar position when switching tabs
- Add PDF tab loading cover
- Improve notes and citations insertion
- Clean up and refactor code
- Fixes and cleanups to PDF reader
2021-03-02 17:54:48 -05:00
Dan Stillman
ab04468342 Item pane improvements for contextual/pinned modes
- Show item title at top of item pane in contextual mode not in a
  library tab
- Show "All Notes" at top of standalone notes pane
- Add background color when clicking notes in standalone notes list
- Clean up back buttons

Mode button is still a placeholder but uses emoji to show the mode
2021-03-02 17:43:10 -05:00
Martynas Bagdonas
bb5075e8b8 Experiment with the new item pane UI 2021-03-02 17:43:10 -05:00
Martynas Bagdonas
783f9c50d5 Tab bar: Fix tabs on Windows & Linux 2021-03-02 17:40:24 -05:00
Martynas Bagdonas
2f505862d7 Tab bar & Reader: Rewrite and connect everything 2021-03-02 17:40:24 -05:00
Dan Stillman
6166907d08 Tab bar: Change selected-tab highlight color 2021-03-02 17:40:24 -05:00
Dan Stillman
e99f76b40c Tab bar: Update styling on macOS 2021-03-02 17:40:24 -05:00
Dan Stillman
9afd509704 Tab bar: Rename _tabsBar.scss to _tabBar.scss 2021-03-02 17:40:23 -05:00
Dan Stillman
3bd5a96560 Tab bar: Highlight current tab 2021-03-02 17:39:39 -05:00
Dan Stillman
875e9f674f Initial tab bar implementation 2021-03-02 17:39:37 -05:00
Dan Stillman
843bcbb68a Show invalid-data warning in sync button tooltip for group libraries
Instead of showing warning button on toolbar

Otherwise if one person in a group upgrades to a beta with new fields,
everyone in the group will get a warning, even if they're already on the
latest release version. In a personal library, the user can upgrade to
the same version.
2021-02-09 16:36:06 -05:00
fletcherhaz
86b77cc45e
Add an option to create parent item from identifier (#1901) 2020-11-20 16:17:48 -05:00
Dan Stillman
492d301cc9 Fix size of Add button in React tags box 2019-11-30 00:50:02 -07:00
Dan Stillman
5ba5e70b9d Fix overflow issues in React tags box
- Properly truncate and ellipsize long tags
- Show scrollbar if tags go off the bottom of the pane

These both improve on the pre-React version, which didn't properly
truncate tags (at least in the current version, though I think it used
to) and scrolled the Add button off the top of the screen.
2019-11-13 05:31:12 -05:00
Dan Stillman
24a3a38c51 Fix tags box editable font and alignment on Windows and Linux 2019-11-12 02:06:09 -05:00
Dan Stillman
5791ffeb16 Reactify item tags box
Improvements:

- Fixes autocomplete text remaining in field after selection in Fx60
- No more text or icon shifting on select (tested on macOS)

Changes:

- Tags are now selected on mousedown with no active state, as in web
  library

Regressions:

- Tooltip with tag type doesn't appear when hovering over icon
- Pressing Tab after modifying a tag loses focus
- Right-click in textbox shows custom menu instead of default text
  editing context menu (Cut/Copy/Paste)

To-do:

- Switch to this version for note tags box
- Style colored tags in autocomplete drop-down? Sort to top?
- Only show delete button on row hover, as in web library?
2019-11-08 06:41:06 -05:00
Dan Stillman
046637d76b Rename tag selector JSX files
Might as well stick to camel case for filenames
2019-11-08 06:41:06 -05:00
Dan Stillman
e2163a88c3 Fix gray tag selector background color on Linux/Windows
8337b7ec1 fixed a regression in the Reactified tag selector that
prevented it from using GTK theme background colors on Linux, but it
accidentally made the background gray by default. This restores the
default white background.

Fixes #1684
2019-04-23 17:15:02 -04:00
Dan Stillman
8337b7ec16 Don't set tag selector background on Windows/Linux
Fixes dark mode on Linux
2019-04-11 16:45:07 -04:00
Dan Stillman
ee3955f6f7 Fix font size in search bars when set to non-small sizes
Reactification regression
2019-03-29 06:35:35 -04:00
Dan Stillman
3126c58d30 Tag selector UI tweaks
- Don't cut off bottom of tags on Windows
- Fix appearance of search bar on Windows/Linux
- Fix cancel button on Windows/Linux
- Don't cut off right-hand pane of bottom bar when narrowing pane
2019-03-29 01:46:54 -04:00
Dan Stillman
d9cee322cd Tag selector performance overhaul
- Use react-virtualized to render tags on demand, reducing the number
  of DOM elements from potentially tens of thousands to <100. This
  requires tags to be absolutely positioned, so sizing and
  positioning need to be precomputed rather than relying on CSS.
- Avoid unnecessary refreshes, speed up tag retrieval, and optimize
  sorting
- Debounce reflowing when resizing tag selector

Also:

- Scroll to top when changing collections
- Allow tags to take up full width of tag selector without truncation

Closes #1649
Closes #281
2019-03-28 06:28:34 -04:00
Dan Stillman
42667e7090 Switch to Search component in tag selector and support X/Esc to clear
This moves debouncing into the search component and adds cancel behavior
from the XUL search textbox. For now, this uses the X button from
Firefox.
2019-03-20 07:15:55 -04:00
Adomas Venčkauskas
8bd35ee0d4 Fixes tag selector toggling via hotkey leaving gray area. Closes #1629 2019-01-28 16:35:20 +02:00
Adomas Venčkauskas
0e8788aca1 Update tag selector styling for Windows 2019-01-21 11:01:33 +02:00
Adomas Venčkauskas
fc41326319 Update tag selector styling for macOS 2019-01-21 11:01:33 +02:00
Adomas Venčkauskas
f5c4fb06e1 Ensure high-dpi icons are loaded in React components 2019-01-21 11:01:32 +02:00
Adomas Venčkauskas
a24cada451 React Tag Selector polish, i18n and tests
- Added icon-button UI code for the menubutton
- Upgrade to React 16 to allow non-standard attrs, such as `tooltiptext`
to support XUL tooltips
- Add i18n support for React UI elements
- Update tests for reactified tag selector
2019-01-21 11:01:27 +02:00
Tom Najdek
897e74c7f1 Reactify the Tag Selector 2019-01-07 15:33:45 +02:00