zotero/test/tests
Bogdan Abaev 4a00304925 Redesigned citation dialog (#4872)
Implemented redesigned citation dialog with library
and list modes one can switch between. This dialog is
a direct replacement of quickFormat and classic citation
dialogs.

In Library Mode:
- items table has a new + button column to add items from the
citation and rows of selected items are highlighted
- open, cited and selected items appear in a section
between the items table and bubbleInput. When there are no
matches, a message is shown.
- only top-level items are shown when citing
items and only notes/notes' parents - when adding a note
- selected items are gathered in a collapsible deck to save space.
Click on the deck will expand it. All selected items can be
added via "Add all" button.
- when an item is added, bubble-input may increase in height and
push itemTree lower. To try to preserve relative positioning
of the mouse, itemTree will scroll to be over the row that was just clicked

In List mode:
- arrow up/down from the input will change the selected item
with the focus remaining in the input
- selected items are a collapsible list section

Other behaviors and fixes:
- one can add any locator (not just pages) by typing its full or short name
in an input and pressing Enter (e.g. line 10, or l. 10, or chap. "test chapter")
- Added a new preference to select if the citation dialog
should always open in list mode, library mode or in the last
mode that was used
- bubbles whose items are selected in library or list mode
are highlighted
- arrow up/down from a bubble will focus the bubble
above/below it for easier navigation across bubble-input
- multi-select is supported on items in list mode or item cards in
library mode via Shift-arrow or Cmd+click to select multiple items
- Cmd/Ctrl + Enter will always accept the dialog no matter what
is focused
- when there are no bubbles, accept button is disabled
- after an item is added, bubble-input is always refocused
- added suppressed property to itemTreeMenubar to be able to
hide if in list mode, where it is not relevant. Fixed menubar
getting stuck or re-appearing on Alt keypress on Linux by setting
height: 0 vs hiding it via hidden.
- added initialFolder and onActivate prop to collectionTree to set which collection
should be reopened when dialog opens and to be able to set a custom
onActivate handler.
- added getExtraField prop to itemTree to get data on if
an item is in a citation or not

Implementation details:
- citationDialog.js is the main file. It relies on a number of
helper files in citationDialog/* directory to keep the main
file less cluttered. popupHandler.js contains the logic of
opening/closing the item details popup to add locator/prefix/suffix/etc.
keyboardHandler.js is responsible for overall keyboard navigation
throughout the dialog. searchHandler.js contains the logic
for running the search based on user's query. Finally, Helpers.js
has general helper functions that don't handle any actual logic.
- SearchHandler is set to run search in two ways: for cited/selected/open
items (which are cached and do not involve any actual SQL query) and
general search for items across all libraries. When layout.search
runs, firstly cited/selected/open items are updated after which the
SQL search runs.
- bubbleInput.js is a customElement responsible for bubbles interface.
bubbleInput.refresh takes a list of items and handles adding/removing/reordering
of bubbles as needed. It always has two inputs on each side of
a bubble, as opposed to having inputs inserted dynamically. It
allows keyboardHandler.js to handle navigation with arrows within
bubbleInput.
- when user interacts with bubbleInput, it emits custom events that are
handled by IOManager singleton in citationDialog.js, which
may update the items information and pass them back to bubbleInput.refresh
to have the list of bubbles updated
- CitationDataManager singleton is responsible for storing
items added into the citation in CitationDataManager.items
in an object with both Zotero.Item and the actual citation item.
It is easier to pass both items to other components
and helpers, as opposed to sharing functions to convert
items back and forth.
2025-03-10 22:40:43 -04:00
..
data Update sample data for podcast/date mapping 2025-02-05 03:08:32 -05:00
.eslintrc Add separate .eslintrc for tests 2019-09-16 01:28:52 -04:00
advancedSearchTest.js Disable flaky Advanced Search test on CI 2024-07-11 11:43:23 -04:00
annotationsTest.js Set automatic titles in more or less all cases (#4369) 2024-07-14 23:37:24 -04:00
attachmentsTest.js Update "Find Full Text" tests for Zotero.HTTP.download() 2025-03-05 06:34:25 -05:00
bibliographyTest.js Fix test for opening the Cite prefpane when clicking Manage Styles… 2023-04-15 03:35:17 -04:00
browserDownloadTest.js Use local HTTP server for Zotero.BrowserDownload test 2024-06-15 00:40:03 -04:00
cachedTypesTest.js Fix primary item types not appearing in More menu when not in MRU list 2021-03-29 01:41:37 -04:00
citeprocRsBridgeTest.js Fix broken tests in 000599b 2022-02-21 14:06:20 +02:00
citeTest.js Reset Zotero.locale to 'en-US' after cite test 2022-08-11 03:57:20 -04:00
collectionsTest.js Fix collections in trash showing up in menus 2024-06-22 16:33:11 -04:00
collectionTest.js Revised logic of trashed collections in item cache (#4358) 2024-07-09 03:34:12 -04:00
collectionTreeRowTest.js Include proper test for b373291c02 for #2771 2022-08-19 12:05:30 -04:00
collectionTreeTest.js Allow dragging items, collections, and searches into trash (#5033) 2025-02-13 02:58:25 -05:00
concurrentCallerTest.js Try to prevent ConcurrentCaller from failing CI (#4097) 2024-05-07 19:38:44 -04:00
creatorsTest.js fx-compat: DB.executeTransaction() no longer takes generator functions 2022-05-12 02:38:59 -04:00
dataDirectoryTest.js Fix Zotero.locked getting stuck on in data directory tests 2025-01-02 07:41:16 -05:00
dataObjectsTest.js fx-compat: DB.executeTransaction() no longer takes generator functions 2022-05-12 02:38:59 -04:00
dataObjectTest.js Disallow unowned group annotation edits, but allow deletions 2022-01-31 06:48:05 -05:00
dataObjectUtilitiesTest.js Don't repeatedly upload relations 2022-08-22 01:15:21 -04:00
dateTest.js Update utilities submodule and date-parsing tests 2022-08-11 02:36:04 -04:00
dbTest.js fx128: Implement non-incremental backup option 2025-01-02 02:56:41 -05:00
debugTest.js Test debug output logging again 2023-05-24 20:59:29 +03:00
dictionariesTest.js fx-compat: Fix dictionaries tests 2022-06-19 04:16:53 -04:00
duplicatesTest.js Merge attachments and update notes (#2336) 2022-03-09 17:26:26 -05:00
feedItemsTest.js fx-compat: Fix feed test using Array.map() 2022-06-19 15:09:23 -04:00
feedItemTest.js Update utilities submodule and date-parsing tests 2022-08-11 02:36:04 -04:00
feedReaderTest.js Remove loadBrowserWindow() test support function (#5050) 2025-02-26 03:00:04 -05:00
feedsTest.js Feed import: Don't fail on OPML entry with no title or text 2022-08-11 02:28:03 -04:00
feedTest.js Remove loadBrowserWindow() test support function (#5050) 2025-02-26 03:00:04 -05:00
fileHandlersTest.js Update reader and pdf-worker submodules and partially disable one test 2024-05-28 17:18:56 +03:00
fileInterfaceTest.js Tests: Use select() instead of selectCollection()/selectSearch() 2024-06-24 04:40:12 -04:00
fileTest.js Fix file:// URI handling in getBinaryContentsAsync() 2023-11-10 15:58:53 -05:00
folderImportTest.js Temporarily disable folder import #2862 2023-03-23 14:16:51 +01:00
fulltextTest.js Remove loadBrowserWindow() test support function (#5050) 2025-02-26 03:00:04 -05:00
groupsTest.js fx-compat: DB.executeTransaction() no longer takes generator functions 2022-05-12 02:38:59 -04:00
groupTest.js Tweak test syntax that breaks with current version of chai-as-promised 2017-06-01 11:36:18 -04:00
HiddenBrowserTest.js HiddenBrowserTest: Don't test HTML served as attachment 2024-12-14 01:16:02 -05:00
httpTest.js fx-compat: Run translation and SingleFile in [hidden] browser 2023-04-14 11:44:44 -04:00
hyphenationTest.js Fix segfault when hyphenating text in main process (#3388) 2023-09-14 02:48:50 -04:00
importExportTest.js fx-compat: Fix XMLSerializer calls 2023-05-22 01:34:41 -04:00
integrationTest.js Redesigned citation dialog (#4872) 2025-03-10 22:40:43 -04:00
intlTest.js Refactor l10n code. Remove use of react-intl. (#2975) 2023-02-10 10:26:49 +02:00
itemFieldsTest.js Proper fix for getDirection() problems 2024-08-14 04:01:26 -04:00
itemPaneTest.js Item box: Fix missing Copy/Paste menuitems on URL fields (#5001) 2025-01-28 00:48:41 -05:00
itemsTest.js Clarify comment for numDistinctFileAttachmentsForLabel() test 2024-05-19 00:54:13 -04:00
itemTest.js Local API: Fix 500 error when attachment has unparseable path (#5010) 2025-01-28 00:54:29 -05:00
itemTreeTest.js renderItemTitle(): Create <span> when inverting style 2025-03-06 11:00:32 -05:00
librariesTest.js Implement library.isGroup property, which was never properly implemented 2021-07-07 01:43:22 -04:00
libraryTest.js XUL -> JS tree megacommit 2021-08-21 06:58:12 -04:00
libraryTreeTest.js Tests: Don't auto-select collections and searches after creation 2024-06-24 02:45:20 -04:00
lookupTest.js Tests: Don't auto-select collections and searches after creation 2024-06-24 02:45:20 -04:00
mendeleyImportTest.js Improve importing from Mendeley 2024-12-11 12:44:13 +01:00
mimeTest.js Add EPUB format to Zotero.MIME 2023-08-07 16:07:52 -04:00
noteeditorTest.js Remove tags-box tests in note editor tests 2024-01-24 23:32:20 -05:00
notifierTest.js fx-compat: DB.executeTransaction() no longer takes generator functions 2022-05-12 02:38:59 -04:00
openurlTest.js Use best first creator for OpenURL author, not just first position 2016-07-11 06:30:55 -04:00
pluginAPITest.js Fix item pane custom info row render after item change (#4875) 2024-11-29 16:18:31 -05:00
preferences_advancedTest.js LABD: Add test for ignoring a file that already exists under new path 2024-07-01 01:48:22 -04:00
preferences_syncTest.js Prevent auth failures for Zotero Storage requests after relinking 2024-11-08 03:19:41 -05:00
profileTest.js Point other profiles to new data dir after migration (+ code reorg) 2016-11-27 00:17:56 -05:00
protocolHandlerTest.js Close window after protocol handler tests 2019-08-03 02:48:01 -04:00
proxyTest.js Import URL from XPCOM code instead of relying on window for Proxy code 2022-11-22 15:58:49 +02:00
quickCopyTest.js Markdown note export (#2214) 2021-12-15 06:10:58 -05:00
readerTest.js Add support for importing KOReader & Calibre annotations (#4780) 2024-11-08 01:16:10 -05:00
recognizeDocumentTest.js Fix renaming behavior for attachment without extension (#4742) 2024-10-15 06:48:04 -04:00
relatedboxTest.js Sort related items by title 2024-06-26 01:02:07 -04:00
relationsTest.js fx-compat: DB.executeTransaction() no longer takes generator functions 2022-05-12 02:38:59 -04:00
RemoteTranslateTest.js Displays a browser window to clear captcha when saving attachments. (#3526) 2023-12-27 04:43:50 -05:00
retractionsTest.js CI: Re-enable retractions tests 2024-04-11 06:09:12 -04:00
schemaTest.js Better way of skipping migration of Place and Date from Extra 2023-04-01 04:52:30 -04:00
searchTest.js Remove loadBrowserWindow() test support function (#5050) 2025-02-26 03:00:04 -05:00
server_connectorIntegrationTest.js Server: Expose actual bound port (#4903) 2024-12-14 01:16:03 -05:00
server_connectorTest.js Fix /connector/saveSnapshot test for Zotero.HTTP.download() 2025-03-05 07:18:12 -05:00
server_integrationTest.js Server: Expose actual bound port (#4903) 2024-12-14 01:16:03 -05:00
server_localAPITest.js Local API: Fix handling of style ids without standard prefix 2025-02-17 03:16:22 -05:00
serverTest.js Server: Expose actual bound port (#4903) 2024-12-14 01:16:03 -05:00
storageLocalTest.js Remove loadBrowserWindow() test support function (#5050) 2025-02-26 03:00:04 -05:00
storageRequestTest.js Avoid a warning from a storageRequest test from the item not existing 2017-05-23 02:12:00 -04:00
styleTest.js Improve test for event-title substitution 2022-08-11 03:57:25 -04:00
supportTest.js Massively speed up tests 2021-06-24 06:10:40 -04:00
syncAPIClientTest.js Send Zotero-Schema-Version header with API requests 2021-03-02 17:36:05 -05:00
syncedSettingsTest.js Fixes feed sync bugs after conflicts. (#1074) 2016-08-16 03:03:42 -04:00
syncEngineTest.js Fix test failure calling item.toResponseJSON() with no library set 2024-06-12 05:50:36 -04:00
syncEventListenersTest.js Trigger auto-sync after item deletion 2021-05-14 03:49:26 -04:00
syncFullTextEngineTest.js Update full-text sync tests after 2ecfff6681 2017-10-20 05:23:13 -04:00
syncLocalTest.js Fix json[c.field] is undefined sync error 2025-01-09 03:11:01 -05:00
syncRunnerTest.js fx-compat: long tag fixer (#2649) 2023-03-16 21:20:11 -04:00
tabsTest.js Render citeproc.js markup in tab titles (#4602) 2024-08-26 07:57:17 -04:00
tagsboxTest.js save tagsBox updates when another item is selected (#4945) 2024-12-20 02:55:33 -05:00
tagSelectorTest.js tweaks for tests to pass after React 18 upgrade (#4338) 2024-07-10 01:04:33 -04:00
tagsTest.js display emojis from color-less tag in itemTreeRow (#3330) 2024-07-15 00:28:01 -04:00
translateTest.js Remove loadBrowserWindow() test support function (#5050) 2025-02-26 03:00:04 -05:00
translatorsTest.js Remove accidental .only() in test from fdcd4e51c5 2021-07-12 15:25:17 -04:00
uriTest.js Add Zotero.URI.getURIItemLibraryKeyFromDB() 2017-05-19 12:11:21 -04:00
utilities_internalTest.js Add tests for renderItemTitle() 2025-03-06 11:00:33 -05:00
utilitiesSubmoduleTest.js Update utilities, move tests, add to CI (#2584) 2022-04-30 04:55:11 -04:00
webdavTest.js fx128: Fix Authorization handling in WebDAV test 2024-12-14 01:16:04 -05:00
zfsTest.js Replace Zotero.Utilities.Internal.saveURI() with Zotero.HTTP.download() 2025-03-05 04:46:51 -05:00
zoteroPaneTest.js Fix faulty siblings-of-type check in setAutoAttachmentTitle() (#5045) 2025-02-12 22:29:49 -05:00
zoteroTest.js Include "Zotero/[version]" in file sync requests 2021-12-27 15:54:12 -05:00