Add local tag server check, archive on delete, and first-run pin reminder

- Local tag is now clickable - checks if document exists on server by ID
  or filename, and re-links if found
- Delete from server now archives the proxy instead of removing it,
  making it a local-only document that can be re-uploaded
- Added first-run pin reminder banner to help users pin the extension
- Added issue report modal with context sections (extension info, browser
  info, document status, recent errors) and copy to clipboard as Markdown
- Added clearServerFields and attachServerDocument functions to pdf-queue
- Improved local tag styling with hover states and visual feedback

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-16 23:39:06 +01:00
parent e5f3f583d1
commit 1df93bd385
6 changed files with 1007 additions and 10 deletions

View File

@@ -337,6 +337,67 @@ export async function archiveProxy(id: string): Promise<void> {
console.log('[Proxy Queue] Archived proxy:', id);
}
/**
* Clear server-side fields from a proxy (when deleted from server)
* This makes the proxy "local only" again
*/
export async function clearServerFields(id: string): Promise<void> {
const state = await loadQueue();
const entry = state.entries.find(e => e.id === id);
if (!entry) {
console.warn('[Proxy Queue] Proxy not found for clearing server fields:', id);
return;
}
// Clear all server-related fields
entry.binectDocumentId = undefined;
entry.binectStatusCode = undefined;
entry.binectStatusText = undefined;
entry.binectStatus = 'pending'; // Reset to pending since it's no longer on server
entry.price = undefined;
entry.recipientAddress = undefined;
entry.errorMessage = undefined;
entry.uploadedAt = undefined;
entry.orderedAt = undefined;
await saveQueue(state);
console.log('[Proxy Queue] Cleared server fields for proxy:', id);
}
/**
* Attach server document to a proxy
* Used when re-linking a local proxy to a server document
*/
export async function attachServerDocument(
id: string,
binectDocumentId: number,
binectStatusCode: number,
binectStatusText: string,
price?: number,
recipientAddress?: string,
errorMessage?: string
): Promise<void> {
const state = await loadQueue();
const entry = state.entries.find(e => e.id === id);
if (!entry) {
console.warn('[Proxy Queue] Proxy not found for attaching server document:', id);
return;
}
entry.binectDocumentId = binectDocumentId;
entry.binectStatusCode = binectStatusCode;
entry.binectStatusText = binectStatusText;
entry.binectStatus = mapBinectStatusCode(binectStatusCode);
if (price !== undefined) entry.price = price;
if (recipientAddress) entry.recipientAddress = recipientAddress;
if (errorMessage) entry.errorMessage = errorMessage;
await saveQueue(state);
console.log('[Proxy Queue] Attached server document', binectDocumentId, 'to proxy:', id);
}
/**
* Restore a proxy document (move from archive to live)
*/