Skip to content

Feat: add sidebar position value - #306

Open
7eliassen wants to merge 2 commits into
mainfrom
feat/add-sidebar-configuration
Open

7eliassen wants to merge 2 commits into
mainfrom
feat/add-sidebar-configuration

Conversation

@7eliassen

@7eliassen 7eliassen commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Related with: codex-team/notes.web#367

Add sidebarPosition configuration for notes and expose the effective sidebar position in note hierarchies.

Changes

  • Added sidebar_position to note_settings table with supported values: "edge", "content" (default), "none".
  • Added sidebarPosition to GET /note-settings/:notePublicId.
  • Added support for updating it through PATCH /note-settings/:notePublicId.
  • Updated the note hierarchy query to read sidebar position from note settings.
  • /note/note-hierarchy/:notePublicId now returns sidebarPosition only on the hierarchy root.
  • A child’s stored position is preserved while it belongs to a hierarchy. After unlinking, its own stored position becomes effective.
  • Added tests:

Example response

{
  "noteHierarchy": {
    "noteId": "cJWmwl-VX2",
    "noteTitle": "Parent note",
    "sidebarPosition": "edge", # The position is set by the root note's parameter.
    "childNotes": [
      {
        "noteId": "Guqo0Fp585",
        "noteTitle": "Child note",
        "childNotes": null
      }
    ]
  }
}

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 85.74% (🎯 80%)
⬇️ -0.07%
9326 / 10876
🟢 Statements 85.74% (🎯 80%)
⬇️ -0.07%
9326 / 10876
🔴 Functions 79.55% (🎯 80%)
⬇️ -0.05%
284 / 357
🟢 Branches 85.04% (🎯 80%)
⬆️ +0.15%
472 / 555
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/domain/entities/NoteHierarchy.ts 0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
1-28
src/domain/entities/note.ts 0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
1-120
src/domain/entities/noteSettings.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/domain/service/note.ts 96.25%
⬆️ +0.04%
81.69%
⬆️ +0.27%
100%
🟰 ±0%
96.25%
⬆️ +0.04%
108-109, 141-142, 153-154, 187-188, 220-221, 322-323, 426-427, 443-444, 485-486, 536-537, 582-583
src/presentation/http/router/noteSettings.ts 98.95%
🟰 ±0%
85.71%
⬇️ -2.52%
100%
🟰 ±0%
98.95%
🟰 ±0%
209-210, 279-280
src/presentation/http/schema/NoteHierarchy.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/presentation/http/schema/NoteSettings.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/repository/storage/postgres/orm/sequelize/note.ts 97.31%
⬆️ +0.02%
76%
🟰 ±0%
100%
🟰 ±0%
97.31%
⬆️ +0.02%
191-192, 235-236, 239-240, 297-298, 344-345, 441-442
src/repository/storage/postgres/orm/sequelize/noteSettings.ts 92.79%
⬆️ +0.32%
90%
🟰 ±0%
87.5%
🟰 ±0%
92.79%
⬆️ +0.32%
131-145, 231-232
src/tests/utils/database-helpers.ts 98.4%
⬆️ +0.01%
95.83%
⬆️ +0.18%
92.3%
🟰 ±0%
98.4%
⬆️ +0.01%
218-223
Generated in workflow #933 for commit 6a6fa89 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant