Skip to content

Enhance Editor File API Docs with pinned state features#65

Open
UnschooledGamer wants to merge 5 commits intoAcode-Foundation:mainfrom
UnschooledGamer:patch-1
Open

Enhance Editor File API Docs with pinned state features#65
UnschooledGamer wants to merge 5 commits intoAcode-Foundation:mainfrom
UnschooledGamer:patch-1

Conversation

@UnschooledGamer
Copy link
Copy Markdown
Member

@UnschooledGamer UnschooledGamer commented Mar 31, 2026

Added pinned state functionality and updated the remove method options.

Added pinned state functionality and updated remove method options.
@UnschooledGamer UnschooledGamer changed the title Enhance Editor File API with pinned state features Enhance Editor File API Docs with pinned state features Mar 31, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 31, 2026

Greptile Summary

This PR documents the new pinned-tab feature for the Editor File API. It adds pinned as both a read-only and writable property, extends the remove() method signature with ignorePinned and silentPinned options, and introduces two new methods — setPinnedState() and togglePinned(). The source-code permalink is also bumped to a newer commit.

Key findings:

  • Typo (P1): editorMangereditorManager in the setPinnedState description (line 143). Developers copying this event listener name verbatim will silently miss all pin-tab events.
  • Inconsistent examples (P2): The two new remove() code examples switch from the file variable used everywhere else in the page to editorFile, and both are missing await even though the first example in the same block uses await.
  • Broken anchors (P2): The #setPinnedState and #togglePinned anchor hrefs use camelCase, while all existing anchors in the file are lowercased. VitePress and GitHub-Flavored Markdown generate all-lowercase anchors, so these links likely won't navigate correctly.
  • Missing code example (P2): togglePinned() has no usage snippet, breaking the convention established by every other method on this page.

Confidence Score: 3/5

The typo 'editorManger' will cause plugin developers to silently miss events; should be fixed before publishing.

One P1 issue (the 'editorManger' typo will cause real broken behavior in any plugin that copies the event listener example verbatim) and three P2 style/convention issues keep the score below 5. Functional scope is documentation only, but documentation correctness is the entire purpose of this PR.

docs/editor-components/editor-file.md — typo in event name, broken anchors, and inconsistent/incomplete code examples all need attention.

Important Files Changed

Filename Overview
docs/editor-components/editor-file.md Documents new pinned-tab feature: adds pinned read-only and writable properties, updates remove() signature with ignorePinned/silentPinned options, and adds setPinnedState() and togglePinned() methods. Contains a typo ("editorManger"), inconsistent variable names and missing await in examples, camelCase anchors that won't resolve in VitePress/GFM, and togglePinned() is missing a code example.

Sequence Diagram

sequenceDiagram
    participant Plugin
    participant EditorFile
    participant EditorManager

    Plugin->>EditorFile: file.setPinnedState(true, { reorder: true, emit: true })
    EditorFile->>EditorFile: Update internal pinned state
    EditorFile->>EditorFile: Reorder tabs (if reorder=true)
    EditorFile->>EditorManager: emit("update", "pin-tab", file)
    EditorManager-->>Plugin: on("update", (action, file) => ...)

    Plugin->>EditorFile: file.togglePinned()
    EditorFile->>EditorFile: Invert pinned state
    EditorFile->>EditorManager: emit("update", "pin-tab", file)

    Plugin->>EditorFile: file.remove(false, { ignorePinned: true })
    EditorFile->>EditorFile: Bypass pinned check, close tab
    EditorFile->>EditorManager: emit close event

    Plugin->>EditorFile: file.remove(false, { silentPinned: true })
    EditorFile->>EditorFile: Suppress toast, close tab
    EditorFile->>EditorManager: emit close event
Loading

Reviews (1): Last reviewed commit: "Enhance Editor File API with pinned stat..." | Re-trigger Greptile

UnschooledGamer and others added 4 commits March 31, 2026 14:07
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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