diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 359876b..6bbac73 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -9,7 +9,8 @@ "Bash(go build:*)", "Bash(/home/mathieu/git/project-notes/notes/test-delete-1.md)", "Bash(/home/mathieu/git/project-notes/notes/test-delete-2.md)", - "Bash(/home/mathieu/git/project-notes/notes/test-delete-folder/test.md)" + "Bash(/home/mathieu/git/project-notes/notes/test-delete-folder/test.md)", + "Bash(npm install)" ], "deny": [], "ask": [] diff --git a/frontend/src/main.js b/frontend/src/main.js index b730964..ec02424 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -4,3 +4,9 @@ import './ui.js'; import './search.js'; import './daily-notes.js'; import './link-inserter.js'; +import './theme-manager.js'; +import './font-manager.js'; +import './vim-mode-manager.js'; +import './favorites.js'; +import './sidebar-sections.js'; +import './keyboard-shortcuts.js'; diff --git a/internal/api/daily_notes.go b/internal/api/daily_notes.go index ddb1da3..296e2ec 100644 --- a/internal/api/daily_notes.go +++ b/internal/api/daily_notes.go @@ -279,9 +279,9 @@ func (h *Handler) buildCalendarData(year int, month time.Month) *CalendarData { // Calculer mois précédent et suivant prevMonth := firstDay.AddDate(0, -1, 0) nextMonth := firstDay.AddDate(0, 1, 0) - data.PrevMonth = fmt.Sprintf("%d-%02d", prevMonth.Year(), prevMonth.Month()) - data.NextMonth = fmt.Sprintf("%d-%02d", nextMonth.Year(), nextMonth.Month()) - data.CurrentMonth = fmt.Sprintf("%d-%02d", year, month) + data.PrevMonth = fmt.Sprintf("%d/%02d", prevMonth.Year(), prevMonth.Month()) + data.NextMonth = fmt.Sprintf("%d/%02d", nextMonth.Year(), nextMonth.Month()) + data.CurrentMonth = fmt.Sprintf("%d/%02d", year, month) // Construire les semaines // Lundi = 0, Dimanche = 6 diff --git a/internal/api/handler.go b/internal/api/handler.go index 53ce082..eda71d8 100644 --- a/internal/api/handler.go +++ b/internal/api/handler.go @@ -335,6 +335,9 @@ func (h *Handler) generateHomeMarkdown() string { // Section des favoris (après les tags) h.generateFavoritesSection(&sb) + // Section des notes récemment modifiées (après les favoris) + h.generateRecentNotesSection(&sb) + // Titre de l'arborescence avec le nombre de notes sb.WriteString(fmt.Sprintf("## 📂 Toutes les notes (%d)\n\n", noteCount)) @@ -407,6 +410,56 @@ func (h *Handler) generateFavoritesSection(sb *strings.Builder) { sb.WriteString("\n\n") } +// generateRecentNotesSection génère la section des notes récemment modifiées +func (h *Handler) generateRecentNotesSection(sb *strings.Builder) { + recentDocs := h.idx.GetRecentDocuments(5) + + if len(recentDocs) == 0 { + return + } + + sb.WriteString("## 🕒 Récemment modifiés\n\n") + sb.WriteString("
\n") + + for _, doc := range recentDocs { + // Extraire les premières lignes du corps (max 150 caractères) + preview := doc.Summary + if len(preview) > 150 { + preview = preview[:150] + "..." + } + + // Parser la date de modification pour un affichage plus lisible + dateStr := doc.LastModified + if dateStr == "" { + dateStr = doc.Date + } + + sb.WriteString("
\n") + sb.WriteString(fmt.Sprintf(" \n", doc.Path)) + sb.WriteString(fmt.Sprintf("
%s
\n", doc.Title)) + sb.WriteString(fmt.Sprintf("
\n")) + sb.WriteString(fmt.Sprintf(" 📅 %s\n", dateStr)) + if len(doc.Tags) > 0 { + sb.WriteString(fmt.Sprintf(" ")) + for i, tag := range doc.Tags { + if i > 0 { + sb.WriteString(" ") + } + sb.WriteString(fmt.Sprintf("#%s", tag)) + } + sb.WriteString("\n") + } + sb.WriteString("
\n") + if preview != "" { + sb.WriteString(fmt.Sprintf("
%s
\n", preview)) + } + sb.WriteString("
\n") + sb.WriteString("
\n") + } + + sb.WriteString("
\n\n") +} + // generateFavoriteFolderContent génère le contenu d'un dossier favori func (h *Handler) generateFavoriteFolderContent(sb *strings.Builder, folderPath string, depth int) { // Construire le chemin absolu diff --git a/internal/indexer/indexer.go b/internal/indexer/indexer.go index 168df21..4d65d5e 100644 --- a/internal/indexer/indexer.go +++ b/internal/indexer/indexer.go @@ -710,6 +710,30 @@ func (i *Indexer) GetBacklinks(path string) []string { return result } +// GetRecentDocuments retourne les N documents les plus récemment modifiés +func (i *Indexer) GetRecentDocuments(limit int) []*Document { + i.mu.RLock() + defer i.mu.RUnlock() + + // Copier tous les documents dans un slice + docs := make([]*Document, 0, len(i.docs)) + for _, doc := range i.docs { + docs = append(docs, doc) + } + + // Trier par date de dernière modification (décroissant) + sort.Slice(docs, func(i, j int) bool { + return docs[i].LastModified > docs[j].LastModified + }) + + // Limiter le nombre de résultats + if limit > 0 && len(docs) > limit { + docs = docs[:limit] + } + + return docs +} + // extractInternalLinks extrait tous les liens internes d'un texte Markdown/HTML // Format: func extractInternalLinks(body string) []string { diff --git a/notes/.favorites.json b/notes/.favorites.json index 9e54c9b..db273a3 100644 --- a/notes/.favorites.json +++ b/notes/.favorites.json @@ -1,74 +1,67 @@ { "items": [ - { - "path": "documentation/authentication.md", - "is_dir": false, - "title": "authentication", - "added_at": "2025-11-11T13:55:41.091354066+01:00", - "order": 0 - }, { "path": "research/ai", "is_dir": true, "title": "ai", "added_at": "2025-11-11T13:55:49.371541279+01:00", - "order": 1 + "order": 0 }, { "path": "research/design/ui-inspiration.md", "is_dir": false, "title": "ui-inspiration", "added_at": "2025-11-11T14:20:49.985321698+01:00", - "order": 2 + "order": 1 }, { "path": "research/tech/websockets.md", "is_dir": false, "title": "websockets", "added_at": "2025-11-11T14:20:55.347335695+01:00", - "order": 3 + "order": 2 }, { "path": "tasks/backlog.md", "is_dir": false, "title": "backlog", "added_at": "2025-11-11T14:20:57.762787363+01:00", - "order": 4 + "order": 3 }, { "path": "ideas/client-feedback.md", "is_dir": false, "title": "client-feedback", "added_at": "2025-11-11T14:22:16.497953232+01:00", - "order": 5 + "order": 4 }, { "path": "ideas/collaboration.md", "is_dir": false, "title": "collaboration", "added_at": "2025-11-11T14:22:18.012032002+01:00", - "order": 6 + "order": 5 }, { "path": "ideas/mobile-app.md", "is_dir": false, "title": "mobile-app", "added_at": "2025-11-11T14:22:19.048311608+01:00", - "order": 7 + "order": 6 }, { "path": "meetings/2025", "is_dir": true, "title": "2025", "added_at": "2025-11-11T14:22:21.531283601+01:00", - "order": 8 + "order": 7 }, { "path": "meetings/outscale.md", "is_dir": false, "title": "outscale", "added_at": "2025-11-11T14:22:22.519332518+01:00", - "order": 9 + "order": 8 } ] } \ No newline at end of file diff --git a/notes/daily/2025/11/11.md b/notes/daily/2025/11/11.md index a6aee79..7a3ba3b 100644 --- a/notes/daily/2025/11/11.md +++ b/notes/daily/2025/11/11.md @@ -1,9 +1,8 @@ --- -title: Daily Note - 2025-11-11 -date: 11-11-2025 -last_modified: 11-11-2025:13:58 -tags: - - daily +title: "Daily Note - 2025-11-11" +date: "11-11-2025" +last_modified: "11-11-2025:00:00" +tags: [daily] --- # 📅 Mardi 11 novembre 2025 @@ -11,8 +10,6 @@ tags: ## 🎯 Objectifs du jour - -Blouloublou - ## 📝 Notes - diff --git a/notes/daily/2025/11/12.md b/notes/daily/2025/11/12.md index 9a086a9..bc8e52b 100644 --- a/notes/daily/2025/11/12.md +++ b/notes/daily/2025/11/12.md @@ -1,7 +1,7 @@ --- title: Daily Note - 2025-11-12 date: 12-11-2025 -last_modified: 12-11-2025:10:37 +last_modified: 12-11-2025:17:30 tags: - daily --- @@ -11,12 +11,10 @@ tags: ## 🎯 Objectifs du jour - +Blablabla + ## 📝 Notes -- C'est la note du jour - - Elle est cool - -/i +- ## ✅ Accompli - diff --git a/notes/research/ai/auto-tagging.md b/notes/research/design/ai/auto-tagging.md similarity index 100% rename from notes/research/ai/auto-tagging.md rename to notes/research/design/ai/auto-tagging.md diff --git a/notes/research/ai/semantic-search.md b/notes/research/design/ai/semantic-search.md similarity index 100% rename from notes/research/ai/semantic-search.md rename to notes/research/design/ai/semantic-search.md diff --git a/static/theme.css b/static/theme.css index c790d7e..6d75243 100644 --- a/static/theme.css +++ b/static/theme.css @@ -3388,3 +3388,97 @@ body, html { max-height: calc(100vh - 200px); } } + +/* ======================================== + Recent Notes Section + ======================================== */ +.recent-notes-container { + display: flex; + flex-direction: column; + gap: var(--spacing-md); + max-height: 500px; + overflow-y: auto; + padding: var(--spacing-sm); + margin-bottom: var(--spacing-lg); + scrollbar-width: thin; + scrollbar-color: var(--border-primary) transparent; +} + +.recent-notes-container::-webkit-scrollbar { + width: 6px; +} + +.recent-notes-container::-webkit-scrollbar-track { + background: transparent; +} + +.recent-notes-container::-webkit-scrollbar-thumb { + background: var(--border-primary); + border-radius: 3px; +} + +.recent-notes-container::-webkit-scrollbar-thumb:hover { + background: var(--border-secondary); +} + +.recent-note-card { + background: var(--bg-secondary); + border: 1px solid var(--border-primary); + border-radius: var(--radius-md); + padding: var(--spacing-md); + transition: all var(--transition-fast); + box-shadow: var(--shadow-sm); +} + +.recent-note-card:hover { + border-color: var(--accent-primary); + box-shadow: var(--shadow-md), var(--shadow-glow); + transform: translateY(-2px); +} + +.recent-note-link { + text-decoration: none; + color: inherit; + display: block; +} + +.recent-note-title { + font-size: 1.1rem; + font-weight: 600; + color: var(--text-primary); + margin-bottom: var(--spacing-sm); + line-height: 1.4; +} + +.recent-note-meta { + display: flex; + flex-wrap: wrap; + gap: var(--spacing-md); + align-items: center; + margin-bottom: var(--spacing-sm); + font-size: 0.85rem; +} + +.recent-note-date { + color: var(--text-secondary); + display: flex; + align-items: center; + gap: 0.25rem; +} + +.recent-note-tags { + color: var(--accent-primary); + font-size: 0.8rem; + font-weight: 500; +} + +.recent-note-preview { + color: var(--text-muted); + font-size: 0.9rem; + line-height: 1.5; + margin-top: var(--spacing-sm); + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; +} diff --git a/templates/daily-calendar.html b/templates/daily-calendar.html index 6c89d2c..abe1359 100644 --- a/templates/daily-calendar.html +++ b/templates/daily-calendar.html @@ -46,12 +46,23 @@ {{end}} - +
+ + +
diff --git a/templates/index.html b/templates/index.html index d9bdd73..4a819a5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -17,12 +17,6 @@ - - - - - - @@ -41,7 +35,6 @@ hx-get="/api/search" hx-trigger="keyup changed delay:500ms, search" hx-target="#search-results" - hx-indicator="#search-spinner" style="flex-grow: 1; max-width: 350px;" /> - -
- -