Commit Graph

72 Commits

Author SHA1 Message Date
365859bb63 import lodash 2022-03-18 12:30:06 +08:00
1218bb0afd use lodash debounce the api call to save reading progress 2022-03-18 12:20:45 +08:00
7650a12be3 fix reading progress not updated after reading by updating cache (#258) 2022-03-18 09:58:08 +08:00
463e569e57 In /app use the window to scroll to initial read position
There isn't a scrollElementRef in `/app` because there is no
fixed header, so this will scroll the entire document instead.
2022-03-16 12:47:28 -07:00
e652a6ea8c Rebased version of the elastic PR (#225)
* Add elastic to our docker compose

* add AND/OR/NOT search operations

* add elastic and create article in elastic

* change error code when elastic throws error

* add search pages in elastic

* add search by labels

* Add elastic to GitHub Action

* Update elastic version

* Fix port for elastic

* add url in search query

* Set elastic features when running tests

* add debug logs

* Use localhost instead of service hostname

* refresh elastic after create/update

* update search labels query

* add typescript support

* search pages in elastic

* fix search queries

* use elastic for saving page

* fix test failure

* update getArticle api to use elastic

* use generic get page function

* add elastic migration python script

* fix bulk helper param

* save elastic page id in article_saving_request instead of postgres article_id

* fix page archiving and deleting

* add tests for deleteArticle

* remove custom date type in elastic mappings which not exist in older version of elastic

* fix timestamp format issue

* add tests for save reading progress

* add tests for save file

* optimize search results

* add alias to index

* update migration script to receive env var as params

* Add failing test to validate we don't decrease reading progress

This test is failing with Elastic because we aren't fetching
the reading progress from elastic here, and are fetching it
from postgres.

* Rename readingProgress to readingProgressPercent

This is the name stored in elastic, so fixes issues pulling the
value out.

* Linting

* Add failing test for creating highlights w/elastic

This test fails because the highlight can't be looked up. Is there
a different ID we should be passing in to query for highlights,
or do we need to update the query to look for elastic_id?

* add tests code coverage threshold

* update nyc config

* include more files in test coverage

* change alias name

* update updateContent to update pages in elastic

* remove debug log

* fix createhighlight test

* search pages by alias in elastic

* update set labels and delete labels in elastic

* migration script enumeration

* make BULK_SIZE an env var

* fix pdf search indexing

* debug github action exit issue

* call pubsub when create/update/delete page in elastic

* fix json parsing bug and reduce reading data from file

* replace a depreciated pubsub api call

* debug github action exit issue

* debug github action exit issue

* add handler to upload elastic page data to GCS

* fix tests

* Use http_auth instead of basic_auth

* add index creation and existing postgres tables update in migration script

* fix a typo to connect to elastic

* rename readingProgress to readingProgressPercent

* migrate elastic_page_id in highlights and article_saving_request tables

* update migration script to include number of updated rows

* update db migration query

* read index mappings from file

* fix upload pages to gcs

* fix tests failure due to pageContext

* fix upload file id not exist error

* Handle savedAt & isArchived attributes w/out quering elastic

* Fix prettier issues

* fix content-type mismatching

* revert pageId to linkId because frontend was not deployed yet

* fix newsletters and attachment not saved in elastic

* put linkId in article for setting labels

* exclude orginalHtml in the result of searching to improve performace

* exclude content in the result of searching to improve performace

* remove score sorting

* do not refresh immediately to reduce searching and indexing time

* do not replace the backup data in gcs

* fix no article id defined in articleSavingRequest

* add logging of elastic api running time

* reduce home feed pagination size to 15

* reduce home feed pagination size to 10

* stop revalidating first page

* do not use a separate api to fetch reading progress

* Remove unused comment

* get reading progress if not exists

* replace ngram tokenizer with standard tokenizer

* fix tests

* remove .env.local

* add sort keyword in searching to sort by score

Co-authored-by: Hongbo Wu <hongbo@omnivore.app>
2022-03-16 12:08:59 +08:00
9e82b1c8a7 Dont fetch labels until we switch to elastic 2022-03-12 21:03:10 -08:00
53c718d7ab Display the correct site name for PDF saved URLs 2022-03-12 17:34:37 -08:00
f9af4ec2d8 Remove unused shareInfo from GQL queries 2022-03-11 13:12:34 -08:00
38a6ee9394 Remove unused attributes from article queries 2022-03-11 12:59:50 -08:00
f29d0fdb71 Prettier fix 2022-03-09 19:17:33 -08:00
be75bfdd0b Only updating reading progress if scroll position changes 2022-03-09 19:12:55 -08:00
b68fd1d487 Merge pull request #211 from omnivore-app/feature/reader-progress-tracking-ios
Reader progress tracking ios
2022-03-09 18:12:57 -08:00
40b3cf917a Merge pull request #209 from omnivore-app/fix/header-buttons 2022-03-09 17:29:50 -08:00
bf035a4ec4 use window to track scrolling for /app web routes 2022-03-09 13:40:18 -08:00
ddb13770d3 set position to fixed for article container wrapper in /app routes 2022-03-09 13:40:18 -08:00
191fcb2675 send reading progres updates from embedded web views 2022-03-09 13:40:18 -08:00
7e3ee0f931 Comment out the share modal keyboard command 2022-03-09 10:04:31 -08:00
7cd1d65ce7 Header button fixes
- Completely disable the GitHub button when collapsed in header
- Point the name logo button to /login on the login page
2022-03-09 10:00:03 -08:00
b166847138 Use react state for first flag when fetching 2022-03-08 21:57:12 -08:00
7137aaf4fc useRouter 2022-03-08 20:05:18 -08:00
a84d79464a Make the router param optional 2022-03-08 13:07:03 -08:00
dad777ce6d Move the u command to the reader view 2022-03-08 13:02:38 -08:00
8109dd3a85 Fix implementation of u key
The `u` key isn't supposed to be a general purpose back key, there
is a `b` command for that. The `u` key should just be used as an
"up" command to go from the reader to the library.
2022-03-08 12:57:59 -08:00
4bafee4da2 Set theme on emails and labels pages 2022-03-07 09:47:43 -08:00
0a38621a3a Set root color scheme CSS for iOS to determine system colour 2022-03-06 09:16:14 -08:00
3d72d0f9d5 Dont use <Script inside next/head 2022-03-03 20:56:16 -08:00
fb6564a126 Use next/script for Mathjax 2022-03-03 20:37:04 -08:00
94df27c964 create a test and build command for deploying to vercel 2022-03-03 15:48:42 -08:00
2db59860d2 remove module aliases from jest config 2022-03-03 13:50:54 -08:00
cecb9da4c7 use next/jest plugin to configure jest unit tests 2022-03-03 13:44:35 -08:00
304f6352dc Remove inline-block styling on code blocks
This will let code blocks go full width without inline code
statements creating a new line break.
2022-03-01 15:53:44 -08:00
cd90d3a402 Add typing on the error filter query 2022-03-01 14:40:36 -08:00
1557136e81 Use the outer query value in gqlFetcher call
The inner query value never changes, so no need to worry
with type casting this here, it will always be a string.
2022-03-01 14:28:21 -08:00
9515c3c6f6 Merge pull request #171 from omnivore-app/fix/upgrade-segment
Upgrades to bump up update-notifier version
2022-03-01 14:06:08 -08:00
f30c6f21c3 Update segment and nodemon to bump update-notifier 2022-03-01 12:20:13 -08:00
c2dd4143ff Ensure font size changes are persisted 2022-03-01 12:04:19 -08:00
c4cf5bc2b0 Merge pull request #146 from omnivore-app/fix/favicons
Fix the favicon imports
2022-03-01 10:37:23 -08:00
836d73ad74 Add icons 2022-03-01 10:20:02 -08:00
ecb44c4c80 Add labels to library items query, improve design of labels 2022-03-01 08:54:19 -08:00
7bf454ae91 use dataloader to fetch all labels of a list of linkIds in a single q… (#133)
* use dataloader to fetch all labels of a list of linkIds in a single query and cached

* add labels in GQL query in frontend
2022-02-28 12:13:26 +08:00
fbcf24a9d1 Fix the favicon imports 2022-02-26 17:32:12 -08:00
da767bd55a Merge pull request #143 from omnivore-app/feature/code-highlighting
Add code highlighting using highlight.js
2022-02-26 17:29:58 -08:00
b5f68cf5c9 Add async on the highlightjs script import 2022-02-26 16:31:40 -08:00
ae22c0b026 Use inline-block for code so it scrolls on smaller devices 2022-02-26 16:17:27 -08:00
84fbc9cd27 Add code highlighting using highlight.js 2022-02-26 14:57:59 -08:00
de9b4bec7b Add a border radius to code blocks 2022-02-26 14:04:23 -08:00
07066a0619 Remove block formatting on code
This fixes line breaks being added on inline code elements for
example lines like:

call the <code>sprintf</code> function
2022-02-26 13:27:05 -08:00
5a285a4c7e Improve design for the error pages 2022-02-25 13:50:59 -08:00
42511a5439 Remove the labels query from GetArticle 2022-02-24 20:54:22 -08:00
c55625589c Merge pull request #98 from omnivore-app/feature/labels
Labels API and testing page
2022-02-24 19:51:28 -08:00