microsoft / powercat-creator-kit

This toolkit helps create well-designed Power App experiences on the web & mobile. It contains a component library; PCF controls and other utilities that increase developer productivity.
MIT License
312 stars 51 forks source link

[BUG]: SubwayNav limited to 25 items #389

Open datalink0 opened 1 year ago

datalink0 commented 1 year ago

Describe the bug The subway navigation control is limited to 25 items. This bug or limitation is present in sub-steps scenario as well.

To Reproduce Steps to reproduce the behavior:

  1. Import SubwayNav component
  2. In Items Property create a table with more than 25 steps/items
  3. If item 25+ is non-substep then it will simply not show up in the subway navigation, if item 25+ is in Sub-step, expand substep, and item does not show up in subway navigation.

Expected behavior Expected behavior is supposed to be Subway navigation showing past 25 items.

Screenshots As you can see, the expanded Step 9 is only showing until Sub Step 9.6, whereas the Items table has items until Sub Step 9.8

image image

AB#950

denise-msft commented 1 year ago

Thanks for reporting this @datalink0. The image you're showing that renders SubwayNav looks like it's showing 15, but the table has 27. I'll try to reproduce this to validate the actual visual behavior.

How many main steps do you need, and what's the maximum number of sub steps you need to display under one main step?

If you're running into issues because a lot of your main steps need to show sub steps, would it be an option for you to 'collapse' some of the sub-steps of a main step that's not the current main step?

I will post the way we've done this in the Dataverse Accelerator connector wizard to help visualize this.

datalink0 commented 1 year ago

Denise, its only showing 15 because only Step 9 (Parent Step) is expanded. Even if I do all non-parent steps it always seems to still be limited to 25 items.

For the project I'm working on I need almost 50 items, consisting of 9 parent steps, and the rest sub-steps. The maximum number of sub-steps per one main step would be somewhere between 7 to 9 sub-steps.

Your solution via named formulas looks promising. I'll give it try.

Appreciate the tip and look forward to your Dataverse Accelerator connector wizard example.

denise-msft commented 10 months ago

Apologies for the delay here. This is a sample from a first party app we used to conditionally display values based on the current screen and certain component values (e.g., checkbox displayed more values if checked). This expression was stored in the App.Formulas property:

// All subwaynav items
WizardItems = Table(
    {
        Index: 0,
        ItemKey: "connection",
        ItemLabel: DVVirtualPageLoc.connection,
        Screen: ConnectionScreen
    },
    {
        Index: 1,
        ItemKey: "connectionReference",
        ItemLabel: DVVirtualPageLoc.connectionReference,
        Screen: ConnectionReferenceScreen
    },
    {
        Index: 3,
        ItemKey: "action",
        ItemLabel: DVVirtualPageLoc.action,
        Screen: ActionScreen
    },
    {
        Index: 4,
        ItemKey: "parameters",
        ItemLabel: DVVirtualPageLoc.parameters,
        Screen: ParameterScreen
    },
    {
        Index: 5,
        ItemKey: "review",
        ItemLabel: DVVirtualPageLoc.review,
        Screen: ReviewScreen
    }
);

// Current wizard step
CurrentWizardStep = LookUp(
    WizardItems,
    Screen = App.ActiveScreen
).Index;

// Displayed subwaynav steps and ItemState based on CurrentWizardStep
DisplayedWizardItems = AddColumns(
    Filter(
        WizardItems,
        If(
            !ConfigureConnectionReferencesCheckbox.Checked,
            Index <> 1,
            true
        )
    ),
    "ItemState",
    If(
        CurrentWizardStep = ThisRecord.Index || (IsBlank(CurrentWizardStep) && ThisRecord.Index = 0),
        "Current",
        If(
            CurrentWizardStep > ThisRecord.Index,
            "Completed",
            "NotStarted"
        )
    )
);