Skip to content

Releases: gibsonchan-5/fleur-annotation

1.1.8

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 21 Sep 08:29

Fix reading-mode annotations targeting the wrong occurrence and sidebar sorting

  • Sidebar now refreshes immediately when the annotation sort setting changes, and document-order sorting works for legacy annotations (line backfilled during migration).
  • Reading-mode highlight/underline/comment target the exact occurrence the user selected instead of the first match; sidebar line numbers stay consistent.
  • Selections crossing bold/strikethrough boundaries no longer produce unparseable ==...== nesting.

1.1.7

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 20 Sep 05:37

Fix: highlights, underlines and comment markers are no longer written into the YAML frontmatter. Clipped notes whose frontmatter description duplicates the lead paragraph caused the first-match search to wrap text inside the frontmatter, leaving the body text unhighlighted while the sidebar still recorded the annotation. Matching now skips the frontmatter region and targets the note body only.

FleurAnnotation 1.1.6

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 17 Sep 03:23

中文说明

修复:设置页「导出文件夹」下拉现在会列出空文件夹。

  • 问题:旧实现是「从已加载条目的路径反推祖先目录」——先 getAllLoadedFiles() 取全部条目,再按 / 切分、只取前缀部分作为文件夹名。这意味着一个文件夹只有在被某个条目路径引用时才会出现,因此任何还没有内容的空文件夹都永远进不了下拉;用户新建一个文件夹后,在放入文件之前根本无法在设置里选中它。
  • 修复:改为直接枚举 vault.getAllFolders()@since 1.6.6,低于本插件的 minAppVersion 1.8.0),空文件夹与非空文件夹一视同仁。原有的 FleurAnnotation 预置项与「Vault 根目录」选项保持不变。
  • 实测对照:在一个含 258 个文件夹(其中 27 个为空)的库中,旧实现只列出 231 项,漏掉的 27 个恰好等于全部空文件夹;新实现 258 项齐全。
  • 影响范围:仅改动设置页的文件夹枚举逻辑,不涉及导出、标注、高亮、AI 解释等任何运行时行为;已保存的 noteFolder 取值与 data.json 均不受影响。
  • 同步 package.json / package-lock.json / versions.json 至 1.1.6。

English

Fix: the "export folder" dropdown in the settings tab now lists empty folders.

  • Problem: the previous implementation derived folders from the paths of already-loaded entries — it called getAllLoadedFiles() and split each path on /, keeping only the ancestor prefixes as folder names. A folder could therefore appear only if its path was referenced by some entry, so an empty folder could never show up; a freshly created folder was unselectable until a file was placed inside it.
  • Fix: enumerate vault.getAllFolders() directly (@since 1.6.6, below this plugin's minAppVersion of 1.8.0), so empty and non-empty folders are treated alike. The pre-seeded FleurAnnotation entry and the "Vault root" option are unchanged.
  • Measured: in a vault with 258 folders (27 of them empty), the old implementation listed 231 — the 27 missing ones were exactly the empty set; the new one lists all 258.
  • Scope: the change is confined to folder enumeration in the settings tab. Export, annotation, highlight and AI behaviour are untouched, and the saved noteFolder value and data.json are unaffected.
  • Synced package.json / package-lock.json / versions.json to 1.1.6.

Assets

main.js · manifest.json · styles.css

FleurAnnotation 1.1.5

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 16 Sep 13:13

中文说明

维护版本:main.jsstyles.css 与 1.1.4 完全相同(逐字节一致),插件运行时行为无任何变化。 本版只修正仓库内的发布工具链,正常使用无需升级。

  • 修复 version-bump.mjs 的硬编码兜底:官方模板原本写 process.env.npm_package_min_app_version || '1.0.0',而 package.json 并不存在该字段,导致执行 npm version 时会把 versions.json 写成 "新版本": "1.0.0",把「最低 Obsidian 版本」记成 1.0.0。现改为以 manifest.minAppVersion 为准,取不到目标版本或最低版本时直接中止(退出码 1),不再静默写入错误值。
  • 写入格式保持一致:脚本重写 manifest.json / versions.json 时补回结尾换行,与仓库既有格式(2 空格缩进 + 尾随换行)一致,避免无意义 diff。
  • .gitignore 增加 data.json:Obsidian 会把插件设置(含明文 AI API Key)写入该文件,禁止其进入仓库。
  • 同步 package.json / package-lock.json 版本号至 1.1.5。

English

Maintenance release — main.js and styles.css are byte-identical to 1.1.4, so there is no change in plugin behaviour. This version only fixes the release tooling in the repository; no upgrade is required for normal use.

  • Hardened version-bump.mjs: the upstream template used process.env.npm_package_min_app_version || '1.0.0', but package.json has no such field, so running npm version would record "<new version>": "1.0.0" in versions.json — a wrong minimum Obsidian version. It now falls back to manifest.minAppVersion and aborts with a non-zero exit code when the target or minimum version cannot be determined, instead of silently writing a bad value.
  • Preserved file formatting: the script now keeps the trailing newline when rewriting manifest.json / versions.json, matching the repository's existing 2-space indented, newline-terminated format.
  • .gitignore now ignores data.json: Obsidian stores plugin settings there, including plaintext AI API keys.
  • Synced package.json / package-lock.json to 1.1.5.

Assets

main.js · manifest.json · styles.css

FleurAnnotation 1.1.4

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 16 Sep 13:02

1.1.4

新功能

  • 🪟 批注窗口可拖拽、宽度可调:按住「添加批注」标题栏即可拖动窗口(首次拖动脱离居中定位,位置限制在窗口范围内);右下角手柄可横向调整宽度(380px 起,最大至屏幕宽度 - 40px)。窗口高度固定,批注输入框自动填满剩余空间,内容多时在输入框内部滚动。
  • 🤖 AI 解释 / 翻译结果可直接写入批注:AI 回复的操作按钮新增「写入批注」,位于「复制」与「记入笔记」之间。回复内容按纯文本(剥离 Markdown)写入当前选中原文对应的批注:已有批注则更新,并同步替换文件中的 %% … %% 标记;没有对应批注则按现有「添加批注」逻辑新建 ==原文==%% 批注 %%

修复

  • ⌨️ 修复中文输入法组词时输入框底色灰白闪烁:根因在 Obsidian 核心 CSS——全局 textarea:hover 会切换背景底色,中文输入法首次进入组词状态时 Chromium 的 :hover 伪类短暂抖动,底色随之反复跳变。现在插件内所有输入框(批注弹窗、AI 面板、侧边栏批注编辑框、设置面板)在常态 / hover / active / focus 下均锁定背景与边框,且不再依赖主题的变量取值,换任何主题都不会再出现该闪烁。
  • 🎨 批注窗口输入框去掉边框过渡与聚焦光晕,输入观感更稳定。

说明

  • 桌面端与移动端通用,升级后无需任何额外配置;重载插件或重启 Obsidian 即可生效。

English

New

  • 🪟 Draggable and resizable comment modal: drag the modal by its title bar (it leaves the centered position on the first drag and stays inside the viewport), and adjust its width with the handle in the bottom-right corner (from 380px up to viewport width minus 40px). The height stays fixed and the textarea fills the remaining space, scrolling internally.
  • 🤖 Write AI replies straight into an annotation: every AI reply (explain and translate) now offers a "write to annotation" action between "copy" and "save to note". The reply is written as plain text into the annotation of the selected text — an existing annotation is updated and its %% … %% marker in the file is replaced, otherwise a new ==text==%% comment %% annotation is created through the regular add-annotation path.

Fixes

  • ⌨️ Fixed the grey/white background flicker while composing Chinese with an IME: the root cause is Obsidian's core CSS rule that swaps the textarea background on :hover; when an IME starts a composition, Chromium briefly toggles :hover, so the background kept jumping between two colours. All plugin inputs (comment modal, AI panel, sidebar comment editor, settings) now lock their background and border across base, hover, active and focus states, and no longer depend on how a theme defines these variables, so the flicker is gone on every theme.
  • 🎨 Removed the border transition and the focus glow from the comment textarea for steadier typing.

Notes

  • Works on desktop and mobile with no extra configuration; reload the plugin or restart Obsidian to update.

FleurAnnotation 1.1.3

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 12 Sep 12:23

1.1.3

新功能

  • 🔑 密钥保存位置可切换:设置面板新增「密钥保存位置」选项,可在 系统钥匙串(推荐)data.json(可随 vault 同步) 之间切换
  • 🔁 切换时密钥自动搬迁,任意时刻只保存一份:切到 data.json 会先落盘再清除钥匙串条目;切回钥匙串会写入并回读校验通过后才抹掉明文
  • ⚠️ 选择 data.json 模式时设置页显示明文警告:密钥将以明文保存并随 vault 同步上传云端

多设备使用说明

  • 🔒 钥匙串模式下,密钥不随 Obsidian Sync / iCloud 等同步工具走(密钥存于系统钥匙串与应用数据目录,均在 vault 之外)——换设备后需在设置中重新粘贴一次
  • 🔄 需要多设备共用密钥的用户,可在设置中切换为 data.json 模式,密钥将随 vault 同步(接受明文代价)
  • ℹ️ 密钥保护功能需要 Obsidian 1.11.4 或更高版本;更早版本的 Obsidian 将继续使用明文 data.json 存储,密钥不会丢失

升级说明

  • 从旧版本升级无需重新粘贴密钥:data.json 中的明文密钥会在插件加载时自动迁入系统钥匙串
  • 升级后请重载插件或重启 Obsidian

English

New

  • 🔑 Switchable secret storage: a new "Secret storage location" option in settings lets you choose between the system keychain (recommended) and data.json (syncs with the vault)
  • 🔁 The key migrates automatically on switch and only one copy exists at any time: switching to data.json writes the file first and then clears the keychain entry; switching back writes to the keychain, verifies by read-back, and only then blanks the plain-text field
  • ⚠️ data.json mode shows a warning in settings: the key is stored in plain text and will be uploaded to your sync cloud with the vault

Multi-device notes

  • 🔒 In keychain mode the key does not travel with Obsidian Sync / iCloud (it lives in the system keychain and the app data directory, outside the vault) — paste it once on each new device
  • 🔄 Users who need the key on multiple devices can switch to data.json mode so it syncs with the vault (accepting the plain-text tradeoff)
  • ℹ️ Keychain protection requires Obsidian 1.11.4 or later; older Obsidian versions keep using plain-text data.json storage and no key is lost

Upgrade notes

  • Upgrading from older versions requires no re-pasting of keys: plain-text keys in data.json migrate to the system keychain automatically on plugin load
  • Please reload the plugin or restart Obsidian after upgrading

v1.1.2 — Locate Annotations from Sidebar

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 08 Sep 08:28

What's New

Locate annotations from the sidebar (aligned with FleurPDF)

  • New pin button on each sidebar card ("Locate in source"), plus click-anywhere-on-card to jump
  • Scrolls the source view smoothly so the annotation sits in the center, then flashes it twice with an accent outline that does not cover the original highlight color or underline style
  • Three-step locating strategy:
    1. Exact match by data-fleur-annotation attribute (annotations with a comment bubble)
    2. Text match against rendered mark / .cm-highlight / u elements — works in both Reading mode and Live Preview
    3. Falls back to the recorded line number with setCursor + scrollIntoView in source mode
  • Shows a notice if the annotation cannot be found in the source file
  • Inline comment editor and "add comment" hint no longer bubble clicks to the card, so typing in the editor never triggers an accidental jump

v1.1.1 — Export Styling Alignment & Copy in Reading Mode

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 07 Sep 05:48

What's New

Export formatting aligned with FleurPDF

  • Highlights are now exported as inline HTML with their original background color: <span style="background-color:…;color:…;padding:0 2px;border-radius:2px">
  • Underlines keep their original color and line style: <span style="text-decoration:underline;text-decoration-color:…;text-decoration-style:…">
  • Text color is picked automatically for contrast against the highlight color, so light highlights stay readable
  • Line styles solid / dashed / dotted / wavy are exported as-is
  • Color falls back to the plugin default, then to #FFD43B (highlight) / #E8590C (underline)
  • Existing export structure (frontmatter tags, callout metadata, highlight / underline / comment groups, timestamps) is unchanged

Copy in Reading Mode context menu

  • Added a Copy item at the top of the reading-mode right-click menu (the custom menu replaces the native one, so the native Copy was previously unavailable)
  • Uses the Clipboard API with an execCommand fallback, and shows a confirmation notice
  • Fixed a stale-selection issue: the cached selection is now cleared when the selection is dismissed, so the menu always acts on the current selection

Notes

  • Both changes are visual / interaction only; no data migration is required.

v1.1.0 — AI Prompt Presets & Annotation Length Limit

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 06 Sep 05:00

What's New

AI Prompt Presets (7 built-in + 3 custom)

  • Default — general reading assistant (same as previous default system prompt)
  • Encyclopedia — explains concepts: what / origin / why it matters
  • English Reading — vocabulary, grammar & sentence analysis
  • Classical Chinese — glosses, syntax and cultural background for classical texts
  • Academic Literature — thesis, methodology, evidence & limitations
  • STEM Assistant — for math / physics / chemistry / biology: concepts → formulas → derivation → applicability
  • Humanities Assistant — philosophy / history / literature / social science: concepts → context → schools of thought
  • Custom 1 / 2 / 3 — three user-defined prompt slots (empty slots fall back to Default)

Sidebar Annotation Length Limit

  • New slider (100–600, default 250) controlling the max length of AI-generated annotations in the sidebar
  • Longer source texts automatically relax the limit (capped at 600)
  • Ask-AI conversations in the note body are NOT limited
  • Custom prompts that already specify a length are respected (no double constraint)

Settings UI

  • Prompt-mode dropdown with live preview and "edit as custom" action, aligned with FleurPDF
  • Legacy systemPrompt settings are automatically migrated to Custom 1

v1.0.9 — AI Prompt Presets & Annotation Length Limit

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 06 Sep 04:51

What's New

AI Prompt Presets (7 built-in + 3 custom)

  • Default — general reading assistant (same as previous default system prompt)
  • Encyclopedia — explains concepts: what / origin / why it matters
  • English Reading — vocabulary, grammar & sentence analysis
  • Classical Chinese — glosses, syntax and cultural background for classical texts
  • Academic Literature — thesis, methodology, evidence & limitations
  • STEM Assistant — for math / physics / chemistry / biology: concepts → formulas → derivation → applicability
  • Humanities Assistant — philosophy / history / literature / social science: concepts → context → schools of thought
  • Custom 1 / 2 / 3 — three user-defined prompt slots (empty slots fall back to Default)

Sidebar Annotation Length Limit

  • New slider (100–600, default 250) controlling the max length of AI-generated annotations in the sidebar
  • Longer source texts automatically relax the limit (capped at 600)
  • Ask-AI conversations in the note body are NOT limited
  • Custom prompts that already specify a length are respected (no double constraint)

Settings UI

  • Prompt-mode dropdown with live preview and "edit as custom" action, aligned with FleurPDF
  • Legacy systemPrompt settings are automatically migrated to Custom 1