mirror of
https://github.com/RWejlgaard/org.git
synced 2026-05-06 04:34:45 +00:00
adding guides for indentation
This commit is contained in:
parent
2cd2c68cc4
commit
343a806bf4
1 changed files with 32 additions and 6 deletions
|
|
@ -148,7 +148,13 @@ func (m uiModel) View() string {
|
||||||
for i, item := range items {
|
for i, item := range items {
|
||||||
lineCount := 1 // The item itself
|
lineCount := 1 // The item itself
|
||||||
if !item.Folded && len(item.Notes) > 0 && m.mode == modeList {
|
if !item.Folded && len(item.Notes) > 0 && m.mode == modeList {
|
||||||
indent := strings.Repeat(" ", item.Level)
|
// Build subtle visual guides for notes
|
||||||
|
guideStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("240"))
|
||||||
|
var notePrefix strings.Builder
|
||||||
|
for j := 1; j <= item.Level; j++ {
|
||||||
|
notePrefix.WriteString(guideStyle.Render("· "))
|
||||||
|
}
|
||||||
|
indent := notePrefix.String()
|
||||||
noteIndent := indent + " "
|
noteIndent := indent + " "
|
||||||
filteredNotes := filterLogbookDrawer(item.Notes)
|
filteredNotes := filterLogbookDrawer(item.Notes)
|
||||||
wrappedNotes := wrapNoteLines(filteredNotes, m.width, noteIndent)
|
wrappedNotes := wrapNoteLines(filteredNotes, m.width, noteIndent)
|
||||||
|
|
@ -209,7 +215,13 @@ func (m uiModel) View() string {
|
||||||
|
|
||||||
// Render remaining notes
|
// Render remaining notes
|
||||||
if !item.Folded && len(item.Notes) > 0 && m.mode == modeList {
|
if !item.Folded && len(item.Notes) > 0 && m.mode == modeList {
|
||||||
indent := strings.Repeat(" ", item.Level)
|
// Build subtle visual guides for notes
|
||||||
|
guideStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("245"))
|
||||||
|
var notePrefix strings.Builder
|
||||||
|
for i := 1; i <= item.Level; i++ {
|
||||||
|
notePrefix.WriteString(guideStyle.Render("· "))
|
||||||
|
}
|
||||||
|
indent := notePrefix.String()
|
||||||
noteIndent := indent + " "
|
noteIndent := indent + " "
|
||||||
filteredNotes := filterLogbookDrawer(item.Notes)
|
filteredNotes := filterLogbookDrawer(item.Notes)
|
||||||
wrappedNotes := wrapNoteLines(filteredNotes, m.width, noteIndent)
|
wrappedNotes := wrapNoteLines(filteredNotes, m.width, noteIndent)
|
||||||
|
|
@ -233,7 +245,13 @@ func (m uiModel) View() string {
|
||||||
|
|
||||||
// Show notes if not folded
|
// Show notes if not folded
|
||||||
if !item.Folded && len(item.Notes) > 0 && m.mode == modeList {
|
if !item.Folded && len(item.Notes) > 0 && m.mode == modeList {
|
||||||
indent := strings.Repeat(" ", item.Level)
|
// Build subtle visual guides for notes
|
||||||
|
guideStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("235"))
|
||||||
|
var notePrefix strings.Builder
|
||||||
|
for i := 1; i <= item.Level; i++ {
|
||||||
|
notePrefix.WriteString(guideStyle.Render("· "))
|
||||||
|
}
|
||||||
|
indent := notePrefix.String()
|
||||||
noteIndent := indent + " "
|
noteIndent := indent + " "
|
||||||
filteredNotes := filterLogbookDrawer(item.Notes)
|
filteredNotes := filterLogbookDrawer(item.Notes)
|
||||||
wrappedNotes := wrapNoteLines(filteredNotes, m.width, noteIndent)
|
wrappedNotes := wrapNoteLines(filteredNotes, m.width, noteIndent)
|
||||||
|
|
@ -875,9 +893,17 @@ func wrapText(text string, width int, indent string) []string {
|
||||||
func (m uiModel) renderItem(item *model.Item, isCursor bool) string {
|
func (m uiModel) renderItem(item *model.Item, isCursor bool) string {
|
||||||
var b strings.Builder
|
var b strings.Builder
|
||||||
|
|
||||||
// Indentation for level
|
// Indentation with subtle visual nesting guides
|
||||||
indent := strings.Repeat(" ", item.Level-1)
|
guideStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("245")) // Very subtle gray
|
||||||
b.WriteString(indent)
|
for i := 1; i < item.Level; i++ {
|
||||||
|
if i == item.Level-1 {
|
||||||
|
// Last level before the item - use subtle dot connector
|
||||||
|
b.WriteString(guideStyle.Render("· "))
|
||||||
|
} else {
|
||||||
|
// Parent levels - use subtle dot
|
||||||
|
b.WriteString(guideStyle.Render("· "))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Fold indicator
|
// Fold indicator
|
||||||
if len(item.Children) > 0 || len(item.Notes) > 0 {
|
if len(item.Children) > 0 || len(item.Notes) > 0 {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue