Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix misc layout issues #2282

Merged
merged 36 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c56cb94
test: type interface for rightsidebarresizecontrol
shanberg Aug 15, 2022
68e9b9f
fix: correct prop name for sidebar width
shanberg Aug 15, 2022
81af9a3
rfct: minor prop cleanup
shanberg Aug 15, 2022
54310a4
fix: misc toolbar cleanup
shanberg Aug 15, 2022
ff96b34
rfct: unify css transitions for smoother theme switch
shanberg Aug 15, 2022
07d8da4
fix: clean up page buttons
shanberg Aug 15, 2022
79a07ec
fix: better daily notes fn
shanberg Aug 15, 2022
9daac29
fix: solve theme issue with buttons
shanberg Aug 16, 2022
cbd8534
fix: solve theme issue with buttons
shanberg Aug 16, 2022
66fd75a
fix: solve theme issue with buttons
shanberg Aug 16, 2022
07fa188
fix: solve theme issue with buttons
shanberg Aug 16, 2022
848dd16
fix: autocomplete menu works again
shanberg Aug 16, 2022
7be8d14
lint
shanberg Aug 16, 2022
3345253
improvement: new daily notes scrolling behavior
shanberg Aug 16, 2022
d379df8
fix: more predictable daily scrolling behavior
shanberg Aug 16, 2022
3591f34
minor tweaks to daily
shanberg Aug 16, 2022
2b0fb35
fix: pages should stretch-sorry
shanberg Aug 16, 2022
c2e701c
fix: remove console log
shanberg Aug 16, 2022
6b62ab4
fix: don't mount autocomplete els too often
shanberg Aug 16, 2022
00c5ac2
fix: faster daily notes
shanberg Aug 16, 2022
585b9f1
fix: better icon sizing in comments
shanberg Aug 16, 2022
ab133bf
minor progress on slash menus
shanberg Aug 17, 2022
153bc64
fix: autocomplete menus work again
shanberg Aug 17, 2022
3a8171a
fix: import textarea pos correctly
shanberg Aug 17, 2022
754a1c5
update icons
shanberg Aug 17, 2022
2e70672
Merge branch 'main' into fix-misc-new-layout-issues
shanberg Aug 17, 2022
092c6af
fix: correct icon attr casing
shanberg Aug 17, 2022
029ecb9
chore: lint
shanberg Aug 17, 2022
4e2d250
fix: remove broken icon
shanberg Aug 17, 2022
fed68c2
fix: hide debug cursor
shanberg Aug 17, 2022
0201521
fix: misc issues
shanberg Aug 17, 2022
5a75a0e
fix: misc issues
shanberg Aug 17, 2022
ca89f7d
Merge branch 'main' into fix-misc-new-layout-issues
shanberg Aug 17, 2022
70b3829
fix: remove broken icon
shanberg Aug 17, 2022
fb544d1
Merge branch 'fix-misc-new-layout-issues' of https://github.com/shanb…
shanberg Aug 17, 2022
f21b097
Merge branch 'main' into fix-misc-new-layout-issues
filipesilva Aug 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"react-highlight.js": "1.0.7",
"react-intersection-observer": "^8.32.1",
"react-window": "^1.8.6",
"textarea-caret": "^3.1.0",
"tslib": "^2.3.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/cljs/athens/main/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
:autoHideMenuBar true
:frame false
:titleBarStyle "hidden"
:trafficLightPosition {:x 19, :y 34}
:trafficLightPosition {:x 19, :y 33}
:webPreferences {:contextIsolation false
:nodeIntegration true
:worldSafeExecuteJavaScript true
Expand Down
2 changes: 1 addition & 1 deletion src/cljs/athens/util.cljs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns athens.util
(:require
["/textarea" :as getCaretCoordinates]
["/theme/theme" :refer [theme]]
["@chakra-ui/react" :refer [createStandaloneToast]]
["textarea-caret" :as getCaretCoordinates]
[athens.config :as config]
[athens.electron.utils :as electron.utils]
[clojure.string :as string]
Expand Down
8 changes: 6 additions & 2 deletions src/cljs/athens/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
:spacing 0
:overflowY "auto"
:height "100vh"
:bg "background.floor"
:transitionDuration "fast"
:transitionProperty "background"
:transitionTimingFunction "ease-in-out"
:align "stretch"
:position "relative"}
[app-toolbar/app-toolbar]
Expand All @@ -81,7 +85,7 @@
[:> MainContent {:rightSidebarWidth @right-sidebar-width
:isRightSidebarOpen @right-sidebar-open?}
[pages/view]]
[:> RightSidebarResizeControl {:sidebarWidth @right-sidebar-width
:isSidebarOpen @right-sidebar-open?
[:> RightSidebarResizeControl {:rightSidebarWidth @right-sidebar-width
:isRightSidebarOpen @right-sidebar-open?
:onResizeSidebar #(rf/dispatch [:right-sidebar/set-width %])}]
[right-sidebar/right-sidebar]]]])]]])))
4 changes: 2 additions & 2 deletions src/cljs/athens/views/blocks/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
["/components/Block/PropertyName" :refer [PropertyName]]
["/components/Block/Reactions" :refer [Reactions]]
["/components/Block/Toggle" :refer [Toggle]]
["/components/Icons/Icons" :refer [BlockEmbedIcon TextIcon ChatIcon ArchiveIcon]]
["/components/Icons/Icons" :refer [BlockEmbedIcon TextIcon ChatBubbleIcon ArchiveIcon]]
["/components/References/InlineReferences" :refer [ReferenceGroup ReferenceBlock]]
["@chakra-ui/react" :refer [Box Breadcrumb BreadcrumbItem BreadcrumbLink Button Divider HStack MenuDivider MenuItem MenuList VStack]]
[athens.common-db :as common-db]
Expand Down Expand Up @@ -375,7 +375,7 @@
(when comments-enabled?
[:> MenuItem {:children "Add comment"
:onClick #(ctx-menu/handle-click-comment % uid)
:icon (r/as-element [:> ChatIcon])}])
:icon (r/as-element [:> ChatBubbleIcon])}])
(when reactions-enabled?
[:<>
[:> MenuDivider]
Expand Down
12 changes: 6 additions & 6 deletions src/cljs/athens/views/left_sidebar.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns athens.views.left-sidebar
(:require
["/components/Icons/Icons" :refer [DailyNotesIcon AllPagesIcon SearchIcon GraphIcon]]
["/components/Icons/Icons" :refer [CalendarEditFillIcon AllPagesIcon SearchIcon GraphIcon]]
["/components/Layout/MainSidebar" :refer [MainSidebar]]
["/components/SidebarShortcuts/List" :refer [List]]
["@chakra-ui/react" :refer [Button VStack Flex Heading ButtonGroup Link Flex]]
Expand Down Expand Up @@ -45,11 +45,11 @@
:justifyContent "start"
:leftIcon (r/as-element [:> SearchIcon])}
"Find or Create a Page"]
[route-button (= route-name :home) "Daily Notes" (r/as-element [:> DailyNotesIcon]) (fn [_]
(rf/dispatch [:reporting/navigation {:source :main-sidebar
:target :home
:pane :main-pane}])
(router/nav-daily-notes))]
[route-button (= route-name :home) "Daily Notes" (r/as-element [:> CalendarEditFillIcon]) (fn [_]
(rf/dispatch [:reporting/navigation {:source :main-sidebar
:target :home
:pane :main-pane}])
(router/nav-daily-notes))]
[route-button (= route-name :pages) "All Pages" (r/as-element [:> AllPagesIcon]) (fn [_]
(rf/dispatch [:reporting/navigation {:source :main-sidebar
:target :all-pages
Expand Down
7 changes: 2 additions & 5 deletions src/cljs/athens/views/notifications/popover.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,11 @@
notification-list (get-inbox-items-for-popover @db/dsdb user-page-title)
navigate-user-page #(router/navigate-page user-page-title)
num-notifications (count notification-list)]
[:> Popover {:closeOnBlur true}
[:> Popover {:closeOnBlur true :size "md"}

[:> PopoverTrigger
[:> Box {:position "relative"}
[:> IconButton {"aria-label" "Notifications"
:variant "ghost"
:fontSize "1.3em"
:onDoubleClick navigate-user-page
:onClick (fn [e]
(when (.. e -shiftKey)
Expand All @@ -139,8 +137,7 @@
:right "-3px" :bottom "-1px" :variant "ghost" :zIndex 1} num-notifications])]]


[:> PopoverContent {:maxWidth "max-content"
:maxHeight "calc(100vh - 4rem)"}
[:> PopoverContent {:maxHeight "calc(100vh - 4rem)"}
[:> PopoverCloseButton]
[:> PopoverHeader [:> Button {:onClick navigate-user-page :rightIcon (r/as-element [:> ArrowRightIcon])} "Notifications"]]
[:> Flex {:p 0
Expand Down
29 changes: 18 additions & 11 deletions src/cljs/athens/views/pages/daily_notes.cljs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
(ns athens.views.pages.daily-notes
(:require
["/components/Page/Page" :refer [DailyNotesPage]]
["@chakra-ui/react" :refer [VStack]]
["framer-motion" :refer [AnimatePresence]]
["/components/Page/Page" :refer [DailyNotesPage DailyNotesList]]
[athens.dates :as dates]
[athens.reactive :as reactive]
[athens.views.pages.node-page :as node-page]
Expand All @@ -26,15 +24,24 @@
(defn page
[]
(let [note-refs (subscribe [:daily-notes/items])
get-next-note #(dispatch [:daily-note/next (dates/get-day (dates/uid-to-date (last @note-refs)) 1)])]
get-another-note #(dispatch [:daily-note/next (dates/get-day (dates/uid-to-date (last @note-refs)) 1)])]
(fn []
(if (empty? @note-refs)
(dispatch [:daily-note/next (dates/get-day)])
(let [notes (reactive-pull-many @note-refs)]
[:> VStack {:alignSelf "stretch" :align "stretch" :py 16 :px [2 4 8] :spacing 8}
[:> AnimatePresence {:initial false}
(doall
(for [{:keys [block/uid]} notes]
[:> DailyNotesPage {:key uid
:onFirstAppear get-next-note}
[node-page/page [:block/uid uid]]]))]])))))
[:> DailyNotesList {:id "daily-notes"
:onGetAnotherNote get-another-note
:minHeight "calc(100vh + 1px)"
:height "calc(100vh + 1px)"
:display "flex"
:overflowY "auto"
:gap "1.5rem"
:px "2rem"
:alignItems "center"
:flex "1 1 100%"
:flexDirection "column"}
(doall
(for [{:keys [block/uid]} notes]
[:> DailyNotesPage {:key uid
:isReal true}
[node-page/page [:block/uid uid]]]))])))))
5 changes: 2 additions & 3 deletions src/cljs/athens/views/right_sidebar/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[athens.views.right-sidebar.events]
[athens.views.right-sidebar.shared :as shared]
[athens.views.right-sidebar.subs]
[re-frame.core :as rf :refer [dispatch]]))
[re-frame.core :as rf]))


;; Components
Expand Down Expand Up @@ -37,8 +37,7 @@
[open? items rf-width]
[:> RightSidebar
{:isOpen open?
:rightSidebarWidth rf-width
:onResizeSidebar #(dispatch [:right-sidebar/set-width %])}
:rightSidebarWidth rf-width}
(if (empty? items)
[empty-message]
[:> List {:items (shared/create-sidebar-list items)
Expand Down
21 changes: 16 additions & 5 deletions src/js/components/AllPagesTable/AllPagesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ const renderDate = (date) => {
}
}

const RowTd = ({ children, ...props }) => {
return (
<Td {...props}
transitionProperty="background"
transitionTimingFunction="ease-in-out"
transitionDuration="fast"
>
{children}
</Td>
)
}

const Row = ({ index, data, style }) => {

Expand All @@ -46,7 +57,7 @@ const Row = ({ index, data, style }) => {
display="flex"
className={index % 2 ? 'index-even' : 'index-odd'}
>
<Td
<RowTd
overflow="hidden"
>
<Button
Expand All @@ -64,10 +75,10 @@ const Row = ({ index, data, style }) => {
>
{DISPLAY_TITLES[item[":node/title"]] || item[":node/title"]}
</Button>
</Td>
<Td>{item[":block/_refs"]?.length || 0}</Td>
<Td>{renderDate(item[":time/modified"])}</Td>
<Td>{renderDate(item[":time/created"])}</Td>
</RowTd>
<RowTd>{item[":block/_refs"]?.length || 0}</RowTd>
<RowTd>{renderDate(item[":time/modified"])}</RowTd>
<RowTd>{renderDate(item[":time/created"])}</RowTd>
</Tr>
)
};
Expand Down
Loading