()
| 4125 | } |
| 4126 | |
| 4127 | async function syncGithubNotes() { |
| 4128 | try { |
| 4129 | const data = await api("/api/github/sync", { |
| 4130 | method: "POST", |
| 4131 | body: JSON.stringify({ user_id: currentUser(), response_language: responseLanguage() }) |
| 4132 | }); |
| 4133 | await loadSettings(); |
| 4134 | await loadWiki(); |
| 4135 | const llm = data.llm_review || {}; |
| 4136 | const summary = githubSyncSummary(data); |
| 4137 | const labels = ui().wiki.githubSync; |
| 4138 | const detail = [ |
| 4139 | `${labels.repoDir}: ${data.repo_dir || "-"}`, |
| 4140 | `${labels.remote}: ${data.remote || "-"}`, |
| 4141 | `${labels.branch}: ${data.branch || "main"}`, |
| 4142 | data.pull_warning ? `${labels.warning}: ${data.pull_warning}` : "", |
| 4143 | llm.summary ? `${labels.llmReview}: ${llm.summary}` : "" |
| 4144 | ].filter(Boolean).join("\n"); |
| 4145 | $("wikiStats").textContent = `${summary} · GitHub`; |
| 4146 | setWikiEntry(labels.resultTitle, detail, "", { renderRelations: false }); |
| 4147 | showFeedbackToast("success", labels.successTitle, summary); |
| 4148 | } catch (error) { |
| 4149 | const message = error.message || String(error); |
| 4150 | $("wikiStats").textContent = ui().wiki.githubSync.failureTitle; |
| 4151 | showFeedbackToast("error", ui().wiki.githubSync.failureTitle, message); |
| 4152 | error.paperflowToastShown = true; |
| 4153 | throw error; |
| 4154 | } |
| 4155 | } |
| 4156 | |
| 4157 | async function searchWiki() { |
| 4158 | const rawQuery = $("wikiQuery").value.trim(); |
nothing calls this directly
no test coverage detected