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

Feat/Improved Search and Color Switcher #10132

Merged
merged 170 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 169 commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
fe874cf
adr shui
bendyorke May 18, 2023
641a38a
Setting of radix colors
bendyorke May 18, 2023
3e86da1
Initial radix color styling
bendyorke May 24, 2023
c6cad41
second pass at styling
bendyorke May 26, 2023
6e31a55
Inital radix reskin
bendyorke Jun 1, 2023
c8692d1
Updates to radix jakobs feedback
bendyorke Jun 2, 2023
a7b9c01
Add native gradient support
bendyorke Jun 9, 2023
1e264c9
Update codemirror
bendyorke Jun 23, 2023
dc78790
Revert codemirror solarized theme
bendyorke Jun 23, 2023
4e2d980
button and cmdk
bendyorke Jun 30, 2023
6f984d4
cmdk
bendyorke Jun 30, 2023
8bff0f2
cmdk initial implementation
bendyorke Aug 2, 2023
24006b3
updates
bendyorke Aug 25, 2023
0f7f9ad
Merge github-bendyorke:logseq/logseq into feat/cmdk
bendyorke Aug 31, 2023
a2ff638
merge updates
bendyorke Sep 1, 2023
246e904
cmdk2 updates
bendyorke Sep 15, 2023
2ee777a
Updates
bendyorke Sep 24, 2023
e340713
Updates
bendyorke Sep 25, 2023
3893d26
Fix lower case bug
bendyorke Sep 26, 2023
7868b3a
Jakob feedback
bendyorke Sep 29, 2023
3106eef
Fix breaking normalization
bendyorke Sep 29, 2023
328cd58
Jakob round III
bendyorke Sep 29, 2023
2ab619e
Fix build error
bendyorke Sep 29, 2023
79a11f8
Jakob IV
bendyorke Sep 29, 2023
6247cc3
Abandon perf fix attempt
bendyorke Oct 9, 2023
145c519
Add logging to highlight query
bendyorke Oct 9, 2023
2730f3b
another round of logging
bendyorke Oct 9, 2023
2d659e8
Indice being built async + jakob feedback
bendyorke Oct 10, 2023
9d61549
Save dialog
bendyorke Oct 16, 2023
f0736c8
Hide new dialog component
bendyorke Oct 16, 2023
69e02ed
Merge branch 'master' into feat/cmdk
bendyorke Oct 16, 2023
c8b564b
fix(shortcuts): conflicts
xyhp915 Oct 19, 2023
a967c8b
fix(cmdk): page preview crash with block uuid
xyhp915 Oct 19, 2023
3325f47
resizing
bendyorke Oct 21, 2023
7a7c3b9
Design refresh
bendyorke Oct 24, 2023
a046323
new design iteration
bendyorke Oct 25, 2023
184dfd7
More design tweaks
bendyorke Oct 26, 2023
d8d3619
Fix return trigger
bendyorke Oct 26, 2023
a49df04
Various fixes
bendyorke Oct 31, 2023
3b336ba
fix: display block breadcrumb instead of its page for search items
tiensonqin Nov 1, 2023
c8cfa58
fix: lower case block search results
tiensonqin Nov 1, 2023
42aa66c
fix: replace buggy shortcuts handler with mixins
tiensonqin Nov 1, 2023
d6c75d6
enhance: show more or less when it's needed
tiensonqin Nov 1, 2023
5df22ff
enhance: no need to show command label for now
tiensonqin Nov 1, 2023
11d9cd0
fix: display create items when page not exists
tiensonqin Nov 1, 2023
dc73b07
fix: hidden text
tiensonqin Nov 1, 2023
e12ac12
chore: remove x button for cmdk
tiensonqin Nov 1, 2023
941fd25
fix: search block should focus and highlight the block
tiensonqin Nov 1, 2023
008d6ed
enhance: replace action buttons with hints
tiensonqin Nov 1, 2023
00ae320
fix: esc should clear input if q is not empty
tiensonqin Nov 1, 2023
6c9209b
chore: clean unused local state
tiensonqin Nov 1, 2023
dd613a6
fix: block copy ref
tiensonqin Nov 1, 2023
a99a66e
chore: cleanup
tiensonqin Nov 1, 2023
837e571
enhance: replace :: with / to trigger filters/commands
tiensonqin Nov 1, 2023
519414a
Testing test fixes
bendyorke Nov 2, 2023
5be4f1f
Add commands to search only filters
tiensonqin Nov 2, 2023
439d08c
enhance: move tip to the left
tiensonqin Nov 2, 2023
f16127c
enhance: tile sm size
tiensonqin Nov 2, 2023
07146f4
enhance: ESC to quit filter
tiensonqin Nov 2, 2023
8d2d857
fix: add default value for button theme
tiensonqin Nov 2, 2023
12ddf65
Add shui/shortcut component
tiensonqin Nov 2, 2023
6e046fb
enhance: display shortcut when highlighted
tiensonqin Nov 2, 2023
c390146
fix: type / in the beginning not working
tiensonqin Nov 2, 2023
d34f036
tip tweaks
tiensonqin Nov 2, 2023
1aae542
Comment buggy mouse enter to highlight
tiensonqin Nov 2, 2023
3f18ceb
enhance: add fade-in to shortcut
tiensonqin Nov 2, 2023
fcc38a4
fix: disable page/block preview in modals
tiensonqin Nov 2, 2023
942b167
enhance: remove modal border
tiensonqin Nov 5, 2023
2d1d841
fix: white text icon for dark theme only
tiensonqin Nov 5, 2023
f510ca6
fix: set lx-graph-12 for left sidebar text color in the light theme
tiensonqin Nov 5, 2023
4eb595c
fix: sub modal background
tiensonqin Nov 5, 2023
07519d5
fix: typo
tiensonqin Nov 5, 2023
81215e0
enhance: fuzzy search commands
tiensonqin Nov 5, 2023
fc4c1d4
fix: highlight match
tiensonqin Nov 5, 2023
007116e
fix: repeated page search results
tiensonqin Nov 5, 2023
0039a19
fix: remove height limit for cmdk modal
tiensonqin Nov 5, 2023
49db9d6
fix: scroll if only invisible
tiensonqin Nov 6, 2023
04b85f6
fix: hidden text
tiensonqin Nov 6, 2023
f6104cf
enhance: lazy render search results
tiensonqin Nov 6, 2023
fd3cfbd
enhance: set smaller time for throttle
tiensonqin Nov 6, 2023
a5435b7
Show pages ahead of commands
tiensonqin Nov 6, 2023
99a6bfc
fix: whiteboard page/block search redirect
tiensonqin Nov 6, 2023
f72afbb
enhance: group whiteboards and other pages together
tiensonqin Nov 6, 2023
b91fd4e
Remove old cmdk && command palette
tiensonqin Nov 6, 2023
90c2b38
fix: lint warnings
tiensonqin Nov 6, 2023
de4ad90
Merge branch 'master' into feat/cmdk
tiensonqin Nov 6, 2023
881b602
fix: typo
tiensonqin Nov 6, 2023
26fc93e
fix: e2e create page
tiensonqin Nov 6, 2023
bc06a7f
fix: blockref e2e test
tiensonqin Nov 6, 2023
196d056
fix: search support files
tiensonqin Nov 6, 2023
9efcaf4
fix: fs e2e tests
tiensonqin Nov 6, 2023
40c6606
Annotate all lx colors
bendyorke Nov 6, 2023
b0b24f7
fix: lint
tiensonqin Nov 6, 2023
e5837a3
fix: headings e2e tests
tiensonqin Nov 6, 2023
eeeea39
fix: button doesn't support href attribute
tiensonqin Nov 6, 2023
ded5e03
Merge branch 'master' into feat/cmdk
tiensonqin Nov 6, 2023
eb7a63c
fix: remove custom var usage
tiensonqin Nov 6, 2023
03a15e5
fix: different background color for block children
tiensonqin Nov 6, 2023
963fda0
enhance: show custom theme button when there's accent color
tiensonqin Nov 6, 2023
573a9d4
enhance: remove unnecessary settings icon
tiensonqin Nov 6, 2023
006a61f
fix: remove default commands
tiensonqin Nov 7, 2023
4fcdefd
fix: display current page matched blocks when filter is :blocks
tiensonqin Nov 7, 2023
69370db
fix: esc handler
tiensonqin Nov 7, 2023
cf93ba3
fix: up/down blocks navigation
tiensonqin Nov 7, 2023
5489b5a
fix: page rename e2e tests
tiensonqin Nov 7, 2023
59c9c24
fix: sidebar e2e tests
tiensonqin Nov 7, 2023
f68beb4
fix: page search e2e tests
tiensonqin Nov 7, 2023
863c4f9
Customizable overrides
bendyorke Nov 6, 2023
adc788f
Fix colorization
bendyorke Nov 7, 2023
0453b19
Fix white color buttons on ls theme
bendyorke Nov 7, 2023
1896d37
fix highlighted text color
bendyorke Nov 7, 2023
1c8fe61
Fix description text color
bendyorke Nov 7, 2023
e887621
Update stage to support customizing branch and cloudflare pages
tiensonqin Nov 7, 2023
0ca0aad
fix: turn off autocomplete for cmdk input
tiensonqin Nov 7, 2023
1c9858e
fix: cmdk IME input method support
tiensonqin Nov 8, 2023
05da161
enhance: tip style tweaks based on jakob's suggestions
tiensonqin Nov 8, 2023
1a260f6
enhance: show more/less only in the section that's selected
tiensonqin Nov 8, 2023
a77377f
enhance: right align bottom actions with command shortcuts
tiensonqin Nov 8, 2023
9f2bc8a
enhance: remove background for search result items
tiensonqin Nov 8, 2023
8dfad07
fix: remove hardcoded css var
tiensonqin Nov 8, 2023
117ebe0
fix: create button bg
tiensonqin Nov 8, 2023
018835b
Specify gradient stops
bendyorke Nov 8, 2023
f52e6bf
enhance: replace ui/button with shui/button
tiensonqin Nov 8, 2023
086e25b
fix: button default background color
tiensonqin Nov 9, 2023
4402dcd
chore: replace --logseq-og with --ls
tiensonqin Nov 9, 2023
5ff6928
fix: hover text color
tiensonqin Nov 9, 2023
f663443
fix: zotero buttons too large
tiensonqin Nov 9, 2023
bffa37d
enhance(ux): ctrl n/p to move cmdk result items key
xyhp915 Nov 10, 2023
572426d
fix: remove redundant shadow style
xyhp915 Nov 10, 2023
c1d9dc9
fix: search results navigation in search-only mode
tiensonqin Nov 11, 2023
9d236ee
fix: add shui context for search only close button
tiensonqin Nov 11, 2023
6608cc3
enhance(ux): disable result item hoverable when user mouse inactive
xyhp915 Nov 11, 2023
aacef8e
Add shortcuts for search only commands && current page
tiensonqin Nov 11, 2023
7f8d55a
fix: set min height for cmdk modal
tiensonqin Nov 12, 2023
0bb7099
feat: open multiple cmdk search in sidebar
tiensonqin Nov 12, 2023
c066365
enhance: mod+enter to open search in sidebar
tiensonqin Nov 12, 2023
c5568e7
enhance: add tip for mod+enter to open search in sidebar
tiensonqin Nov 12, 2023
f8630bc
enhance: allow search input to be changed in the sidebar
tiensonqin Nov 12, 2023
a87e14d
fix: graph/open and graph/remove commands
tiensonqin Nov 12, 2023
4d89867
fix: shortcuts
tiensonqin Nov 12, 2023
acf7881
Merge branch 'master' into feat/cmdk
tiensonqin Nov 12, 2023
9669343
Feat/cmdk radix tweaks (#10493)
tiensonqin Nov 12, 2023
34fd9d2
enhance: show cmdk in the basic shortcut group
tiensonqin Nov 12, 2023
40955a0
enhance: replace help font with svg
tiensonqin Nov 12, 2023
e0c7ff0
fix: keep one command for toggle cards
tiensonqin Nov 12, 2023
a31c530
fix: color-level class
tiensonqin Nov 12, 2023
8070332
fix: keyboard shortcuts style
tiensonqin Nov 13, 2023
eaadd46
fix: listitem hardcode css variable
tiensonqin Nov 13, 2023
88fc95a
fix: right sidebar background color
tiensonqin Nov 13, 2023
e471466
fix: cmdk on mobile
tiensonqin Nov 13, 2023
9805e7f
fix: search title bar not changed in sidebar
tiensonqin Nov 13, 2023
6339842
enhance(ui): shui button
xyhp915 Nov 13, 2023
0e1295b
fix(ui): shui button internal theme state
xyhp915 Nov 13, 2023
5681452
Merge branch 'feat/cmdk' of https://github.com/logseq/logseq into fea…
xyhp915 Nov 13, 2023
b05a4df
Revert "Merge branch 'feat/cmdk' of https://github.com/logseq/logseq …
xyhp915 Nov 13, 2023
b1eacf9
fix: lint warning
tiensonqin Nov 13, 2023
2a62767
chore: replace shui__ with ui__
tiensonqin Nov 13, 2023
88acf53
fix: lint warnings
tiensonqin Nov 13, 2023
bbc6e5f
Merge branch 'master' into feat/cmdk
tiensonqin Nov 13, 2023
eee0410
enhance(ui): polish document text color
xyhp915 Nov 14, 2023
bb1f0a2
fix: whiteboards e2e tests
tiensonqin Nov 14, 2023
eaea4bd
fix(ui): polish the active navigation items color
xyhp915 Nov 14, 2023
450f20a
Merge branch 'feat/cmdk' of https://github.com/logseq/logseq into fea…
xyhp915 Nov 14, 2023
8e0a700
fix: editor e2e tests
tiensonqin Nov 14, 2023
843e3d5
fix(ux): open in right sidebar with click
xyhp915 Nov 14, 2023
5023316
Merge branch 'feat/cmdk' of https://github.com/logseq/logseq into fea…
xyhp915 Nov 14, 2023
10a025e
fix: whiteboard selected button bg
tiensonqin Nov 14, 2023
a035be2
add stage deployment for the master branch
tiensonqin Nov 14, 2023
0e1d7da
fix: update workflow
tiensonqin Nov 14, 2023
7dc4b24
rename workflow
tiensonqin Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/build-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ name: Build-Stage

on:
workflow_dispatch:
inputs:
git-ref:
description: "Release Git Ref (Which branch or tag to build?)"
required: true
default: "master"
cloudflare-project-name:
description: "Cloudflare pages project name"
required: true
default: "logseq-demo"

release:
types: [released]

Expand All @@ -20,6 +30,8 @@ jobs:

steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ github.event.inputs.git-ref }}

- name: Setup Java JDK
uses: actions/setup-java@v3
Expand Down Expand Up @@ -50,7 +62,7 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 2553ea8236c11ea0f88de28fce1cbfee
projectName: 'logseq-demo'
projectName: ${{ github.event.inputs.cloudflare-project-name }}
directory: 'static'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: 'production'
52 changes: 52 additions & 0 deletions .github/workflows/deploy-stage-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy master to cloudflare pages for test

on:
push:
branches: ["master"]

env:
CLOJURE_VERSION: "1.10.1.763"
NODE_VERSION: "18"
JAVA_VERSION: "11"

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: ${{ env.JAVA_VERSION }}

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup clojure
uses: DeLaGuardo/setup-clojure@11.0
with:
cli: ${{ env.CLOJURE_VERSION }}

- name: Fetch yarn deps
run: yarn cache clean && yarn install --frozen-lockfile

- name: Build Released-Web
run: |
yarn gulp:build && clojure -M:cljs release app --config-merge '{:compiler-options {:source-map-include-sources-content false :source-map-detail-level :symbols}}'
rsync -avz --exclude node_modules --exclude '*.js.map' --exclude android --exclude ios ./static/ ./public/static/
ls -lR ./public

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 2553ea8236c11ea0f88de28fce1cbfee
projectName: "logseq-dev"
directory: "public"
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: "main"
210 changes: 207 additions & 3 deletions deps/shui/shui-graph/pages/contents.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,208 @@
- [[About Shui]]
- [[shui/components]]
- [[shui/components/table]]
-
- [[shui/components]] if there was text here
- beta
- [[shui/components/table]]
- up next
- [[shui/components/button]]
- [[shui/components/input]]
- [[shui/components/tooltip]]
- [[shui/components/text]]
- future
- [[shui/components/icon]]
- [[shui/components/tag]]
- [[shui/components/toggle]]
- [[shui/components/context-menu]]
- [[shui/components/right-sidebar]]
- [[shui/components/modal]]
- [[shui/components/properties]]
- [[shui/components/code]]
collapsed:: true
- ```css
:root {
--lx-blue-1: #123456;
}
```
- ```clojurescript
(js/document.style.setProperty "--lx-blue-1" ""#abcdef")
```
- ```python
# This is a single-line comment
"""
This is a
multi-line comment (docstring)
"""

# Import statement
import math

# Constant
CONSTANT = 3.14159

# Function definition, decorators and function call
@staticmethod
def add_numbers(x, y):
"""This function adds two numbers"""
return x + y

result = add_numbers(5, 7)

# Built-in functions
print(f"Sum is: {result}")

# Class definition and object creation
class MyClass:
# Class variable
class_var = "I'm a class variable"

def __init__(self, instance_var):
# Instance variable
self.instance_var = instance_var

def method(self):
return self.instance_var

# Creating object of the class
obj = MyClass("I'm an instance variable")
print(obj.method())

# Control flow - if, elif, else
num = 10
if num > 0:
print("Positive number")
elif num == 0:
print("Zero")
else:
print("Negative number")

# For loop and range function
for i in range(5):
print(i)

# List comprehension
squares = [x**2 for x in range(10)]

# Generator expression
gen = (x**2 for x in range(10))

# While loop
count = 0
while count < 5:
print(count)
count += 1

# Exception handling
try:
# Division by zero
x = 1 / 0
except ZeroDivisionError as e:
print("Handling run-time error:", e)

# Lambda function
double = lambda x: x * 2
print(double(5))

# File I/O
with open('test.txt', 'r') as file:
content = file.read()

# Assert
assert num > 0, "Number is not positive"

```
- ```clojure
;; This is a comment

;; Numbers
42
2.71828

;; Strings
"Hello, world!"

;; Characters
\a

;; Booleans
true
false

;; Lists
'(1 2 3 4 5)

;; Vectors
[1 2 3 4 5]

;; Maps
{:name "John Doe" :age 30 :email "john.doe@example.com"}

;; Sets
#{1 2 3 4 5}

;; Functions
(defn add-numbers [x y]
"This function adds two numbers."
(+ x y))

(def result (add-numbers 5 7))
(println "Sum is: " result)

;; Anonymous function
(#(+ %1 %2) 5 7)

;; Conditionals
(if (> result 0)
(println "Positive number")
(println "Zero or negative number"))

;; Loops
(loop [x 0]
(when (< x 5)
(println x)
(recur (+ x 1))))

;; For
(for [x (range 5)] (println x))

;; Map over a list
(map inc '(1 2 3))

;; Exception handling
(try
(/ 1 0)
(catch ArithmeticException e
(println "Caught an exception: " (.getMessage e))))

;; Macros
(defmacro unless [pred a b]
`(if (not ~pred) ~a ~b))

(unless true
(println "This will not print")
(println "This will print"))

;; Keywords
:foo
:bar/baz


```
- ```css
.example {
something: "#abc123"
}
```
- [[shui/colors]]
- We want to switch to radix variables
- We want to make it easy to customize with themes
- We want to support as much old themes as possible
- var(--ui-button-color,
collapsed:: true
- var(--logseq-button-primary-color,
collapsed:: true
- var(--lx-color-6)))
- light and dark variants
- [[shui/inline]]
-
- /
-
-
2 changes: 2 additions & 0 deletions deps/shui/shui-graph/pages/shui___components___button.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-
-
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- support hidden properties
1 change: 1 addition & 0 deletions deps/shui/shui-graph/pages/shui___components___toggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-
53 changes: 53 additions & 0 deletions deps/shui/src/logseq/shui/button/v2.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
(ns logseq.shui.button.v2
(:require
[clojure.string :as str]
[rum.core :as rum]
[logseq.shui.icon.v2 :as icon]
[clojure.string :as string]))

(rum/defcs root < rum/reactive
(rum/local nil ::hover-theme)
[state {:keys [theme hover-theme color text depth size icon interactive shortcut tiled on-click muted disabled? class href button-props icon-props]
:or {theme :color depth 1 size :md interactive true muted false class ""}} context]
(let [*hover-theme (::hover-theme state)
color-string (or (some-> color name) (some-> context :state rum/react :ui/radix-color name) "custom")
theme (or @*hover-theme theme)
theme-class (str "ui__button-theme-" (if (keyword? theme) (name theme) "color"))
depth-class (when-not (= :text theme) (str "ui__button-depth-" depth))
color-class (str "ui__button-color-" color-string)
muted-class (when muted "ui__button-muted")
size-class (str "ui__button-size-" (name size))
tiled-class (when tiled "ui__button-tiled")
on-click (fn [e]
(when href (set! (.-href js/window.location) href))
(when on-click (on-click e)))]
[:button.ui__button
(merge
button-props
(cond->
{:class (str theme-class " " depth-class " " color-class " " size-class " " tiled-class " " muted-class " " class)
:disabled (boolean disabled?)
:on-mouse-over #(when hover-theme (reset! *hover-theme hover-theme))
:on-mouse-out #(reset! *hover-theme nil)}
on-click
(assoc :on-click on-click)))
(if-not tiled text
(for [[index tile] (map-indexed vector (rest (string/split text #"")))]
[:<>
(when (< 0 index)
[:div.ui__button__tile-separator])
[:div.ui__button__tile tile]]))

(when icon
(icon/root icon icon-props))
(when (not-empty shortcut)
(for [key shortcut]
[:div.ui__button-shortcut-key
(case key
"cmd" [:div "⌘"]
"shift" [:div "⇧"]
"return" [:div "↵"]
"esc" [:div.tracking-tightest {:style {:transform "scaleX(0.8) scaleY(1.2) "
:font-size "0.5rem"
:font-weight "500"}} "ESC"]
(cond-> key (string? key) .toUpperCase))]))]))