Commit graph svitak/app
Author SHA1 Message Date
1f2a14c5f3
add snap when finishing search 2026-07-11 19:40:26 +01:00
6f4a95eb46
fix search crash bug 2026-07-11 19:40:26 +01:00
9f9e59b450
refactor epPicker into smaller functions using ExceptT 2026-07-11 15:47:00 +01:00
8be29359fc
add Html and PlainText types, improved type safety 2026-07-07 13:33:51 +01:00
6ca9e43520
keybinds: toggling paginated/scrolling, focus/unfocus search bar 2026-07-06 17:44:39 +01:00
4170a958d1
feature: add split page, scrolled or paginated tracking 2026-07-06 17:44:24 +01:00
4e990f19cd
add book-wide text search 2026-07-06 01:16:57 +01:00
da70b3ccf2
add LRU cache 2026-07-05 01:45:47 +01:00
81c2caaf67
add worker thread tracking
add stGen which gets bumped for every worker thread spawned by
loadBook

every thread captures stGen when it spawns and before actually loading
the book in the main thread, and in the worker thread it checks if
myGen == stGen

this throws away stale requests, meaning if you try and load another
book while one is still loading, it will ignore the one still loading
and start loading the latest request
2026-07-02 02:50:31 +01:00
f6ec5c20d8
allow loading of new epub through file picker
ctxRender changed to a TVar to allow mutability of the render

make loadBook reset stCache and stIndex

write render TVar right before handing off to main thread

remove everything from the sidebar ListBox before populating it again
2026-07-01 20:05:04 +01:00
05fdac1253
add header bar 2026-06-30 23:21:55 +01:00
2011d638b0
refactor: streaming loader, hierarchical TOC, parser robustness
Rework the reader around a clean BookInfo interface and lazy chapter loading.

Types/parser:
- BookInfo now splits into loadStructure (cheap: spine refs + TOC tree) and renderChapter (one chapter on demand). EpubEnv carries the parsed archive.
- resolveZipPath collapses ./.. and strips #fragments (normalise does not), so relative hrefs like ../Images/x.jpg resolve; used for chapters and images.
- decodeEntry tolerates encodings: UTF-8/UTF-16 BOMs, Latin-1 fallback instead of throwing on invalid bytes.
- Skip spine items with no manifest entry instead of throwing an error.
- Scan the zip for a .opf if container.xml is missing.
- Image inlining rewrites the src URL string, not the whole <img> tag (scalpel
  re-serialises tags, so a whole-tag replace silently missed self-closing imgs).

Navigation:
- Hierarchical TOC: ncxToc (EPUB 2), navToc (EPUB 3), guideToc (<guide> fallback). Nested scrapers use atDepth 1 to take only direct children.

UI:
- Streaming: render the opened chapter on demand, cache it, preload neighbours so arrow paging is instant with a placeholder that covers uncached jumps.
- Sidebar shows the TOC tree with CSS styling. Clicks scroll to #fragments.
- wrapHtml wraps each body in a full HTML document for reliable WebKit render.

Test: 'svitak-test <book> <idx>' dumps one rendered chapter. cabal test stanza fixed to list all needed modules/deps.
2026-06-26 03:45:29 +01:00
f17f6a63e2
improve chapter name sanitization 2026-06-25 22:08:53 +01:00
dcf7ce2971
remove redundant imports 2026-03-23 01:42:44 +00:00
9784b7c7de
improve error handling 2026-03-22 03:24:56 +00:00
a5f227fc7a
finish navigation implementation in epubparser 2026-03-19 02:31:01 +00:00
36d6d46c57
remove repeated function 2026-03-19 02:31:01 +00:00
ec47012b5f
add epub3 navigation parsing 2026-03-19 02:31:01 +00:00
37ee16bcf8
refactor ui 2026-02-27 21:57:46 +00:00
fd05214fee
epub version awareness 2026-02-23 02:28:02 +00:00
acd221be28
epub version detection 2026-02-23 01:30:54 +00:00
c7850d3ad1
fix imports 2026-02-22 23:50:45 +00:00
80be08965e implement generic bookinfo and move logic to parser 2026-02-12 12:47:01 +00:00
55b04ecf44 explicit types 2026-02-12 11:17:36 +00:00
7cd9e79c94 add navigation module 2026-02-11 06:22:09 +00:00
96924df78f compressed function rewrite 2026-02-11 03:50:42 +00:00
0a43a51205 epub3 nav support 2026-02-11 03:07:49 +00:00
8ebfc59d2b page tracking 2026-02-09 04:11:59 +00:00
be79979183 safe indexing 2026-02-09 03:31:09 +00:00
d65a483878 nxc parsing 2026-02-09 03:15:06 +00:00
4ddb090b2f table of contents integration 2026-02-08 03:02:54 +00:00
eb479d0ae3 break up UI into different functions 2026-02-07 03:07:14 +00:00
de7a64cade replace tagsoup with scalpel 2026-02-04 06:15:20 +00:00
b24288eb70 add seperate types module 2026-02-05 03:25:31 +00:00
4c6c181e65 implement consistent formatting 2026-02-04 05:07:48 +00:00
1cab6a9bab seperate state handling logic 2026-02-04 03:51:47 +00:00
28e5d6ec36 seperate pure functions from IO 2026-02-04 02:38:17 +00:00
a53ef52902 Documentation 2026-02-04 02:12:28 +00:00
a41828dbbd Eager parsing on seperate thread 2026-01-28 19:21:10 +00:00
e1682a861a Implement STM Concurrency
add stm to project file
2026-01-28 18:18:41 +00:00
018e5290a3 feature:MVar Implementation
Replace IORef

Branch created to replace the use of IORef with MVar
2026-01-26 13:44:06 +00:00
83a767968b refactor:remove gui.hs 2026-01-27 21:38:28 +00:00
4a55d773c6 improve chapter detection 2026-01-27 21:21:15 +00:00
2c06dda760 Update project file
Needed for new test suite
2026-01-26 14:26:29 +00:00
3987c1a853 Begin implementing chapter title parsing
Right now chapter titles are completely plain, parsing the tags will allow us to render it properly.

Revert chapterTitle addition and add it to seperate branch until its completed

Delegating the task of implementing chapter title parsing into a different branch instead of having it incomplete in the main one

Merge chtitle into main
2026-01-26 09:26:45 +00:00
fab1d6b84c Add persistence module
This will allow us to save the last chapter the user read, thus making it easier to track progress.

Implement persistence module

saveLastRead saves the chapter after each new one is read and writes it to xdgdata
2026-01-26 08:32:20 +00:00
2f47493d0e Starting work on persistence feature 2026-01-26 06:10:27 +00:00
935dc795d0 Add navigation and proper webkit integration with basic chapter display 2026-01-26 04:30:47 +00:00
396a9cdb16 Add image rendering alongside automatic mimetype detection 2026-01-26 02:59:11 +00:00
b666d8477f Integrate parsing backend with gtk. TODO: Base64 image embedding for image compatibility 2026-01-26 02:00:06 +00:00