Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

Added: in page notification options#127

Merged
arr0ganc3s merged 4 commits intoWayneKeenan:mainfrom
fanno:feature/in-page-options
Aug 30, 2025
Merged

Added: in page notification options#127
arr0ganc3s merged 4 commits intoWayneKeenan:mainfrom
fanno:feature/in-page-options

Conversation

@fanno
Copy link

@fanno fanno commented Aug 28, 2025

Changed: browser sync storage as there is a limit to how manny packages you can send to the cloud (this is done with a timestamp counter) > 10 curently. if threasshold is reached it will delay send and send it one second later. further "adds" are added to the same "batch" and time is reset by 1 sec Changed so that it wont .set of value already equal to .get

image
  • The target of this PR is the main branch.
  • No commits are missing from forked base branch (e.g. modified main branch instead of dev)
  • You have squashed commits that might be considered: 'noisy' or partial, e.g. not candidates for cherry picking
  • All test pass, run npm test
  • The code is formatted, run npm run format
  • You have updated or added test cases, as/if required
  • You have installed and tried out the plugin in a supported browser

Changed: browser sync storage as there is a limit to how manny packages you can send to the cloud (this is done with a timestamp counter) > 10 curently. if threasshold is reached it will delay send and send it one second later. further "adds" are added to the same "batch" and time is reset by 1 sec
Changed so that it wont .set of value already equal to .get
try {
await browser.storage.sync.set({ [key]: toStore });
console.log(`BrowserSyncStorage.set: ${key} = ${toStore}`);
if (currentValue != value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If the value is usually saved as a JSON.stringify'd value, don't you need to compare what's in the storage with a JSON.stringify'd value instead of the value of unknown type?

Copy link
Author

Choose a reason for hiding this comment

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

The .get do JSON.parse before returning value so it should be back to the "real" value, and value is the same ? or did i miss something?

Copy link
Contributor

Choose a reason for hiding this comment

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

The opposite might be better where you

const newValue = JSON.stringify(value);

and then check if currentValue != newValue or something like that.

}
},
"DISMISS_TIME_LABEL": {
"message": "Dismiss time, $houers$ houers",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hours is misspelled.

Copy link
Contributor

@schang1146 schang1146 left a comment

Choose a reason for hiding this comment

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

Left some comments, started to fade and couldn't review:

  • preferences.ts
  • browser-sync-storage.ts
  • Inspagenotification.tsx

}

export interface IInPageNotificationPageMenu {
pageReferance: React.RefObject<HTMLParagraphElement | null>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Spelling

Suggested change
pageReferance: React.RefObject<HTMLParagraphElement | null>;
pageReference: React.RefObject<HTMLParagraphElement | 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 look for other references to "referance".

Comment on lines 6 to 18

/*
export interface IStorageSyncBackend {
buffer: Map<string, unknown>;
removals: string[];
flushTimeout: NodeJS.Timeout | null;

set(key: string, value: unknown): Promise<void>;
get(key: string): Promise<unknown>;
remove?(key: string): Promise<void>;
scheduleSync(delay: number): void;
}
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this going to be used in the future? If not, please remove unnecessary commented out code.

Suggested change
/*
export interface IStorageSyncBackend {
buffer: Map<string, unknown>;
removals: string[];
flushTimeout: NodeJS.Timeout | null;
set(key: string, value: unknown): Promise<void>;
get(key: string): Promise<unknown>;
remove?(key: string): Promise<void>;
scheduleSync(delay: number): void;
}
*/

Comment on lines 200 to 207
datalist {
display: flex;
justify-content: space-between;
writing-mode: lr;
width: 100%;
padding-left: 8px;
padding-right: 5px;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Add common class name that can go on both <datalist> elements to share the styling.

Trying to avoid targeting a HTML element in case we want to use <datalist> in a different way elsewhere.

transform: translateX(22px);
}

.slidecontainer {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.slidecontainer {
.sliderContainer {

console.log(`BrowserSyncStorage.set: ${key} = ${toStore}`);
if (currentValue != value) {
const toStore = JSON.stringify(value);
if (this.checkQue()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Spelling

Suggested change
if (this.checkQue()) {
if (this.checkQueue()) {

@arr0ganc3s arr0ganc3s merged commit a182ef6 into WayneKeenan:main Aug 30, 2025
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants