Skip to content
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

core: auto-delete by TTL setting #17

Open
ayoung19 opened this issue Sep 21, 2024 · 8 comments
Open

core: auto-delete by TTL setting #17

ayoung19 opened this issue Sep 21, 2024 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ayoung19
Copy link
Owner

Auto-delete old entries by giving entries an expiration or after the list hits a certain number of entries.

@ayoung19 ayoung19 added enhancement New feature or request good first issue Good for newcomers labels Sep 21, 2024
@Ribas160
Copy link

The easiest way is to remove entries by list length. But it is possible to do both and allow the user to switch between them and change the settings (max list length, number of minutes/hours/days). It depends on your goal and the complexity you want to add to the application.

@ayoung19
Copy link
Owner Author

ayoung19 commented Sep 22, 2024

Users are requesting the option to auto-delete both ways. Here is the inspiration (first two options):

image

Did you want to take this on?

@Ribas160
Copy link

Yes, I would like to work on it.

@ayoung19
Copy link
Owner Author

Ok I'm currently working on the popup side of this (UI that lets the user configure the settings). You can work on ingesting this setting and perform the behavior on entry creation. Does that sound good to you? Let's also start with just the max number of entries auto-delete setting:

import { z } from "zod";

// DO NOT REUSE DEPRECATED FIELDS.
export const defaultSettings = {
  totalItemsBadge: true,
  // theme: "light",
  themeV2: "system",
  localItemLimit: undefined,
};

export const Settings = z
  .object({
    totalItemsBadge: z.boolean().default(defaultSettings.totalItemsBadge),
    // theme: z.string().default(defaultSettings.theme),
    themeV2: z.string().default(defaultSettings.themeV2),
    localItemLimit: z.number().optional(),
  })
  .default(defaultSettings);
export type Settings = z.infer<typeof Settings>;

The new settings field will be localItemLimit with a type of number | undefined where undefined means it's off.

@ayoung19
Copy link
Owner Author

ayoung19 commented Sep 23, 2024

Also do you have a rough timeline on when you could do this by?

@Ribas160
Copy link

Ribas160 commented Sep 24, 2024

Ok, it is ok for me. The timeline depends on my free time. I am going to work on it this week.

@ayoung19
Copy link
Owner Author

No worries, I totally understand. Also very sorry but because this is a pretty highly requested feature and I'm going to have a lot less free time soon, I went ahead and finished the first type of auto-delete earlier tonight.

We still need the auto-delete by TTL version but that one's lower on the priority list so I can leave it to you to finish it whenever you have the time. Just give me a heads up when you begin working on it. Also, feel free to ping me for questions anytime.

Do you use Discord? I might make one to make it easier to discuss features.

@ayoung19 ayoung19 changed the title core: auto-delete settings core: auto-delete by TTL setting Sep 25, 2024
@Ribas160
Copy link

No problem, I can work on auto-delete by TTL version.
I have a Discord account, so, we can contact there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants