Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jiratime",
"private": true,
"version": "1.5.0",
"version": "1.6.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down Expand Up @@ -39,4 +39,4 @@
"typescript-eslint": "^8.46.4",
"vite": "^7.2.4"
}
}
}
27 changes: 26 additions & 1 deletion src/background/index.ts
Original file line number Diff line number Diff line change
@@ -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);
});
});
2 changes: 1 addition & 1 deletion src/components/SortableTicketItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const SortableTicketItem = (props: SortableTicketItemProps) => {
};

return (
<div ref={setNodeRef} style={style} {...attributes} {...listeners}>
<div ref={setNodeRef} style={style} {...attributes} {...listeners} id={`ticket-${props.ticket.id}`}>
<TicketItem {...props} />
</div>
);
Expand Down
2 changes: 2 additions & 0 deletions src/components/TicketItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
Expand All @@ -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}
Expand Down