Skip to content

fixed report preview bug #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Preeti9764
Copy link
Contributor

@Preeti9764 Preeti9764 commented Jun 24, 2025

πŸ“Œ Fixes

Fixes #163


πŸ“ Summary of Changes

-The preview report will be generated when button get clicked after the organization name change.

πŸ“Έ Screenshots / Demo (if UI-related)

Screenshot 2025-06-24 090406


βœ… Checklist

  • I’ve tested my changes locally
  • I’ve added tests (if applicable)
  • I’ve updated documentation (if applicable)
  • My code follows the project’s code style guidelines

πŸ‘€ Reviewer Notes

Add any special notes for the reviewer here

Summary by Sourcery

Fix report preview bug by clearing cache and updating UI placeholder on organization change, adjusting debounce timing, and forcing preview content to refresh

Bug Fixes:

  • Fix report preview not updating correctly after organization change

Enhancements:

  • Clear githubCache and display placeholder message on organization change
  • Reduce organization input debounce delay from 3000ms to 2500ms
  • Reprocess and rewrite GitHub issues, PRs, and reviews when generating popup preview

Summary by Sourcery

Fix report preview not updating correctly after changing the organization by resetting cache and state, adjusting debounce timing, and forcing data refresh.

Bug Fixes:

  • Ensure preview report regenerates after organization name changes by clearing stale cache and resetting state.

Enhancements:

  • Introduce resetReportState and forceGithubDataRefresh functions to manage cache invalidation and report regeneration.
  • Include organization name in cache key and trigger preview refresh upon data fetch in popup mode.
  • Clear githubCache in storage and display placeholder message when the organization is changed.
  • Reduce organization input debounce delay from 3000ms to 2500ms.

Copy link
Contributor

sourcery-ai bot commented Jun 24, 2025

Reviewer's Guide

This PR fixes the report preview bug by centralizing cache and state reset logic in scrumHelper.js (via resetReportState and forceGithubDataRefresh), integrating orgName into cache keys to ensure fresh data is fetched after an organization change, and updating popup.js to clear cached data, show a placeholder prompt, and reduce the org‐input debounce delay.

Sequence diagram for organization change and report preview refresh

sequenceDiagram
    actor User
    participant PopupJS as popup.js
    participant Storage as chrome.storage.local
    participant ScrumHelper as scrumHelper.js
    User->>PopupJS: Input new organization name
    PopupJS->>Storage: Set orgName and clear githubCache
    PopupJS->>PopupJS: Show placeholder in report preview
    User->>PopupJS: Click "Generate Report"
    PopupJS->>ScrumHelper: generateScrumReport()
    ScrumHelper->>Storage: Fetch orgName and githubCache
    ScrumHelper->>ScrumHelper: resetReportState()
    ScrumHelper->>ScrumHelper: Fetch fresh GitHub data
    ScrumHelper->>PopupJS: Update report preview
Loading

Class diagram for updated cache and state management in scrumHelper.js

classDiagram
    class githubCache {
        +data
        +cacheKey
        +timestamp
        +ttl
        +fetching
        +queue
        +subject
    }
    class scrumHelper {
        +resetReportState(regenerateReport, outputTarget)
        +forceGithubDataRefresh()
        +fetchGithubData()
    }
    scrumHelper --> githubCache : uses
Loading

File-Level Changes

Change Details Files
Centralize report state reset and data refresh logic
  • Added resetReportState to clear flags, data arrays, and cache
  • Introduced forceGithubDataRefresh to remove stored cache and fetch new data
  • Replaced manual state resets in handleRefresh and writing functions with resetReportState calls
  • Wrapped popup fetch flow to trigger state reset/regeneration when needed
src/scripts/scrumHelper.js
Integrate organization into caching strategy
  • Incorporated orgName into cacheKey computation
  • Conditionally regenerated popup report after fetch by invoking resetReportState
src/scripts/scrumHelper.js
Refactor and relocate githubCache initialization
  • Moved and simplified global githubCache object to top of allIncluded scope
  • Removed duplicate cache declaration at the bottom
src/scripts/scrumHelper.js
Enhance popup UI on organization change and adjust debounce
  • Clear githubCache in chrome.storage.local when orgName is updated
  • Inject placeholder HTML prompting user to click β€œGenerate Report” after org change
  • Reduced org input debounce delay from 3000ms to 2500ms
src/scripts/popup.js

Assessment against linked issues

Issue Objective Addressed Explanation
#163 The scrum preview report should not be generated automatically when the organization name is changed. βœ…
#163 The scrum preview report should be generated after clicking the generate report button after the organization name is changed. βœ…

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Preeti9764 - I've reviewed your changes - here's some feedback:

  • Consider extracting the hardcoded 2500ms debounce into a named constant so the timing is easier to adjust and understand.
  • Move the inline HTML and style update for the β€œOrganisation changed” message into a dedicated render function or CSS class rather than injecting raw markup.
  • Refactor the manual reset of processed flags and subsequent calls in scrumHelper.js into a single reset method to reduce duplication and clarify the report regeneration flow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the hardcoded 2500ms debounce into a named constant so the timing is easier to adjust and understand.
- Move the inline HTML and style update for the β€œOrganisation changed” message into a dedicated render function or CSS class rather than injecting raw markup.
- Refactor the manual reset of processed flags and subsequent calls in scrumHelper.js into a single reset method to reduce duplication and clarify the report regeneration flow.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment and I'll use the feedback to improve your reviews.

@Preeti9764 Preeti9764 requested review from vedansh-5 and hpdang June 24, 2025 03:34
@vedansh-5
Copy link
Contributor

Hello @Preeti9764, I have reviewed your work and would like to make a suggestion for a better approach to this issue.
Currently when we set a new organization the old cached data is fetched. A thing to notice here is, this only happens when we do not change the date we are fetching for, as when we change the date, the cache is cleared and new fetch requests are made, this happens because the cacheKey is no longer valid.
A better and simpler approach for this would be to add organization name in the cacheKey instead of storing multiple data entries in cache, that way whenever we change organization name, new fetch request will be made. Also I was working on the codebase and noticed this line, here we are making an automatic request when user changes the organization, but its obvious user will generate the scrum report again when they change the organization so we don't really need this and can be safely removed.
For this issue please revert the changes you made in the caching mechanism and change the cacheKey, it will effectively solve the issue with minimal code changes, you can remove the mentioned line in this same PR, as it concerns the same.
Thanks!

@vedansh-5
Copy link
Contributor

Also I was working on the codebase and noticed this line, here we are making an automatic request when user changes the organization, but its obvious user will generate the scrum report again when they change the organization so we don't really need this and can be safely removed.

@hpdang Please share your views on this. Thanks.

@hpdang
Copy link
Member

hpdang commented Jun 24, 2025

What @vedansh-5 suggested sounds good to me

@Preeti9764 Preeti9764 marked this pull request as draft June 25, 2025 06:31
@Preeti9764
Copy link
Contributor Author

Hello @Preeti9764, I have reviewed your work and would like to make a suggestion for a better approach to this issue. Currently when we set a new organization the old cached data is fetched. A thing to notice here is, this only happens when we do not change the date we are fetching for, as when we change the date, the cache is cleared and new fetch requests are made, this happens because the cacheKey is no longer valid. A better and simpler approach for this would be to add organization name in the cacheKey instead of storing multiple data entries in cache, that way whenever we change organization name, new fetch request will be made. Also, I was working on the codebase and noticed this line

The line you are referring to is already removed in changes of this pr, I will add the org name in cache, thanks!

@Preeti9764 Preeti9764 marked this pull request as ready for review June 25, 2025 15:07
@Preeti9764
Copy link
Contributor Author

@hpdang i have made the required changes and the bug is corrected . Thanks!

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Preeti9764 - I've reviewed your changes - here's some feedback:

  • Move the resetReportState and forceGithubDataRefresh functions out of the allIncluded scope to avoid redeclaring them on every call and improve readability.
  • In popup.js you set githubCache to null in storage instead of removing itβ€”use chrome.storage.local.remove('githubCache') to fully clear the cache.
  • You have repeated state-reset logic scattered in multiple fetch/processing branchesβ€”consolidate into a single reset call to reduce duplication.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Move the `resetReportState` and `forceGithubDataRefresh` functions out of the `allIncluded` scope to avoid redeclaring them on every call and improve readability.
- In popup.js you set `githubCache` to null in storage instead of removing itβ€”use `chrome.storage.local.remove('githubCache')` to fully clear the cache.
- You have repeated state-reset logic scattered in multiple fetch/processing branchesβ€”consolidate into a single reset call to reduce duplication.

## Individual Comments

### Comment 1
<location> `src/scripts/popup.js:403` </location>
<code_context>
                 // Valid org: update storage and fetch data
-                chrome.storage.local.set({ orgName: org }, function () {
-                    if (window.generateScrumReport) window.generateScrumReport();
+                chrome.storage.local.set({ orgName: org, githubCache: null }, function () {
+                    const scrumReport = document.getElementById('scrumReport');
+                    if (scrumReport) {
</code_context>

<issue_to_address>
Setting githubCache to null in chrome.storage.local may not clear all cached data.

Use chrome.storage.local.remove('githubCache') to ensure the cache is fully cleared and prevent ambiguity in cache handling.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
                // Valid org: update storage and fetch data
                chrome.storage.local.set({ orgName: org, githubCache: null }, function () {
                    const scrumReport = document.getElementById('scrumReport');
                    if (scrumReport) {
                        scrumReport.innerHTML = '<p style="text-align: center; color: #666; padding: 20px;">Organisation changed. Click "Generate Report" to fetch new data.</p>';
                    }
                });
=======
                // Valid org: update storage and fetch data
                chrome.storage.local.remove('githubCache', function () {
                    chrome.storage.local.set({ orgName: org }, function () {
                        const scrumReport = document.getElementById('scrumReport');
                        if (scrumReport) {
                            scrumReport.innerHTML = '<p style="text-align: center; color: #666; padding: 20px;">Organisation changed. Click "Generate Report" to fetch new data.</p>';
                        }
                    });
                });
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment and I'll use the feedback to improve your reviews.

Comment on lines 402 to 408
// Valid org: update storage and fetch data
chrome.storage.local.set({ orgName: org }, function () {
if (window.generateScrumReport) window.generateScrumReport();
chrome.storage.local.set({ orgName: org, githubCache: null }, function () {
const scrumReport = document.getElementById('scrumReport');
if (scrumReport) {
scrumReport.innerHTML = '<p style="text-align: center; color: #666; padding: 20px;">Organisation changed. Click "Generate Report" to fetch new data.</p>';
}
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Setting githubCache to null in chrome.storage.local may not clear all cached data.

Use chrome.storage.local.remove('githubCache') to ensure the cache is fully cleared and prevent ambiguity in cache handling.

Suggested change
// Valid org: update storage and fetch data
chrome.storage.local.set({ orgName: org }, function () {
if (window.generateScrumReport) window.generateScrumReport();
chrome.storage.local.set({ orgName: org, githubCache: null }, function () {
const scrumReport = document.getElementById('scrumReport');
if (scrumReport) {
scrumReport.innerHTML = '<p style="text-align: center; color: #666; padding: 20px;">Organisation changed. Click "Generate Report" to fetch new data.</p>';
}
});
// Valid org: update storage and fetch data
chrome.storage.local.remove('githubCache', function () {
chrome.storage.local.set({ orgName: org }, function () {
const scrumReport = document.getElementById('scrumReport');
if (scrumReport) {
scrumReport.innerHTML = '<p style="text-align: center; color: #666; padding: 20px;">Organisation changed. Click "Generate Report" to fetch new data.</p>';
}
});
});

Comment on lines +97 to +116
async function forceGithubDataRefresh() {
log('Force refreshing GitHub data');

// Clear cache from storage
await new Promise(resolve => {
chrome.storage.local.remove('githubCache', resolve);
});

// Reset report state
resetReportState(false);

// Fetch fresh data
try {
await fetchGithubData();
return { success: true, message: 'Data refreshed successfully' };
} catch (error) {
logError('Force refresh failed:', error);
return { success: false, error: error.message };
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): Avoid function declarations, favouring function assignment expressions, inside blocks. (avoid-function-declarations-in-blocks)

ExplanationFunction declarations may be hoisted in Javascript, but the behaviour is inconsistent between browsers. Hoisting is generally confusing and should be avoided. Rather than using function declarations inside blocks, you should use function expressions, which create functions in-scope.

Comment on lines 913 to 916
function handleRefresh() {
hasInjectedContent = false; // Reset the flag before refresh
resetReportState(false, 'email');
allIncluded();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): Avoid function declarations, favouring function assignment expressions, inside blocks. (avoid-function-declarations-in-blocks)

ExplanationFunction declarations may be hoisted in Javascript, but the behaviour is inconsistent between browsers. Hoisting is generally confusing and should be avoided. Rather than using function declarations inside blocks, you should use function expressions, which create functions in-scope.

Copy link
Contributor

@vedansh-5 vedansh-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need of multiple entries to be stored in the extension. For our projects' scope single stored entries are more than enough and serves us efficiently.
Also its a major change in the caching mechanism, if you feel they are necessary we can open another ticket for that, please don't push several things in a single PR.
Thanks!

Comment on lines +6 to +17

// Global cache object
let githubCache = {
data: null,
cacheKey: null,
timestamp: null,
ttl: null,
fetching: false,
queue: [],
subject: null
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert these changes!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for pointing i will remove ttl, fetching, and queue as they are not currently used .

Comment on lines 53 to 117
/**
* Resets all report processing flags and state, then optionally regenerates the report
* @param {boolean} regenerateReport - Whether to regenerate the report after reset
* @param {string} outputTarget - The output target ('popup' or 'email')
*/
function resetReportState(regenerateReport = false, outputTarget = 'popup') {
log('Resetting report state');

// Reset all processing flags
issuesDataProcessed = false;
prsReviewDataProcessed = false;
hasInjectedContent = false;

// Reset data arrays
lastWeekArray = [];
nextWeekArray = [];
reviewedPrsArray = [];
githubPrsReviewDataProcessed = {};

// Clear cached data
githubCache.data = null;
githubCache.cacheKey = null;
githubCache.timestamp = null;
githubCache.subject = null;

log('Report state reset complete');

// Regenerate report if requested
if (regenerateReport) {
log('Regenerating report after reset');
if (outputTarget === 'popup') {
writeGithubIssuesPrs();
writeGithubPrsReviews();
} else {
// For email context, trigger a fresh data fetch
fetchGithubData();
}
}
}

/**
* Forces a refresh of GitHub data by clearing cache and fetching new data
* @returns {Promise} Promise that resolves when refresh is complete
*/
async function forceGithubDataRefresh() {
log('Force refreshing GitHub data');

// Clear cache from storage
await new Promise(resolve => {
chrome.storage.local.remove('githubCache', resolve);
});

// Reset report state
resetReportState(false);

// Fetch fresh data
try {
await fetchGithubData();
return { success: true, message: 'Data refreshed successfully' };
} catch (error) {
logError('Force refresh failed:', error);
return { success: false, error: error.message };
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small request - let's avoid pushing AI-generated code directly. It often misses context and might not align well with the project's structure.. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you don' t have the context let me add it for you , it is a suggestion from sourcery-ai to have refactor the manual reset of processed flags and subsequent calls in scrumHelper.js into a single reset method to reduce duplication and clarify the report regeneration flow and i find it benifical because it reduces duplication ,improves clarity and the function is only used in places where a full reset is appropriate, and the code is now easier to maintain and less error-prone. Thanks!

@Preeti9764
Copy link
Contributor Author

There is no need of multiple entries to be stored in the extension. For our projects' scope single stored entries are more than enough and serves us efficiently. Also its a major change in the caching mechanism, if you feel they are necessary we can open another ticket for that, please don't push several things in a single PR. Thanks!

@vedansh-5 The only cache object used is githubCache, which is a single object in memory,there is no array of caches, no logic for storing multiple cache objects, and no code that would result in multiple cache entries being kept in storage and queue and fetching fields are only used for managing concurrent fetches . Thanks!

@Preeti9764 Preeti9764 requested a review from vedansh-5 June 26, 2025 10:08
@Preeti9764
Copy link
Contributor Author

@vedansh-5 The reset logic is used in multiple placesβ€”refresh actions, after fetches, after processing data, and more. Centralizing it in resetReportState() keeps the code DRY (Don’t Repeat Yourself), reliable, and easy to maintain.I hope you get the logic for new function addition change. Thanks!

@vedansh-5
Copy link
Contributor

vedansh-5 commented Jun 26, 2025 via email

@vedansh-5
Copy link
Contributor

image
Does not show labels in other organization.

@vedansh-5
Copy link
Contributor

The reset logic is used in multiple placesβ€”refresh actions, after fetches, after processing data, and more. Centralizing it in resetReportState() keeps the code DRY (Don’t Repeat Yourself), reliable, and easy to maintain.I hope you get the logic for new function addition change. Thanks!

I’m not against the logic or the improvement itself. Just to clarify, my concern is that the code - as you mentioned- was directly suggested by Sorcery AI and included as-is, with its comments and structure intact. We generally avoid adding AI-generated code directly to the codebase. If you're using an AI suggestion, it’s best to adapt and rewrite it in your own style so it fits better with the rest of the code. Also, for this reason, please remove the JSDocs - they’re not needed here. Thanks!

@vedansh-5
Copy link
Contributor

About the cache code - sorry for the confusion earlier. My comment was based on how it appeared in GitHub's UI, it was being shown as a new insertion, I misunderstood it as a duplicate. That was a mistake on my part, I now realize that the code was already part of the base and it's actually needed. TTL, Fetching and Queues are being used in many parts of the code. Could you please revert that removal? Thanks!

Copy link
Contributor

@vedansh-5 vedansh-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not observe the bug anymore, please make the above changes and rebase this PR against main and we're good to go.
Thanks!

@Preeti9764
Copy link
Contributor Author

Preeti9764 commented Jun 26, 2025

image Does not show labels in other organization.

Yeah will raise a issue for this , currently this bug needs to be fixed . Thanks!

@Preeti9764
Copy link
Contributor Author

Preeti9764 commented Jun 26, 2025

The reset logic is used in multiple placesβ€”refresh actions, after fetches, after processing data, and more. Centralizing it in resetReportState() keeps the code DRY (Don’t Repeat Yourself), reliable, and easy to maintain.I hope you get the logic for new function addition change. Thanks!

I’m not against the logic or the improvement itself. Just to clarify, my concern is that the code - as you mentioned- was directly suggested by Sorcery AI and included as-is, with its comments and structure intact. We generally avoid adding AI-generated code directly to the codebase. If you're using an AI suggestion, it’s best to adapt and rewrite it in your own style so it fits better with the rest of the code. Also, for this reason, please remove the JSDocs - they’re not needed here. Thanks!

The JSDocs you’re referring to are comments that help explain what a function does, its parameters, and its return values. They can be very helpful for new contributors to quickly understand the purpose and usage of a function without having to read through all the code. if you want i can change the format I’ll write it in our own style rather than using generic JSDoc blocks.Thanks!

@vedansh-5
Copy link
Contributor

JSDocs you referring are comments that help to understand about the function and they can be very helpful for new contributors to understand what a function does without reading all the code.Thanks!

I'm aware that JSDocs are meant to help explain functions, but in this case the function name is already self-explanatory. Also, since both the function and the JSDocs were generated by AI, I imply they can be removed. I leave it up to you.
Thanks!

@Preeti9764
Copy link
Contributor Author

JSDocs you referring are comments that help to understand about the function and they can be very helpful for new contributors to understand what a function does without reading all the code.Thanks!

I'm aware that JSDocs are meant to help explain functions, but in this case the function name is already self-explanatory. Also, since both the function and the JSDocs were generated by AI, I imply they can be removed. I leave it up to you. Thanks!

Thanks for your suggestions , as i said the reset logic is used in multiple placesβ€”refresh actions, after fetches,after processing data and others having a centralised function for it would be helpful in further development and easy to use which is my objective behind adding this function and I am open to change .

@vedansh-5
Copy link
Contributor

To clarify, my comment wasn’t about the function logic itself. I was specifically referring to the JSDocs that were included verbatim from the AI-generated suggestion. I’m suggesting they be written manually, in a clearer and more tailored way, so they’re actually helpful for new contributors. That would make a lot more sense and maintain consistency.

@Preeti9764
Copy link
Contributor Author

To clarify, my comment wasn’t about the function logic itself. I was specifically referring to the JSDocs that were included verbatim from the AI-generated suggestion. I’m suggesting they be written manually, in a clearer and more tailored way, so they’re actually helpful for new contributors. That would make a lot more sense and maintain consistency.

To clarify, my comment wasn’t about the function logic itself. I was specifically referring to the JSDocs that were included verbatim from the AI-generated suggestion. I’m suggesting they be written manually, in a clearer and more tailored way, so they’re actually helpful for new contributors. That would make a lot more sense and maintain consistency.

if you mean that , i mentioned i will change the format for comments ,also as they are JSDoc and are easily understandable by developers.Thanks!

@vedansh-5
Copy link
Contributor

i mentioned i will change the format for comments

You edited the concerning message 23 minutes ago (after my comment was made). πŸ™‚

I'm aware that JSDocs are meant to help explain functions, but in this case the function name is already self-explanatory. Also, since both the function and the JSDocs were generated by AI, I imply they can be removed. I leave it up to you. Thanks!

@Preeti9764
Copy link
Contributor Author

@hpdang I have made suggested changes , this fixes current bug and good to be merged from my end Thanks!

@Preeti9764 Preeti9764 self-assigned this Jun 27, 2025
@hpdang
Copy link
Member

hpdang commented Jun 27, 2025

@Preeti9764 please also resolve the conflicts

@Preeti9764
Copy link
Contributor Author

@hpdang I have resolved the conflicts.Thanks

@hpdang
Copy link
Member

hpdang commented Jun 27, 2025

@vedansh-5 please review

@vedansh-5 vedansh-5 self-requested a review June 27, 2025 15:27
Copy link
Contributor

@vedansh-5 vedansh-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment, apart from that the PR looks good to me.

Also, I observed the home button was gone, it was completely white(could not be seen), but was clickable.
But upon refreshing this bug was resolved, I'm not sure if it was something concerned to this PR or not, did you happen to notice the same too @Preeti9764 @hpdang ?

@@ -422,7 +427,7 @@ document.addEventListener('DOMContentLoaded', function () {
if (toastDiv.parentNode) toastDiv.parentNode.removeChild(toastDiv);
}, 3000);
});
}, 3000);
}, 2500);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the organization name is changed, the content takes a noticeable amount of time to get removed. This delay can lead to multiple points of confusion for users:

  • the delay might be mistaken as the extension hanging or lagging, giving an impression of poor performance or unresponsiveness.
  • the mismatch between user input and visual feedback breaks consistency in the experience, especially for users who expect immediate UI changes.
  • overtime this delay can reduce user trust in the accuracy or responsiveness of the extension.

This might be due to an interval/polling mechanism that delays cleanup. This time period can/should be reduced.

lagging.preeti.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Better Handling after organization name changed
3 participants