Skip to content

Enhancement: Sync nav titles to Notion and improve rebuild_state matching #80

Description

@virtualguard101

Summary

Two related gaps affect long-term sync reliability:

  1. Nav title changes do not update Notion page titles on sync (content/tags update only).
  2. rebuild_state_from_wiki matches pages by title under parent, which breaks when titles collide or change.

Problems

  • User renames a nav entry (e.g. section or page title); Notion still shows the old title.
  • rebuild_state_from_wiki may bind the wrong page when duplicate titles exist under the same parent.
  • Title drift makes manual recovery and debugging harder.

Proposed solution

Title sync on update/create

  • When syncing a leaf or section, if nav title ≠ current Notion title property, PATCH the title property.
  • Optional flag: --sync-titles (default on when cheap).

Rebuild matching improvements

  • Prefer stable keys when available: prior state id, stored URL, or optional frontmatter notion_page_id.
  • Fall back to title+parent matching with warnings on ambiguity.
  • Log ambiguous match when multiple Notion pages share title under same parent.

Optional write-back

  • After create/sync, optionally write notion_url to frontmatter or a sidecar field (config-gated).

Acceptance criteria

  • Changing nav title updates Notion page title on next sync.
  • Rebuild warns on ambiguous title matches instead of silent wrong bind.
  • Docs describe matching priority order.

Related

  • Structure reconciliation (section pages need title sync too)
  • Git rename state migration (stable id mapping)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions