From f8c7812e400b5e8203911146c6ebd2244ae25cbc Mon Sep 17 00:00:00 2001 From: hrshjswniii Date: Wed, 20 May 2026 22:39:35 +0530 Subject: [PATCH 1/9] fix: Add Local History for Generated Dev.to Posts in Extension Popup --- extension/background.js | 21 +++++++++++---------- extension/popup.html | 22 ++++++++++++++++++++++ extension/popup.js | 24 ++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 10 deletions(-) diff --git a/extension/background.js b/extension/background.js index 7abc0af..df163f9 100644 --- a/extension/background.js +++ b/extension/background.js @@ -44,17 +44,18 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { .filter(result => result.status === 'success') .map(result => result.platform) .join(', '); + const devtoResult = platforms.find(r => r.platform === 'devto' && r.status === 'success'); chrome.storage.local.get({ publishHistory: [] }, (res) => { - const entry = { - title: title, - date: client_time || new Date().toISOString(), - platforms: postedPlatforms ? postedPlatforms.split(', ').filter(p => p) : [], - status: data.status - }; - const history = res.publishHistory; - history.unshift(entry); - chrome.storage.local.set({ publishHistory: history.slice(0, 100) }); -}); + const entry = { + title: title, + url: devtoResult?.url || null, + publishedAt: client_time || new Date().toISOString(), + platforms: postedPlatforms ? postedPlatforms.split(', ').filter(p => p) : [] + }; + const history = res.publishHistory; + history.unshift(entry); + chrome.storage.local.set({ publishHistory: history.slice(0, 10) }); + }); const failedPlatforms = platforms .filter(result => result.status === 'error') .map(result => result.platform) diff --git a/extension/popup.html b/extension/popup.html index 916d709..e477463 100644 --- a/extension/popup.html +++ b/extension/popup.html @@ -134,6 +134,23 @@ margin-top: 10px; padding-top: 10px; } + .history-item { + display: block; + padding: 7px 8px; + margin-bottom: 5px; + border: 1px solid var(--border); + border-radius: 6px; + font-size: 12px; + color: var(--text); + text-decoration: none; + background: #fafafa; + transition: background 0.15s; + cursor: pointer; + } + .history-item:hover { background: #fff3d6; border-color: var(--primary); } + .history-item-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + .history-item-meta { font-size: 10px; color: var(--text-small); margin-top: 2px; } + .history-empty { font-size: 12px; color: var(--text-small); padding: 8px 0; text-align: center; } @@ -190,6 +207,11 @@

LeetLog AI

Ready to blog! 🚀
+ +
+ 📋 Recent Posts +
+