Today view and Inbox section: dynamic query, not stored sections

- ListTodayView() on backend: queries nodes created or updated today
  using local timezone day boundaries
- todayBoundaries() helper returns start/end of current day in RFC3339
- Section validation: Create() rejects today and inbox as node sections
- validSections moved from repository.go to types.go with IsValidSection
  and IsServiceSection helpers
- Frontend selectSection('today') calls ListTodayView instead of
  ListNodesBySection('today')
- FAB (create node) hidden in today and inbox sections
- CreateNode in app.go guarded against today/inbox sections
- types.go: today/inbox defined as service sections (sidebar only)
This commit is contained in:
2026-06-01 01:39:02 +08:00
parent a4ae22c445
commit 69891e395c
8 changed files with 107 additions and 11 deletions
+6 -2
View File
@@ -135,7 +135,11 @@
showCreateNode = false
error = ''
try {
nodes = await wailsCall('ListNodesBySection', id) || []
if (id === 'today') {
nodes = await wailsCall('ListTodayView') || []
} else {
nodes = await wailsCall('ListNodesBySection', id) || []
}
} catch (e) {
error = String(e)
nodes = []
@@ -1055,7 +1059,7 @@
</div>
{/if}
{#if !noteEditor && !selectedNode}
{#if !noteEditor && !selectedNode && selectedSection !== 'today' && selectedSection !== 'inbox'}
<div class="fab" on:click={openCreateNode} title="Добавить дело">+</div>
{/if}
+2
View File
@@ -3,6 +3,7 @@ import * as App from '../wailsjs/go/main/App.js'
// Re-export all methods
export const listSections = () => App.ListSections()
export const listTodayView = () => App.ListTodayView()
export const listNodesBySection = (section) => App.ListNodesBySection(section)
export const listChildren = (parentID) => App.ListChildren(parentID)
export const getNodeDetail = (id) => App.GetNodeDetail(id)
@@ -31,6 +32,7 @@ export const duplicateNode = (nodeID) => App.DuplicateNode(nodeID)
export const renameNode = (nodeID, newTitle) => App.RenameNode(nodeID, newTitle)
export const moveNode = (nodeID, newParentID) => App.MoveNode(nodeID, newParentID)
export const openFolder = (nodeID) => App.OpenFolder(nodeID)
export const validateName = (name) => App.ValidateName(name)
export const listActions = (nodeID) => App.ListActions(nodeID)
export const runAction = (id) => App.RunAction(id)
+4
View File
@@ -6,6 +6,10 @@ export function ListSections() {
return window['go']['main']['App']['ListSections']();
}
export function ListTodayView() {
return window['go']['main']['App']['ListTodayView']();
}
export function ListNodesBySection(arg1) {
return window['go']['main']['App']['ListNodesBySection'](arg1);
}