feat(workspace): sliding sidebar in focus mode, calmer workspace bar, smoother journal
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m47s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m47s
- focus mode: folders slide in from the left (button, title click, or the left edge on wide screens); picking a note keeps focus mode - workspace bar: borderless live/shared/save pills in one style, divider before the note actions; footer without top line - journal panel and calendar open with an animation, the view fades in - paste and markdown import nest a list under the paragraph introducing it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
226c863a2a
commit
b136e5dfad
9 files changed
+183
-60
No files matched your search
@@ -744,14 +744,22 @@ func MarkdownToBlocks(md string) []domain.DocumentBlock {
|
||||
var headings []int // ranks (1–3) of the open headings: H2 below H1 nests one level deeper
|
||||
var indents []int // indent widths of the open list levels
|
||||
inList := false // the previous line belonged to a list item (for continuation lines)
|
||||
// A list right after a paragraph ("Folgende Punkte:") nests under that paragraph
|
||||
afterParagraph, listBase := false, 0
|
||||
listLevel := func(width int) int {
|
||||
if len(indents) == 0 {
|
||||
listBase = base
|
||||
if afterParagraph {
|
||||
listBase = base + 1
|
||||
}
|
||||
}
|
||||
for len(indents) > 0 && indents[len(indents)-1] > width {
|
||||
indents = indents[:len(indents)-1]
|
||||
}
|
||||
if len(indents) == 0 || indents[len(indents)-1] < width {
|
||||
indents = append(indents, width)
|
||||
}
|
||||
return base + len(indents) - 1
|
||||
return listBase + len(indents) - 1
|
||||
}
|
||||
|
||||
for i := 0; i < len(lines); i++ {
|
||||
@@ -781,7 +789,7 @@ func MarkdownToBlocks(md string) []domain.DocumentBlock {
|
||||
b := newBlock("code", strings.Join(code, "\n"), level)
|
||||
b.Lang = lang
|
||||
blocks = append(blocks, b)
|
||||
inList = false
|
||||
inList, afterParagraph = false, false
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -799,14 +807,14 @@ func MarkdownToBlocks(md string) []domain.DocumentBlock {
|
||||
}
|
||||
blocks = append(blocks, newBlock(typ, strings.TrimSpace(m[2]), len(headings)))
|
||||
headings = append(headings, rank)
|
||||
base, indents, inList = len(headings), nil, false
|
||||
base, indents, inList, afterParagraph = len(headings), nil, false, false
|
||||
continue
|
||||
}
|
||||
|
||||
if trimmed == "---" || trimmed == "***" || trimmed == "___" {
|
||||
if !strings.HasPrefix(line, " ") && !strings.HasPrefix(line, "\t") {
|
||||
blocks = append(blocks, newBlock("divider", "", 0))
|
||||
base, headings, indents, inList = 0, nil, nil, false
|
||||
base, headings, indents, inList, afterParagraph = 0, nil, nil, false, false
|
||||
continue
|
||||
}
|
||||
}
|
||||
@@ -825,7 +833,7 @@ func MarkdownToBlocks(md string) []domain.DocumentBlock {
|
||||
}
|
||||
i--
|
||||
blocks = append(blocks, newBlock("callout", strings.Join(parts, "\n"), base))
|
||||
indents, inList = nil, false
|
||||
indents, inList, afterParagraph = nil, false, false
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -875,7 +883,7 @@ func MarkdownToBlocks(md string) []domain.DocumentBlock {
|
||||
}
|
||||
i--
|
||||
blocks = append(blocks, newBlock("bullet", strings.Join(para, "\n"), base))
|
||||
indents, inList = nil, false
|
||||
indents, inList, afterParagraph = nil, false, true
|
||||
}
|
||||
return blocks
|
||||
}
|
||||
|
||||
@@ -235,3 +235,15 @@ func TestMarkdownHeadingsNestTheirSections(t *testing.T) {
|
||||
t.Fatalf("got %v\nwant %v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMarkdownListNestsUnderItsParagraph(t *testing.T) {
|
||||
blocks := MarkdownToBlocks("# Plan\nFolgende Punkte:\n\n- eins\n - tiefer\n- zwei\n\nDanach Text\n\n1. a")
|
||||
var got []string
|
||||
for _, b := range blocks {
|
||||
got = append(got, fmt.Sprintf("%d:%s:%s", b.Level, b.Type, b.Content))
|
||||
}
|
||||
want := []string{"0:h1:Plan", "1:bullet:Folgende Punkte:", "2:bullet:eins", "3:bullet:tiefer", "2:bullet:zwei", "1:bullet:Danach Text", "2:numbered:a"}
|
||||
if strings.Join(got, "|") != strings.Join(want, "|") {
|
||||
t.Fatalf("got %v\nwant %v", got, want)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user