From 8c424372d9c5f8f15f54f3b9703b1d4196909e4c Mon Sep 17 00:00:00 2001 From: Abhinav Reddy Mothe Date: Tue, 9 Mar 2021 06:47:00 +0530 Subject: [PATCH 1/3] fix(web): theme and graph conf issue #773 (#779) --- src/cljs/athens/db.cljs | 16 +++++++++++++++- src/cljs/athens/events.cljs | 11 ++++++++--- src/cljs/athens/views/graph_page.cljs | 14 ++------------ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/cljs/athens/db.cljs b/src/cljs/athens/db.cljs index 0c4e362448..17a2063830 100644 --- a/src/cljs/athens/db.cljs +++ b/src/cljs/athens/db.cljs @@ -16,6 +16,19 @@ (def ego-url "https://raw.githubusercontent.com/athensresearch/athens/master/data/ego.datoms") +;; -- seed data ----------------------------------------------------------- + + +(def default-graph-conf + {:hlt-link-levels 1 + :link-distance 50 + :charge-strength -15 + :local-depth 1 + :root-links-only? false + :orphans? true + :daily-notes? true}) + + ;; -- re-frame ----------------------------------------------------------- (defonce rfdb {:user "Socrates" @@ -36,7 +49,8 @@ :mouse-down false :daily-notes/items [] :selected/items [] - :theme/dark false}) + :theme/dark false + :graph-conf default-graph-conf}) ;; -- JSON Parsing ---------------------------------------------------- diff --git a/src/cljs/athens/events.cljs b/src/cljs/athens/events.cljs index c2adff3e3c..3efcd4e858 100644 --- a/src/cljs/athens/events.cljs +++ b/src/cljs/athens/events.cljs @@ -18,7 +18,8 @@ :boot/web (fn [_ _] {:db db/rfdb - :dispatch-n [[:loading/unset]]})) + :dispatch-n [[:loading/unset] + [:local-storage/set-theme]]})) (reg-event-db @@ -408,8 +409,12 @@ (reg-event-fx :get-db/init (fn [{rfdb :db} _] - {:db (-> db/rfdb - (assoc :loading? true)) + {:db (cond-> db/rfdb + true (assoc :loading? true) + + (= (js/localStorage.getItem "theme/dark") "true") + (assoc :theme/dark true)) + :async-flow {:first-dispatch (if false [:local-storage/get-db] [:http/get-db]) diff --git a/src/cljs/athens/views/graph_page.cljs b/src/cljs/athens/views/graph_page.cljs index 727cea260d..bc5f8ef17b 100644 --- a/src/cljs/athens/views/graph_page.cljs +++ b/src/cljs/athens/views/graph_page.cljs @@ -92,21 +92,11 @@ (assoc db :graph-conf n-gc)))) -(def default-graph-conf - {:hlt-link-levels 1 - :link-distance 50 - :charge-strength -15 - :local-depth 1 - :root-links-only? false - :orphans? true - :daily-notes? true}) - - (rf/reg-event-db :graph/load-graph-conf (fn [db _] (let [conf (or (some->> "graph-conf" js/localStorage.getItem read-string) - default-graph-conf)] + db/default-graph-conf)] (js/localStorage.setItem "graph-conf" conf) (assoc db :graph-conf conf)))) @@ -245,7 +235,7 @@ [comp (merge props - {:value (or (key graph-conf) (key default-graph-conf)) + {:value (or (key graph-conf) (key db/default-graph-conf)) :color "primary" :onChange (fn [_ n-val] (and onChange (onChange n-val)) From a43ea2d8aecc38cb0a12f6f6b7425e22437cf2e8 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 8 Mar 2021 20:03:56 -0800 Subject: [PATCH 2/3] v1.0.0-beta.52 --- CHANGELOG.md | 16 ++++++++++++++++ package.json | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc4b8a3e22..ef8cd1d187 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.0.0-beta.52](https://github.com/athensresearch/athens/compare/v1.0.0-beta.51...v1.0.0-beta.52) (2021-03-09) + + +### Bug Fixes + +* **clj-kondo:** upgrade CI, with-let, specter, remove #_:clj-kondo/ignore ([#769](https://github.com/athensresearch/athens/issues/769)) ([40dabd7](https://github.com/athensresearch/athens/commit/40dabd71998514b7368a8d73959b4e6e27f5cfd1)) +* **web:** theme and graph conf issue [#773](https://github.com/athensresearch/athens/issues/773) ([#779](https://github.com/athensresearch/athens/issues/779)) ([8c42437](https://github.com/athensresearch/athens/commit/8c424372d9c5f8f15f54f3b9703b1d4196909e4c)) +* unlinked reference overflowing content ([#770](https://github.com/athensresearch/athens/issues/770)) ([defc78d](https://github.com/athensresearch/athens/commit/defc78d3ddfa7faafc585f7e9203d5cdd5c70bb2)) + + +### Documentation + +* add download links for M1 ([6d33825](https://github.com/athensresearch/athens/commit/6d33825605ce0e09d4a5b37887c318bf6be1d96a)) +* update screenshot url ([b76f45f](https://github.com/athensresearch/athens/commit/b76f45fe76fe89ba6a37764d369b23289cbaa582)) +* **README:** update screenshots, add PH badge ([#774](https://github.com/athensresearch/athens/issues/774)) ([713b4a3](https://github.com/athensresearch/athens/commit/713b4a337b5716306a525d89e353311fa8cbcb7b)) + ## [1.0.0-beta.51](https://github.com/athensresearch/athens/compare/v1.0.0-beta.50...v1.0.0-beta.51) (2021-03-07) diff --git a/package.json b/package.json index b2019ab1f4..3a2fc603d2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Athens", "author": "athensresearch", - "version": "1.0.0-beta.51", + "version": "1.0.0-beta.52", "description": "An open-source alternative to Roam Research", "repository": { "type": "git", From 07dc65528059d943531ab14d15e0ce5b53ed5819 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 8 Mar 2021 21:43:28 -0800 Subject: [PATCH 3/3] doc: use gifs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e8027e845..d13977e100 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Athens is an open-source and local-first alternative to [Roam Research](https:// **Demo Athens in your browser (no changes are saved): https://athensresearch.github.io/athens** -![graph-viz-gif](https://athens-assets-1.s3.us-east-2.amazonaws.com/hero-2.png) +![writing-demo](https://github.com/tangjeff0/athens-public/blob/main/bret-victor-demo.gif) ### Open-Source @@ -42,7 +42,7 @@ The problem with notetaking apps like Evernote or Apple Notes is that once you w Athens lets you take notes with minimal systems, structure, and organization, freeing you to stay creative and in flow state. Athens does this with [[bidirectional links]], ((block references)), and a graph database. -![tools-demo](https://athens-assets-1.s3.us-east-2.amazonaws.com/tools-2.png) +![graph-demo](https://github.com/tangjeff0/athens-public/blob/main/open-source-graph-demo.gif) # [Building Locally or Contributing](CONTRIBUTING.md)