diff --git a/manifest.json b/manifest.json index bcffeb7..06e2864 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "JiraTime", - "version": "1.5.0", + "version": "1.6.1", "description": "Simple Jira Time Tracking for Developers. By yours truly Bernhard Dorn.", "author": "Bernhard Dorn", "action": { diff --git a/package.json b/package.json index 39ab2d0..e343c60 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jiratime", "private": true, - "version": "1.5.0", + "version": "1.6.1", "type": "module", "scripts": { "dev": "vite", @@ -39,4 +39,4 @@ "typescript-eslint": "^8.46.4", "vite": "^7.2.4" } -} +} \ No newline at end of file diff --git a/src/background/index.ts b/src/background/index.ts index 381af5c..8eaf2f8 100644 --- a/src/background/index.ts +++ b/src/background/index.ts @@ -1,6 +1,31 @@ console.log('JiraTime background service worker started.'); -// Setup listeners for alarms/timers if needed later +const updateBadge = (activeTimer: any) => { + if (activeTimer) { + chrome.action.setBadgeText({ text: "ON" }); + chrome.action.setBadgeBackgroundColor({ color: "#22c55e" }); // green + } else { + chrome.action.setBadgeText({ text: "" }); + } +}; + +// Listen for changes in storage +chrome.storage.onChanged.addListener((changes, area) => { + if (area === 'local' && changes.activeTimer) { + updateBadge(changes.activeTimer.newValue); + } +}); + +// Initial check on startup/install chrome.runtime.onInstalled.addListener(() => { console.log('JiraTime installed.'); + chrome.storage.local.get("activeTimer", (result) => { + updateBadge(result.activeTimer); + }); +}); + +chrome.runtime.onStartup.addListener(() => { + chrome.storage.local.get("activeTimer", (result) => { + updateBadge(result.activeTimer); + }); }); diff --git a/src/components/SortableTicketItem.tsx b/src/components/SortableTicketItem.tsx index b9ebfe3..2a42050 100644 --- a/src/components/SortableTicketItem.tsx +++ b/src/components/SortableTicketItem.tsx @@ -34,7 +34,7 @@ export const SortableTicketItem = (props: SortableTicketItemProps) => { }; return ( -
+
); diff --git a/src/components/TicketItem.tsx b/src/components/TicketItem.tsx index 78f89ae..9b363da 100644 --- a/src/components/TicketItem.tsx +++ b/src/components/TicketItem.tsx @@ -365,6 +365,7 @@ export const TicketItem = ({ placeholder="e.g. 2h 30m" value={manualTime} onChange={(e) => setManualTime(e.target.value)} + onKeyDown={(e) => e.stopPropagation()} className="h-9" disabled={isSubmitting} /> @@ -384,6 +385,7 @@ export const TicketItem = ({ placeholder="Work description (optional)" value={description} onChange={(e) => setDescription(e.target.value)} + onKeyDown={(e) => e.stopPropagation()} className="flex w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-xs placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50 transition-all dark:bg-slate-900 dark:border-slate-700 dark:text-white dark:placeholder:text-gray-500 dark:focus:ring-blue-400 min-h-[36px] resize-y" rows={1} disabled={isSubmitting}