How to show subpar figures in index of figures?

Here is my code:

#import "@preview/subpar:0.2.1"

#outline(title: [Index of Figures], target: figure.where(supplement: [Figure]))

#subpar.grid(
  figure(caption: lorem(6), box(stroke: 2pt + red, height: 2em, width: 8em)),
  figure(caption: lorem(6), box(stroke: 2pt + red, height: 2em, width: 8em)),
  columns: (1fr, 1fr),
  caption: lorem(13),
)

#figure(caption: lorem(6), box(stroke: 2pt + red, height: 2em, width: 8em))

Result:

image

As we can see, the subpar figure does not show in the index of figures. When I change the outline target to selector(figure) it displays the missing subpar figure, however it also shows non-figure elements of my document (e.g., tables, algorithms…), which I don’t want.

How to fix that?

A quick fix is explicitly specifying the super figure’s supplement, even though it is set to “Figure” by default. I don’t know if there is a solution that handles that automatically.

#subpar.grid(
  figure(caption: lorem(6), box(stroke: 2pt + red, height: 2em, width: 8em)),
  figure(caption: lorem(6), box(stroke: 2pt + red, height: 2em, width: 8em)),
  columns: (1fr, 1fr),
  caption: lorem(13),
  supplement: [Figure]    // ADD THIS
)