diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..45c080c --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,34 @@ +--- +name: Bug Report / Feature Request +about: Report a bug or request a new feature +title: '[Bug/Feature]: ' +labels: ['needs triage'] +assignees: '' +--- + +### ๐Ÿ” Actual Behaviour + +What is currently happening? + +### โœ… Expected Behaviour + +What should ideally happen? + +### ๐Ÿ“ธ Screenshots + +If applicable, add screenshots to help explain the issue. + +### ๐Ÿงช Steps to Reproduce (for bugs) + +1. Go to '...' +2. Click on '...' +3. Scroll down to '...' +4. See the error + +### ๐Ÿ’ก Possible Solution + +(Optional) Suggest a fix or reason for the bug. + +### ๐Ÿ™‹โ€โ™‚๏ธ Would You Like to Work on It? + +Yes / No diff --git a/.github/workflows/publish-chrome.yml b/.github/workflows/publish-chrome.yml new file mode 100644 index 0000000..66f67ce --- /dev/null +++ b/.github/workflows/publish-chrome.yml @@ -0,0 +1 @@ +C3ElB,KAAK,CAACW,OAAO,IAAI,OAAOX,KAAK,CAACW,OAAO,KAAK,QAAQ,IAAIX,KAAK,CAACW,OAAO,CAACM,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,mBAAmB,CAAE,EAAE;MACnHnB,OAAO,CAACoB,IAAI,CAAC,6EAA6E,CAAC;MAC3F,OAAO;QACHxB,OAAO,EAAE,KAAK;QACdyB,UAAU,EAAE,IAAI;QAChBnB,OAAO,EAAE;MACb,CAAC;IACL;IACA,MAAMD,KAAK;EACf;AACJ,CAAC;;AAED;AACA,OAAO,MAAMqB,YAAY,GAAG,MAAAA,CAAO;EAAEC,OAAO;EAAEC,OAAO;EAAEtB,OAAO;EAAEuB,SAAS;EAAEC,MAAM;EAAEC,eAAe;EAAEC,mBAAmB,GAAG;AAAK,CAAC,KAAK;EACjI,IAAI;IACA,MAAMC,OAAO,GAAG;MACZN,OAAO;MAAE;MACTC,OAAO;MAAE;MACTtB,OAAO;MACPuB,SAAS;MACTC,MAAM;MACNC,eAAe;MACfC;IACJ,CAAC;IACD;IACA,MAAMlC,MAAM,GAAG,MAAMP,oBAAoB,CAAC0C,OAAO,CAAC;IAClD,OAAOnC,MAAM,CAACC,IAAI;EACtB,CAAC,CAAC,OAAOM,KAAK,EAAE;IACZD,OAAO,CAACC,KAAK,CAAC,wBAAwB,EAAEA,KAAK,CAAC;IAC9C,MAAMA,KAAK;EACf;AACJ,CAAC;AAED,OAAO,MAAM6B,qBAAqB,GAAG,MAAAA,CAAOC,YAAY,EAAEd,UAAU,KAAK;EACrE,IAAI;IACA,MAAMvB,MAAM,GAAG,MAAMN,yBAAyB,CAAC;MAAE2C,YAAY;MAAEd;IAAW,CAAC,CAAC;IAC5E,OAAOvB,MAAM,CAACC,IAAI;EACtB,CAAC,CAAC,OAAOM,KAAK,EAAE;IACZD,OAAO,CAACC,KAAK,CAAC,kCAAkC,EAAEA,KAAK, \ No newline at end of file diff --git a/Screenshot 2025-05-30 205822.png b/Screenshot 2025-05-30 205822.png new file mode 100644 index 0000000..c106241 Binary files /dev/null and b/Screenshot 2025-05-30 205822.png differ diff --git a/docs/images/old_icon.png b/docs/images/old_icon.png new file mode 100644 index 0000000..eb452a8 Binary files /dev/null and b/docs/images/old_icon.png differ diff --git a/docs/images/standalone2.png b/docs/images/standalone2.png new file mode 100644 index 0000000..8c20715 Binary files /dev/null and b/docs/images/standalone2.png differ diff --git a/image.png b/image.png new file mode 100644 index 0000000..e7b6632 Binary files /dev/null and b/image.png differ diff --git a/src/icons/image copy.png b/src/icons/image copy.png new file mode 100644 index 0000000..4827b54 Binary files /dev/null and b/src/icons/image copy.png differ diff --git a/src/icons/image.png b/src/icons/image.png new file mode 100644 index 0000000..80626df --- /dev/null +++ b/src/icons/image.png @@ -0,0 +1,349 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateWrapper = (obj, member, setter, getter) => ({ + set _(value) { + __privateSet(obj, member, value, setter); + }, + get _() { + return __privateGet(obj, member, getter); + } +}); + +// src/queryClient.ts +var queryClient_exports = {}; +__export(queryClient_exports, { + QueryClient: () => QueryClient +}); +module.exports = __toCommonJS(queryClient_exports); +var import_utils = require("./utils.cjs"); +var import_queryCache = require("./queryCache.cjs"); +var import_mutationCache = require("./mutationCache.cjs"); +var import_focusManager = require("./focusManager.cjs"); +var import_onlineManager = require("./onlineManager.cjs"); +var import_notifyManager = require("./notifyManager.cjs"); +var import_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs"); +var _queryCache, _mutationCache, _defaultOptions, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline; +var QueryClient = class { + constructor(config = {}) { + __privateAdd(this, _queryCache); + __privateAdd(this, _mutationCache); + __privateAdd(this, _defaultOptions); + __privateAdd(this, _queryDefaults); + __privateAdd(this, _mutationDefaults); + __privateAdd(this, _mountCount); + __privateAdd(this, _unsubscribeFocus); + __privateAdd(this, _unsubscribeOnline); + __privateSet(this, _queryCache, config.queryCache || new import_queryCache.QueryCache()); + __privateSet(this, _mutationCache, config.mutationCache || new import_mutationCache.MutationCache()); + __privateSet(this, _defaultOptions, config.defaultOptions || {}); + __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); + __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); + __privateSet(this, _mountCount, 0); + } + mount() { + __privateWrapper(this, _mountCount)._++; + if (__privateGet(this, _mountCount) !== 1) return; + __privateSet(this, _unsubscribeFocus, import_focusManager.focusManager.subscribe(async (focused) => { + if (focused) { + await this.resumePausedMutations(); + __privateGet(this, _queryCache).onFocus(); + } + })); + __privateSet(this, _unsubscribeOnline, import_onlineManager.onlineManager.subscribe(async (online) => { + if (online) { + await this.resumePausedMutations(); + __privateGet(this, _queryCache).onOnline(); + } + })); + } + unmount() { + var _a, _b; + __privateWrapper(this, _mountCount)._--; + if (__privateGet(this, _mountCount) !== 0) return; + (_a = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a.call(this); + __privateSet(this, _unsubscribeFocus, void 0); + (_b = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b.call(this); + __privateSet(this, _unsubscribeOnline, void 0); + } + isFetching(filters) { + return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; + } + isMutating(filters) { + return __privateGet(this, _mutationCache).findAll({ ...filters, status: "pending" }).length; + } + /** + * Imperative (non-reactive) way to retrieve data for a QueryKey. + * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. + * + * Hint: Do not use this function inside a component, because it won't receive updates. + * Use `useQuery` to create a `QueryObserver` that subscribes to changes. + */ + getQueryData(queryKey) { + var _a; + const options = this.defaultQueryOptions({ queryKey }); + return (_a = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a.state.data; + } + ensureQueryData(options) { + const defaultedOptions = this.defaultQueryOptions(options); + const query = __privateGet(this, _queryCache).build(this, defaultedOptions); + const cachedData = query.state.data; + if (cachedData === void 0) { + return this.fetchQuery(options); + } + if (options.revalidateIfStale && query.isStaleByTime((0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query))) { + void this.prefetchQuery(defaultedOptions); + } + return Promise.resolve(cachedData); + } + getQueriesData(filters) { + return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { + const data = state.data; + return [queryKey, data]; + }); + } + setQueryData(queryKey, updater, options) { + const defaultedOptions = this.defaultQueryOptions({ queryKey }); + const query = __privateGet(this, _queryCache).get( + defaultedOptions.queryHash + ); + const prevData = query == null ? void 0 : query.state.data; + const data = (0, import_utils.functionalUpdate)(updater, prevData); + if (data === void 0) { + return void 0; + } + return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); + } + setQueriesData(filters, updater, options) { + return import_notifyManager.notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ + queryKey, + this.setQueryData(queryKey, updater, options) + ]) + ); + } + getQueryState(queryKey) { + var _a; + const options = this.defaultQueryOptions({ queryKey }); + return (_a = __privateGet(this, _queryCache).get( + options.queryHash + )) == null ? void 0 : _a.state; + } + removeQueries(filters) { + const queryCache = __privateGet(this, _queryCache); + import_notifyManager.notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + queryCache.remove(query); + }); + }); + } + resetQueries(filters, options) { + const queryCache = __privateGet(this, _queryCache); + return import_notifyManager.notifyManager.batch(() => { + queryCache.findAll(filters).forEach((query) => { + query.reset(); + }); + return this.refetchQueries( + { + type: "active", + ...filters + }, + options + ); + }); + } + cancelQueries(filters, cancelOptions = {}) { + const defaultedCancelOptions = { revert: true, ...cancelOptions }; + const promises = import_notifyManager.notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) + ); + return Promise.all(promises).then(import_utils.noop).catch(import_utils.noop); + } + invalidateQueries(filters, options = {}) { + return import_notifyManager.notifyManager.batch(() => { + __privateGet(this, _queryCache).findAll(filters).forEach((query) => { + query.invalidate(); + }); + if ((filters == null ? void 0 : filters.refetchType) === "none") { + return Promise.resolve(); + } + return this.refetchQueries( + { + ...filters, + type: (filters == null ? void 0 : filters.refetchType) ?? (filters == null ? void 0 : filters.type) ?? "active" + }, + options + ); + }); + } + refetchQueries(filters, options = {}) { + const fetchOptions = { + ...options, + cancelRefetch: options.cancelRefetch ?? true + }; + const promises = import_notifyManager.notifyManager.batch( + () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled()).map((query) => { + let promise = query.fetch(void 0, fetchOptions); + if (!fetchOptions.throwOnError) { + promise = promise.catch(import_utils.noop); + } + return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; + }) + ); + return Promise.all(promises).then(import_utils.noop); + } + fetchQuery(options) { + const defaultedOptions = this.defaultQueryOptions(options); + if (defaultedOptions.retry === void 0) { + defaultedOptions.retry = false; + } + const query = __privateGet(this, _queryCache).build(this, defaultedOptions); + return query.isStaleByTime( + (0, import_utils.resolveStaleTime)(defaultedOptions.staleTime, query) + ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); + } + prefetchQuery(options) { + return this.fetchQuery(options).then(import_utils.noop).catch(import_utils.noop); + } + fetchInfiniteQuery(options) { + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); + return this.fetchQuery(options); + } + prefetchInfiniteQuery(options) { + return this.fetchInfiniteQuery(options).then(import_utils.noop).catch(import_utils.noop); + } + ensureInfiniteQueryData(options) { + options.behavior = (0, import_infiniteQueryBehavior.infiniteQueryBehavior)(options.pages); + return this.ensureQueryData(options); + } + resumePausedMutations() { + if (import_onlineManager.onlineManager.isOnline()) { + return __privateGet(this, _mutationCache).resumePausedMutations(); + } + return Promise.resolve(); + } + getQueryCache() { + return __privateGet(this, _queryCache); + } + getMutationCache() { + return __privateGet(this, _mutationCache); + } + getDefaultOptions() { + return __privateGet(this, _defaultOptions); + } + setDefaultOptions(options) { + __privateSet(this, _defaultOptions, options); + } + setQueryDefaults(queryKey, options) { + __privateGet(this, _queryDefaults).set((0, import_utils.hashKey)(queryKey), { + queryKey, + defaultOptions: options + }); + } + getQueryDefaults(queryKey) { + const defaults = [...__privateGet(this, _queryDefaults).values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if ((0, import_utils.partialMatchKey)(queryKey, queryDefault.queryKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + setMutationDefaults(mutationKey, options) { + __privateGet(this, _mutationDefaults).set((0, import_utils.hashKey)(mutationKey), { + mutationKey, + defaultOptions: options + }); + } + getMutationDefaults(mutationKey) { + const defaults = [...__privateGet(this, _mutationDefaults).values()]; + const result = {}; + defaults.forEach((queryDefault) => { + if ((0, import_utils.partialMatchKey)(mutationKey, queryDefault.mutationKey)) { + Object.assign(result, queryDefault.defaultOptions); + } + }); + return result; + } + defaultQueryOptions(options) { + if (options._defaulted) { + return options; + } + const defaultedOptions = { + ...__privateGet(this, _defaultOptions).queries, + ...this.getQueryDefaults(options.queryKey), + ...options, + _defaulted: true + }; + if (!defaultedOptions.queryHash) { + defaultedOptions.queryHash = (0, import_utils.hashQueryKeyByOptions)( + defaultedOptions.queryKey, + defaultedOptions + ); + } + if (defaultedOptions.refetchOnReconnect === void 0) { + defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; + } + if (defaultedOptions.throwOnError === void 0) { + defaultedOptions.throwOnError = !!defaultedOptions.suspense; + } + if (!defaultedOptions.networkMode && defaultedOptions.persister) { + defaultedOptions.networkMode = "offlineFirst"; + } + if (defaultedOptions.queryFn === import_utils.skipToken) { + defaultedOptions.enabled = false; + } + return defaultedOptions; + } + defaultMutationOptions(options) { + if (options == null ? void 0 : options._defaulted) { + return options; + } + return { + ...__privateGet(this, _defaultOptions).mutations, + ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), + ...options, + _defaulted: true + }; + } + clear() { + __privateGet(this, _queryCache).clear(); + __privateGet(this, _mutationCache).clear(); + } +}; +_queryCache = new WeakMap(); +_mutationCache = new WeakMap(); +_defaultOptions = new WeakMap(); +_queryDefaults = new WeakMap(); +_mutationDefaults = new WeakMap(); +_mountCount = new WeakMap(); +_unsubscribeFocus = new WeakMap(); +_unsubscribeOnline = new WeakMap(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + QueryClient +}); +//# sourceMappingURL=queryClient.cjs.map \ No newline at end of file diff --git a/src/scripts/scrumHelper.js b/src/scripts/scrumHelper.js index 2572cba..0ea2af5 100644 --- a/src/scripts/scrumHelper.js +++ b/src/scripts/scrumHelper.js @@ -1417,15 +1417,20 @@ ${userReason}`; startDateFilter = new Date(lastWeek.toISOString().split('T')[0] + 'T00:00:00Z'); endDateFilter = new Date(today.toISOString().split('T')[0] + 'T23:59:59Z'); } + + const today = new Date(); + today.setHours(0,0,0,0); + const itemCreatedDate = new Date(item.created_at); + itemCreatedDate.setHours(0,0,0,0); + const isCreatedToday = today.getTime() === itemCreatedDate.getTime(); - const isNewPR = prCreatedDate >= startDateFilter && prCreatedDate <= endDateFilter; + const isNewPR = prCreatedDate >= startDateFilter && prCreatedDate << endDateFilter; const prUpdatedDate = new Date(item.updated_at); const isUpdatedInRange = prUpdatedDate >= startDateFilter && prUpdatedDate <= endDateFilter; // Check if PR has commits in the date range const hasCommitsInRange = item._allCommits && item._allCommits.length > 0; - log(`[PR DEBUG] PR #${number} - isNewPR: ${isNewPR}, isUpdatedInRange: ${isUpdatedInRange}, state: ${item.state}, hasCommitsInRange: ${hasCommitsInRange}, created: ${item.created_at}, updated: ${item.updated_at}`); if (platform === 'github') { // For existing PRs (not new), they must be open AND have commits in the date range @@ -1439,10 +1444,21 @@ ${userReason}`; continue; } } - prAction = isNewPR ? 'Made PR' : 'Existing PR'; + prAction = isNewPR ? 'Made PR' : 'Updated PR'; log(`[PR DEBUG] Including PR #${number} as ${prAction}`); + + if (isCreatedToday && item.State === 'open') { + prAction = 'Made PR'; + } else { + prAction = 'Updated PR'; + } } else if (platform === 'gitlab') { - prAction = isNewPR ? 'Made Merge Request' : 'Existing Merge Request'; + prAction = isNewPR ? 'Made Merge Request' : 'Updated Merge Request'; + if (isCreatedToday && item.State === 'open') { + prAction = 'Made Merge Request'; + } else { + prAction = 'Updated Merge Request'; + } } if (isDraft) { @@ -1507,25 +1523,31 @@ ${userReason}`; nextWeekArray.push(li2); } + const today = new Date(); + today.setHours(0,0,0,0); + const itemCreatedDate = new Date(item.created_at); + itemCreatedDate.setHours(0,0,0,0); + const isCreatedToday = today.getTime() === itemCreatedDate.getTime(); + const issueActionText = isCreatedToday ? 'Opened Issue' : 'Updated Issue' if (item.state === 'open') { - li = `
  • (${project}) - Opened Issue(#${number}) - ${title}${showOpenLabel ? ' ' + issue_opened_button : ''}
  • `; + li = `
  • (${project}) - ${issueActionText}(#${number}) - ${title}${showOpenLabel ? ' ' + issue_opened_button : ''}
  • `; } else if (item.state === 'closed') { // Use state_reason to distinguish closure reason if (item.state_reason === 'completed') { - li = `
  • (${project}) - Opened Issue(#${number}) - ${title} ${issue_closed_completed_button}
  • `; + li = `
  • (${project}) - ${issueActionText}(#${number}) - ${title} ${issue_closed_completed_button}
  • `; } else if (item.state_reason === 'not_planned') { - li = `
  • (${project}) - Opened Issue(#${number}) - ${title} ${issue_closed_notplanned_button}
  • `; + li = `
  • (${project}) - ${issueActionText}(#${number}) - ${title} ${issue_closed_notplanned_button}
  • `; } else { - li = `
  • (${project}) - Opened Issue(#${number}) - ${title} ${issue_closed_button}
  • `; + li = `
  • (${project}) - ${issueActionText}(#${number}) - ${title} ${issue_closed_button}
  • `; } } else { // Fallback for unexpected state - li = `
  • (${project}) - Opened Issue(#${number}) - ${title}
  • `; + li = `
  • (${project}) - ${issueActionText}(#${number}) - ${title}
  • `; } log('[SCRUM-DEBUG] Added issue to lastWeekArray:', li, item);