Labels

Pull request labels allow you to categorize and filter pull requests. They are shown on the right side in the labels panel.

Labels panel

You can add or remove them by clicking on the edit (pencil) button.

You can define your own labels or use the default ones provided by Flowie. Plugins can also add their own labels.

Quick remove mode NEW

To enter quick remove mode, double-click on the labels panel and you should see the option to remove each label. Once you removed the labels you want, double-click again on the panel or click away from the panel to make the changes effective.

Labels quick remove mode

Defining labels

The labels are defined in the labels schema under the configuration property named labels.

import {const configure: (config: Config | (() => Config)) => voidconfigure} from "flowie.app"

function configure(config: Config | (() => Config)): voidconfigure({
  
Config.labels?: {
    schema?: Array<Label>;
} | undefined
labels
: {
schema?: Label[] | undefinedschema: [{BasicLabel.name: stringname: "My label"}], }, })

A label can be a BasicLabel or LabelSet.

BasicLabel

A BasicLabel is the traditional label that is used to tag.

  {
    BasicLabel.name: stringname: "Documentation",
    LabelValueOptions.description?: string | undefineddescription: "Documentation changes",
  }

Results in:

Documentation label example

LabelSet

LabelSet is a label that has a name and can assume only a single value from a set of values. It allows you to model custom workflows via status, for example. It is also more convenient because you don’t to remove the old label when you are changing the value. For instance, if you have a issue type label bug and want to change it do feature, just replace assigning the feature value will remove the bug.

  {
    BasicLabel.name: stringname: "Type",
    
LabelSet.values: (string | [string, LabelValueOptions & {
    valueColor?: Color;
}])[]
values
: ["Bug", "Feature"],
}

Results in:

Documentation label example Documentation label example

Colors

You can also define the color of the label. The color is optional and if not provided, Flowie will use the default color. The color of the text is automatically determined based on the background color.

  {
    BasicLabel.name: stringname: "Type",
    LabelValueOptions.color?: Color | undefinedcolor: "green",
    
LabelSet.values: (string | [string, LabelValueOptions & {
    valueColor?: Color;
}])[]
values
: ["Bug", "Feature"],
}

Results in:

Documentation label example Documentation label example

It becomes the default color for all the values, but you can also define a color for each value.

  {
    BasicLabel.name: stringname: "Type",
    LabelValueOptions.color?: Color | undefinedcolor: "green",
    
LabelSet.values: (string | [string, LabelValueOptions & {
    valueColor?: Color;
}])[]
values
: [["Bug", {LabelValueOptions.color?: Color | undefinedcolor: "red"}], "Feature", "Task"],
}

Results in:

Bug label example Feature label example Task label example

The supported values syntax for colors and examples are:

  • Atlassian theme colors: purple, purpleLight
  • Atlassian palette colors: Blue100, Blue200, Red100
  • HEX: #ff0000
  • RGB: rgb(255, 0, 0)
  • RGBA: rgba(255, 0, 0, 0.5)
  • HSL: hsl(0, 100%, 50%)
  • HSLA: hsla(0, 100%, 50%, 0.5)

Icons and Unicode

Flowie labels have support for Unicode. You define your label as:

  {
    BasicLabel.name: stringname: "Performance 🚀",
    LabelValueOptions.color?: Color | undefinedcolor: "Magenta200",
  }

Results in:

Unicode label example

Removing or renaming labels from the schema

Once a label is removed from the schema it will not be shown in the pull request. However, the label will still be present in the pull request and if you add it back to the schema, it will be shown again.

Currently, there is no way to rename a label. If you want to rename a label, you must define a new one, add it to the pull request and remove the previous value. If you just change the label name, Flowie will treat it as a new label.

A complete example

import {const configure: (config: Config | (() => Config)) => voidconfigure} from "flowie.app"

function configure(config: Config | (() => Config)): voidconfigure({
  
Config.labels?: {
    schema?: Array<Label>;
} | undefined
labels
: {
schema?: Label[] | undefinedschema: [ {BasicLabel.name: stringname: "My label"}, {BasicLabel.name: stringname: "Priority", LabelValueOptions.color?: Color | undefinedcolor: "Purple100",
LabelSet.values: (string | [string, LabelValueOptions & {
    valueColor?: Color;
}])[]
values
: ["Low", "Medium", "High"]},
{ BasicLabel.name: stringname: "Type",
LabelSet.values: (string | [string, LabelValueOptions & {
    valueColor?: Color;
}])[]
values
: [
["Bug", {LabelValueOptions.color?: Color | undefinedcolor: "red"}], ["Feature", {LabelValueOptions.color?: Color | undefinedcolor: "teal"}], ], }, ], }, })