Giter VIP home page Giter VIP logo

Comments (3)

macintacos avatar macintacos commented on June 16, 2024 1

I decided to "solve" this by doing a combination of a couple of things:

  • I use the method stated here for managing labels (I don't add them individually). Namely, I am just setting the labels in the actions themselves and then using lib.rulesLabels.
  • Now when specifying labels in a filter, I use this function instead of a "bare" label array:
     local nestedLabels(labels) =
       local splitLabel(label) = std.split(label, '/');
       local genSubLabels(label) =
         [
           std.join(
             '/',
             splitLabel(label)[:i + 1]
           )
           for i in std.range(0, std.length(splitLabel(label)) - 1)
         ];
       std.flattenArrays([genSubLabels(i) for i in labels]);
    When you call nestedLabels(["some/thing", "lol/okay/no"]) the array will be transformed to ["some", "some/thing", "lol", "lol/okay", "lol/okay/no"], which works perfectly for my needs.

from gmailctl.

mbrt avatar mbrt commented on June 16, 2024

There are people calling their labels exactly like that (with slashes), and we don't want to break those use cases.

Perhaps you know this already, but just to make sure: to have that label as nested, you have to add a Some and a Some/Label label. After you do this, Gmail will interpret Some/Label/Name as a sub-label.

Since gmailctl uses Jsonnet, you can implement this in your config directly. See e.g. how we automatically create labels through https://github.com/mbrt/gmailctl/blob/master/internal/data/gmailctl.libsonnet#L68. I think that doing something similar to extendWithParents should work for you.

from gmailctl.

github-actions avatar github-actions commented on June 16, 2024

This issue is stale because it has been open for 30 days without activity.
This will be closed in 7 days, unless you add the 'lifecycle/keep-alive' label or comment.

from gmailctl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.