Skip to content

fix(launchplan): show every launch plan - #923

Open
1fanwang wants to merge 4 commits into
flyteorg:masterfrom
1fanwang:fix-launchplan-count-typo
Open

1fanwang wants to merge 4 commits into
flyteorg:masterfrom
1fanwang:fix-launchplan-count-typo

Conversation

@1fanwang

@1fanwang 1fanwang commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

The launch-plan card and table views can show too few launch plans, or none at all, even when more were supplied. They decide how many rows to render by measuring a scroll container element that does not exist in this layout, so the measurement comes back null. Both views now render the launch-plan results they receive directly, without depending on that measurement.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

The card and table views now render exactly the results they are given, instead of relying on the missing scroll measurement. Loading and empty states are unchanged.

Testing Done

Rendered the actual card and table views in jsdom with their normal providers and child components, once with the pre-fix source (commit 04d6a33) and once with this fix applied (commit 260c647, this PR head). The probe supplies 64 launch plans, counts the rendered cards and rows, then separately checks the empty table.

With Node 16.19.0 and the checkout installed dependencies, save the source below as launch_plan_repro.cjs in the repository root, then run each command and its result is shown directly below it.

Command:

git checkout 04d6a334cb0742e0337226ef8b390188c6b2e00d -- packages/oss-console/src/components/LaunchPlan && NODE_ENV=test node launch_plan_repro.cjs

Result, pre-fix source, 64 supplied plans render as 0:

{"component":"LaunchPlanCardView","supplied":64,"count":0,"firstLink":null,"lastLink":null}
{"component":"LaunchPlanTableView","supplied":64,"count":0,"firstLink":null,"lastLink":null}
{"component":"LaunchPlanTableView","supplied":0,"count":0,"firstLink":null,"lastLink":null}

Command:

git checkout 260c64759ec11aca589353d58610a08fe6096bba -- packages/oss-console/src/components/LaunchPlan && NODE_ENV=test node launch_plan_repro.cjs

Result, this PR head, all 64 supplied plans render:

{"component":"LaunchPlanCardView","supplied":64,"count":64,"firstLink":"/projects/demo/domains/development/launchPlans/lp-0","lastLink":"/projects/demo/domains/development/launchPlans/lp-63"}
{"component":"LaunchPlanTableView","supplied":64,"count":64,"firstLink":"/projects/demo/domains/development/launchPlans/lp-0","lastLink":"/projects/demo/domains/development/launchPlans/lp-63"}
{"component":"LaunchPlanTableView","supplied":0,"count":0,"firstLink":null,"lastLink":null}
Reproducer source: launch_plan_repro.cjs
const assert = require('node:assert/strict');
const { createRequire } = require('node:module');

const load = createRequire(`${process.cwd()}/package.json`);
load('@babel/register')({
  babelrc: false,
  configFile: false,
  only: [/react-syntax-highlighter\/dist\/esm\//],
  presets: [[load.resolve('@babel/preset-env'), { targets: { node: 'current' } }]],
});
load('ts-node').register({
  transpileOnly: true,
  skipProject: true,
  compilerOptions: {
    module: 'CommonJS',
    moduleResolution: 'node',
    target: 'ES2020',
    jsx: 'react',
    esModuleInterop: true,
  },
});
const paths = load('tsconfig-paths');
const config = paths.loadConfig(process.cwd());
assert.equal(config.resultType, 'success');
paths.register({ baseUrl: config.absoluteBaseUrl, paths: config.paths });

const { JSDOM } = load('jsdom');
const dom = new JSDOM('<!doctype html><html><body></body></html>', {
  url: 'http://localhost/',
  pretendToBeVisual: true,
});
global.window = dom.window;
global.document = dom.window.document;
global.localStorage = dom.window.localStorage;
Object.defineProperty(global, 'navigator', { value: dom.window.navigator, configurable: true });
global.HTMLElement = dom.window.HTMLElement;
global.getComputedStyle = dom.window.getComputedStyle;
global.requestAnimationFrame = dom.window.requestAnimationFrame.bind(dom.window);
global.cancelAnimationFrame = dom.window.cancelAnimationFrame.bind(dom.window);

const React = load('react');
const { render } = load('@testing-library/react');
const { ThemeProvider } = load('@mui/material/styles');
const { QueryClient, QueryClientProvider } = load('react-query');
const { MemoryRouter } = load('react-router-dom');
load('react-intersection-observer').defaultFallbackInView(false);
const { muiTheme } = load('@clients/theme/Theme/muiTheme');
const LaunchPlanCardView =
  load('@clients/oss-console/components/LaunchPlan/LaunchPlanCardList/LaunchPlanCardView').default;
const { LaunchPlanTableView } =
  load('@clients/oss-console/components/LaunchPlan/LaunchPlanTable/LaunchPlanTableView');

const queryClient = new QueryClient();
const results = Array.from({ length: 64 }, (_, index) => ({
  key: `lp-${index}`,
  value: { id: { project: 'demo', domain: 'development', name: `lp-${index}` } },
}));
function show(Component, supplied, selector) {
  const { container, unmount } = render(
    React.createElement(
      QueryClientProvider,
      { client: queryClient },
      React.createElement(
        MemoryRouter,
        {},
        React.createElement(
          ThemeProvider,
          { theme: muiTheme },
          React.createElement(Component, { results: supplied, loading: false }),
        ),
      ),
    ),
  );
  const count = container.querySelectorAll(selector).length;
  const links = Array.from(container.querySelectorAll('a[href]'), (link) =>
    link.getAttribute('href'),
  );
  console.log(JSON.stringify({
    component: Component.name,
    supplied: supplied.length,
    count,
    firstLink: links[0] || null,
    lastLink: links[links.length - 1] || null,
  }));
  unmount();
}
show(LaunchPlanCardView, results, '[data-testid="launch-plan-card"]');
show(LaunchPlanTableView, results, '[data-testid="launch-plan-table-row"]');
show(LaunchPlanTableView, [], '[data-testid="launch-plan-table-row"]');
queryClient.clear();
dom.window.close();

I did not run a browser scrolling test or a live-backend smoke test.

  • Local code review completed

Tracking Issue

N/A

Follow-up issue

N/A

@1fanwang
1fanwang force-pushed the fix-launchplan-count-typo branch from 3c7258b to 9bbe292 Compare June 21, 2026 08:41
@1fanwang 1fanwang changed the title fix(launchplan): render the full launch plan list instead of clipping it fix(launchplan): show every launch plan Aug 20, 2026
The launch plan table and card views virtualized against
document.getElementById('scroll-element'), which is null in this layout, so the
virtualizer had no scroll container and rendered the wrong number of rows. The
table view also read result?.length (the lodash `result` function, always
truthy) instead of results?.length. Render the results directly with stable keys.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
The fix changes both launch-plan views, but the regression covered only the table. Exercise the card view with enough results to fail under the old detached virtualizer.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
@1fanwang
1fanwang force-pushed the fix-launchplan-count-typo branch from 9bbe292 to 8795275 Compare August 24, 2026 10:25
Signed-off-by: 1fanwang <1fannnw@gmail.com>
@1fanwang

Copy link
Copy Markdown
Contributor Author

@kumare3 could you review when you have time?

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.

1 participant