Skip to content

Commit

Permalink
Merge pull request #192 from GeoffreyChen777/electron-dev
Browse files Browse the repository at this point in the history
Electron dev
  • Loading branch information
GeoffreyChen777 authored Nov 20, 2022
2 parents 67a6e26 + 685fb47 commit a5cf0f0
Show file tree
Hide file tree
Showing 20 changed files with 420 additions and 140 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/electron_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
node -v
npm install --force
- name: 'Cleanup Env'
run: |
rm -rf ~/Documents/paperlib
rm -rf ~/Library/Application\ Support/paperlib
- name: "End-to-End Testing"
run: npm run test:e2e

Expand Down
83 changes: 82 additions & 1 deletion .github/workflows/electron_e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- electron-dev

jobs:
e2e_test:
e2e_test_mac_arm:
runs-on: self-hosted

strategy:
Expand Down Expand Up @@ -38,5 +38,86 @@ jobs:
node -v
npm install --force
- name: 'Cleanup Env'
run: |
rm -rf ~/Documents/paperlib
rm -rf ~/Library/Application\ Support/paperlib
- name: "End-to-End Testing"
run: npm run test:e2e

e2e_test_mac_x86:
runs-on: macos-latest

strategy:
matrix:
node-versions: ["16.16.0"]

steps:
- name: "Checkout Project"
uses: actions/checkout@v2

- name: Set env
run: |
cp ./build_configs/electron-builder.mac.dev.json5 ./electron-builder.json5
- name: 'Clone Private Repository'
uses: actions/checkout@v2
with:
repository: GeoffreyChen777/paperlib-crypto
token: ${{ secrets.CRYPTO_REPO_KEY }}
path: ./app/utils/crypto

- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-versions }}

- name: "Install Node Module"
run: |
node -v
npm install --force
- name: "Cleanup Env"
run: |
rm -rf ~/Documents/paperlib
rm -rf ~/Library/Application\ Support/paperlib
- name: "End-to-End Testing"
run: npm run test:e2e

e2e_test_win:
runs-on: windows-latest

strategy:
matrix:
node-versions: ["16.16.0"]

steps:
- name: "Checkout Project"
uses: actions/checkout@v2

- name: Set env
run: |
cp ./build_configs/electron-builder.win.dev.json5 ./electron-builder.json5
- name: 'Clone Private Repository'
uses: actions/checkout@v2
with:
repository: GeoffreyChen777/paperlib-crypto
token: ${{ secrets.CRYPTO_REPO_KEY }}
path: ./app/utils/crypto

- name: Setup NodeJS Environment ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-versions }}

- name: "Install Node Module"
run: |
node -v
npm install --force
- name: "End-to-End Testing"
run: npm run test:e2e

7 changes: 7 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## v2.1.2 20/11 2022

1. 浏览器插件支持 CNKI (中国知网)。
2. 如果 DBLP 返回元数据带有 DOI,那么优先使用此 DOI 获取其余元数据。
3. 修复搜索栏动画的问题。
4. 修复在 PDF 浏览器里点击链接时,无法在外部浏览器打开的问题。

## v2.1.1 06/11 2022

1. 修复了一个 Bug。
Expand Down
19 changes: 13 additions & 6 deletions CHANGELOG_EN.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# v2.1.1 Nov 06 2022
## v2.1.2 Nov 20 2022

1. Browser extension now supports CNKI (中国知网).
2. If DBLP returns metadata with a doi, then use this DOI first to get metadata.
3. Fixed an animation bug of the search bar.
4. Fixed a bug occured when clicking a URL link in the PDF reader view.

## v2.1.1 Nov 06 2022

1. Fixed a bug.

# v2.1.0 Nov 05 2022
## v2.1.0 Nov 05 2022

1. Add citation count in the details panel.
2. PDFs will be automatically downloaded when importing papers from adsabs.harvard.edu.
Expand All @@ -11,27 +18,27 @@
5. Tags / Folders in the mainview is sorted.
6. The column width of the table view is adjustable now!

# v2.0.7 Oct 29 2022
## v2.0.7 Oct 29 2022

1. Optimised PDF processing for papers in Chinese.
2. A new option to symlink the file when import it rather than moving or copying it. Thus, you can keep files in the original location.

# v2.0.6 Oct 23 2022
## v2.0.6 Oct 23 2022

1. New Scrapers: bioRxiv, medRxiv, and chemRxiv.
2. Better DOI regex.
3. New icon.
4. Fixed some bugs.

# v2.0.5 Oct 18 2022
## v2.0.5 Oct 18 2022

1. The beta version of the Microsoft Word Add-in is released.
2. Linux build is avaliable now.
3. The code repository metadata is editable now.
4. Better hover experience of the search bar.
5. Fixed some bugs.

# v2.0.4 Oct 08 2022
## v2.0.4 Oct 08 2022

1. Fulltext search mode: the highlights of the search results will be displayed in the PDF preview view.
2. Adjustable width of the detail panel.
Expand Down
7 changes: 6 additions & 1 deletion app/main/win_main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@ export async function createMainWindow(

// Make all links open with the browser, not with the application
win.webContents.setWindowOpenHandler(({ url }) => {
if (url.startsWith("https:")) shell.openExternal(url);
if (url.startsWith("http")) shell.openExternal(url);
return { action: "deny" };
});

win.webContents.on('will-navigate', function (e, url) {
e.preventDefault();
shell.openExternal(url);
});

setMainMenu(win, preference);
nativeTheme.themeSource = preference.get("preferedTheme") as
| "dark"
Expand Down
2 changes: 1 addition & 1 deletion app/preference/preference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const defaultPreferences: PreferenceStore = {
showMainYear: true,
showMainPublication: true,
showMainPubType: false,
showMainRating: false,
showMainRating: true,
showMainFlag: true,
showMainTags: false,
showMainFolders: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const prefState = MainRendererStateStore.usePreferenceState();
>
<div v-if="showPubTime">{{ item.pubTime }}</div>
<div
class="flex space-x-2 max-w-[60%] text-ellipsis overflow-hidden flex-none"
class="flex space-x-2 text-ellipsis overflow-hidden shrink"
v-if="showPublication"
>
<div>|</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ watch(props, (props, prevProps) => {
</div>
<div
id="detail-markdown-preview"
class="text-xs pr-2 overflow-hidden"
class="text-xs pr-2 overflow-hidden break-words"
:class="isExpanded ? '' : 'max-h-96'"
v-html="renderedHTML"
ref="markdownArea"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ onMounted(() => {
:title="$t('mainview.note')"
v-if="entity.note.length > 0 && !entity.note.startsWith('<md>')"
>
<div class="text-xxs">
<div class="text-xxs break-words">
{{ entity.note }}
</div>
</Section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ const onClearClicked = (payload: Event) => {
</div>
<BIconX
id="search-clear-btn"
class="my-auto text-neutral-400 invisible dark:text-neutral-500 hover:text-neutral-800 hover:dark:text-neutral-300 cursor-pointer peer-focus:visible hover:visible group-hover:visible"
class="my-auto text-neutral-400 dark:text-neutral-500 hover:text-neutral-800 hover:dark:text-neutral-300 cursor-pointer opacity-0 peer-focus:opacity-100 hover:opacity-100 group-hover:opacity-100 transition ease-in-out duration-75"
@click="onClearClicked"
/>
<button
class="flex-none my-auto p-2 w-[100px] text-xxs bg-neutral-200 dark:bg-neutral-600 text-neutral-500 dark:text-neutral-200 rounded-r-md invisible peer-focus:visible group-hover:visible hover:visible hover:bg-neutral-300 hover:dark:bg-neutral-500"
class="flex-none my-auto p-2 w-[100px] text-xxs bg-neutral-200 dark:bg-neutral-600 text-neutral-500 dark:text-neutral-200 rounded-r-md opacity-0 transition ease-in-out duration-75 peer-focus:opacity-100 group-hover:opacity-100 hover:opacity-100 hover:bg-neutral-300 hover:dark:bg-neutral-500"
@click="onModeClicked"
>
{{ $t(searchModeLabel[viewState.searchMode]) }}
Expand Down
4 changes: 4 additions & 0 deletions app/renderer/ui/main-view/menubar-view/window-menu-bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ const onMaximizeClicked = () => {
>
<div>
<MenuButton
id="win-more-menu-btn"
class="inline-flex justify-center w-7 h-6 rounded-md hover:bg-neutral-200 hover:dark:bg-neutral-700 cursor-default"
>
<BIconThreeDots
Expand All @@ -296,6 +297,7 @@ const onMaximizeClicked = () => {
>
<div class="pb-1">
<MenuItem
id="list-view-btn"
v-slot="{ active }"
class="w-full rounded-md p-1 hover:bg-neutral-200 hover:dark:bg-neutral-700"
@click="emit('click', 'list-view')"
Expand All @@ -312,6 +314,7 @@ const onMaximizeClicked = () => {
</div>
</MenuItem>
<MenuItem
id="table-view-btn"
v-slot="{ active }"
class="w-full rounded-md p-1 hover:bg-neutral-200 hover:dark:bg-neutral-700"
@click="emit('click', 'table-view')"
Expand All @@ -328,6 +331,7 @@ const onMaximizeClicked = () => {
</div>
</MenuItem>
<MenuItem
id="table-reader-view-btn"
v-slot="{ active }"
class="w-full rounded-md p-1 hover:bg-neutral-200 hover:dark:bg-neutral-700"
@click="emit('click', 'tableandpreview-view')"
Expand Down
19 changes: 7 additions & 12 deletions app/renderer/ui/whats-new-view/whats-new-view-cn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,17 @@ onMounted(() => {
v-else
/>
<p class="text-center text-2xl font-bold mb-8">
Paperlib 2.1.0 - 2.1.1 更新内容
Paperlib 2.1.2 更新内容
</p>

<ul class="list-disc mb-5">
<li>修复了一个针对新用户的重要 Bug。</li>
<li>文章详情面板添加了引用计数。</li>
<li>从 adsabs.harvard.edu 导入时可以自动下载 PDF。</li>
<li>一个新的 PDF 下载器: semanticscholar.org.</li>
<li>在表格视图添加 AddTime 列。</li>
<li>标签 / 组在主视图中排序显示。</li>
<li>⭐ 表格试图的列宽可以调整了!</li>
<li>浏览器插件支持 CNKI (中国知网)。</li>
<li>
如果 DBLP 返回元数据带有 DOI,那么优先使用此 DOI 获取其余元数据。
</li>
<li>修复搜索栏动画的问题。</li>
<li>修复在 PDF 浏览器里点击链接时,无法在外部浏览器打开的问题。</li>
</ul>
<img
class="w-[400px] mx-auto shadow-lg"
src="../../assets/whatsnew-1.png"
/>
<div
id="whats-new-close-btn"
class="mt-10 mx-auto flex w-60 h-10 bg-accentlight dark:bg-accentdark text-neutral-50 rounded-md shadow-md cursor-pointer"
Expand Down
21 changes: 8 additions & 13 deletions app/renderer/ui/whats-new-view/whats-new-view-en.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,20 @@ onMounted(() => {
v-else
/>
<p class="text-center text-2xl font-bold mb-8">
What's New in Paperlib 2.1.0 - 2.1.1
What's New in Paperlib 2.1.2
</p>

<ul class="list-disc mb-5">
<li>Fixed a fatal bug for new users.</li>
<li>Add citation count in the details panel.</li>
<li>Browser extension now supports CNKI (中国知网).</li>
<li>
PDFs will be automatically downloaded when importing papers from
adsabs.harvard.edu.
If DBLP returns metadata with a doi, then use this DOI first to get
metadata.
</li>
<li>Fixed an animation bug of the search bar.</li>
<li>
Fixed a bug occured when clicking a URL link in the PDF reader view.
</li>
<li>A new PDF downloader: semanticscholar.org.</li>
<li>Add AddTime column in the table view.</li>
<li>Tags / Folders in the mainview is sorted.</li>
<li>⭐ The column width of the table view is adjustable now!</li>
</ul>
<img
class="w-[400px] mx-auto shadow-lg"
src="../../assets/whatsnew-1.png"
/>
<div
id="whats-new-close-btn"
class="mt-10 mx-auto flex w-60 h-10 bg-accentlight dark:bg-accentdark text-neutral-50 rounded-md shadow-md cursor-pointer"
Expand Down
Loading

0 comments on commit a5cf0f0

Please sign in to comment.