Skip to content

Implement rename for processed notes with timestamp-locked slug editing - #2

Draft
liebertraum with Copilot wants to merge 6 commits into
mainfrom
copilot/rename-processed-notes
Draft

Implement rename for processed notes with timestamp-locked slug editing#2
liebertraum with Copilot wants to merge 6 commits into
mainfrom
copilot/rename-processed-notes

Conversation

Copilot AI commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Adds inline rename capability for processed notes. Timestamp prefix remains immutable; only the slug portion is editable. Filenames follow YYYY-MM-DD_HH-MM_slug.md format with backward compatibility for YYYY_MM_DD_HH_MM_slug.md.

Backend

  • API: POST /v2/api/registry/{note_id}/rename accepts new_slug, validates format, handles conflicts
  • Filename format: Updated to YYYY-MM-DD_HH-MM (e.g., 2026-02-16_14-30_meeting-summary.md)
  • Slug sanitization: Strips invalid filesystem chars (/ \ : ? * < > |), normalizes spaces to hyphens, lowercases
  • Dual format parsing: Regex matches both new and legacy formats during rename
  • Transaction safety: Context managers for DB, OSError-specific exception handling, filesystem rollback on registry update failure
# Locked prefix parsing
match = re.match(r'^(\d{4}-\d{2}-\d{2}_\d{2}-\d{2})_(.+)$', old_filename)
timestamp_prefix = match.group(1)  # Locked: 2026-02-16_14-30
editable_slug = match.group(2)     # Editable: meeting-summary

Frontend

  • UI: ✏️ icon on completed notes (Inbox + Projects), modal with locked timestamp display + editable slug input
  • UX: Enter confirms, Escape cancels, toast notifications, no page reload
  • Validation: Client-side sanitizeSlug() helper mirrors backend logic
  • Alpine.js component: initRename() with dual format parsing, error states, API integration
// Visual separation in modal
<span x-text="timestampPrefix + '_'"></span>  // Muted, non-editable
<input x-model="editingSlug">                  // Focused, editable
<span>.md</span>                               // Muted

Notes

  • CodeQL clean (0 alerts)
  • Registry note_path updates; no reprocessing or timestamp modification
  • Conflict detection returns HTTP 409 with existing filename
  • Only available for success=1 notes
Original prompt

Do this.

🔁 PROCESSED NOTE RENAME — COMPLETE FRONTEND SPEC

(Timestamp Prefix Locked)

1️⃣ Scope

Renaming applies only to:
• Processed notes (.md files)
• Files stored inside Obsidian vault
• Notes that already exist on disk

Renaming does NOT apply to:
• Raw audio files
• Pending / failed ingest rows

2️⃣ Filename Structure (Non-Negotiable)

All processed notes follow this structure:

YYYY-MM-DD_HH-MM_slug.md

Example:

2026-02-16_08-25_meeting-summary.md

Structure breakdown:

[ LOCKED TIMESTAMP ][ _ ][ EDITABLE TITLE ].md

Locked portion:

2026-02-16_08-25_

Editable portion:

meeting-summary

Extension:

.md

3️⃣ Where Rename Is Available

A. Ingest Table (Processed Rows Only)

Conditions:
• Status = Done
• Note file exists

Action icon:

✏️ Rename

Disabled state:
• If processing
• If failed
• If note missing

B. Project View (When Viewing Notes Inside a Project)

Each note row:

2026-02-16_08-25_meeting-summary Last Modified [ ✏️ ]

Rename available via:
• ✏️ icon
• OR double-click editable portion

4️⃣ Rename Interaction Flow

Step 1 — Trigger

User clicks:
• ✏️ icon
OR
• Double-clicks editable part

Step 2 — Inline Rename Mode

Filename transforms into:

2026-02-16_08-25_[ meeting-summary ]

Behavior rules:
• Timestamp prefix is visually locked
• Prefix is NOT editable
• Cursor placed only in slug area
• Entire slug auto-selected on entry

Step 3 — Editing Rules

User can modify:

meeting-summary

User CANNOT modify:

2026-02-16_08-25_

Extension .md never shown in input.

Step 4 — Confirming Rename

Actions:
• Enter → Confirm rename
• Escape → Cancel
• Click outside → Confirm

No confirmation modal required.

5️⃣ Validation Rules

Sanitize slug automatically:

Remove invalid characters:
• /

• :
• ?
• *
• <
• >
• |
• Leading/trailing spaces

Replace spaces with:

Example:

Input:

Meeting: Q1 Review?

Becomes:

meeting-q1-review

Show subtle tooltip if characters removed:

“Invalid characters removed.”

6️⃣ Conflict Handling

If new filename already exists in same directory:

Show modal:

A note with this name already exists.

[ Cancel ] [ Overwrite ] [ Auto-Rename ]

Auto-Rename behavior:

meeting-summary (1).md

Never silently overwrite.

7️⃣ Under-the-Hood Behavior (UX Expectations)

When rename confirmed:
1. File is renamed on disk.
2. Registry note_path updated.
3. No reprocessing triggered.
4. No timestamps modified.
5. No frontmatter timestamps altered.

Optional enhancement:
• Update first H1 to match new slug.
(Not required for MVP.)

8️⃣ Visual Feedback

After rename:
• Row highlights briefly (150–300ms fade)
• Toast notification:

Renamed successfully.

No page refresh.
No scroll jump.
No re-render of entire list.

9️⃣ External Rename Handling (Critical)

If user renames file manually in Obsidian or Finder:

On next refresh:
• System must detect path mismatch.
• Update registry accordingly.
• OR mark entry as “Moved externally”.

Never assume filename is immutable.

Filesystem is truth.

🔟 Error Handling

If rename fails due to:
• File locked
• Permission error
• Missing file

Show toast:

Rename failed. File may have been moved or locked.

Do NOT silently fail.

11️⃣ What Rename Must NOT Do

Renaming must NOT:
• Change capture timestamp
• Change ingest timestamp
• Change project assignment
• Trigger reprocessing
• Modify YAML timestamps
• Move file between folders

Rename is strictly:

slug modification only

12️⃣ Visual Design Rules

Locked timestamp:
• Slightly muted color
• Non-editable
• Cursor cannot enter
• Visually segmented from slug

Example UI:

2026-02-16_08-25_ [ meeting-summary ]

Clear separation between system portion and user portion.

13️⃣ Determinism Guarantee

After rename:

Filename always preserves:

YYYY-MM-DD_HH-MM_

Therefore:
• Lexicographic sort remains chronological
• Obsidian filename sorting remains reliable
• Capture context never lost

This is why locking timestamp is correct.

14️⃣ UX Success Criteria

Rename should feel:
• Instant
• Controlled
• Safe
• Predictable

User should never wonder:
• “Did I break sorting?”
• “Did I change the capture time?”
• “Will backlinks break?”

Obsidian auto-updates backlinks.
System remains stable.

Final State

Renaming is:
• Inline
• Locked-prefix
• Slug-only editable
• Conflict-safe
• Filesystem-respecting
• Deterministic

No abstraction layers.
No weird metadata.

Just renaming a file correctly.

Created from VS Code.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits February 16, 2026 10:28
Co-authored-by: satyama2027-debug <240024655+satyama2027-debug@users.noreply.github.com>
Co-authored-by: satyama2027-debug <240024655+satyama2027-debug@users.noreply.github.com>
… compatibility

Co-authored-by: satyama2027-debug <240024655+satyama2027-debug@users.noreply.github.com>
…ct CSS and sanitization

Co-authored-by: satyama2027-debug <240024655+satyama2027-debug@users.noreply.github.com>
…rove fallback parsing

Co-authored-by: satyama2027-debug <240024655+satyama2027-debug@users.noreply.github.com>
Copilot AI changed the title [WIP] Update naming structure for processed notes in frontend Implement rename for processed notes with timestamp-locked slug editing Feb 16, 2026
Copilot AI requested a review from liebertraum February 16, 2026 10:38
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.

2 participants