Skip to content

Conversation

@TBThomas56
Copy link
Contributor

No description provided.

);

const [isPaginated, setIsPaginated] = useState(false);
const isPaginated = useRef(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling to understand the whole pagination system, but I'm not sure that this can just be substituted like this - previously, the state and its setter got passed down to the WorkflowsContent and it got changed from there, but now I think the isPaginated.current value would only be passed down when the component renders and any changes to isPaginatedRef in the WorkflowsContent won't be seen back here. This seems to start false, get set to true in the useEffect, then have no way of changing back.

I had a bit of a play around with this in the browser and I didn't see any faulty behaviour, so it's possible that the dependencies and re-rendering of components happens to make this irrelevant, but I do think this could use a bit of a closer look. Sorry I can't be any more specific than that...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree with this. Have added a callback to allow the bi-directional data flow

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to make some changes to ScrollableImages but I'll make those changes to SciReactUI and import the component here when done.

Comment on lines +82 to +83
expect(screen.getByText("React Flow")).toBeVisible();
expect(screen.getByText("even")).toBeInTheDocument();
Copy link
Contributor

@JamesDoingStuff JamesDoingStuff Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will just point out this, as it's something Thomas and I changed to get the test passing, but maybe we shouldn't have: the even node always counts as being in the document, regardless of whether the accordion is expanded or not, thus making this check redundant. I've tried getting it to work with toBeVisible again but no luck.
Perhaps we should change the test to something like this, just to make it a bit less misleading?

  it("should contain a Flow with job nodes", async () => {
    const accordionButton = await screen.findByRole("button", {
      name: /conditional-steps-first/i,
    });
    expect(accordionButton).toHaveAttribute("aria-expanded", "false");
    expect(screen.getByText("React Flow")).not.toBeVisible();
    expect(screen.getByText("even")).toBeInTheDocument();

    await user.click(accordionButton);
    expect(accordionButton).toHaveAttribute("aria-expanded", "true");
    expect(screen.getByText("React Flow")).toBeVisible();
  });

The above also seems to work without the hacky script I introduced in relay-workflows-lib/tests/mocks/mockReactFlow.ts, so that could be binned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants