Skip to content

Conversation

@pjiang-dev
Copy link
Contributor

@pjiang-dev pjiang-dev commented Jan 2, 2026

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Currently it will be located at /applicationsets but we won't enable the route until the full feature is ready

Screenshot 2026-01-16 at 2 00 10 PM

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
@bunnyshell
Copy link

bunnyshell bot commented Jan 2, 2026

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
@pjiang-dev pjiang-dev marked this pull request as ready for review January 21, 2026 04:40
@pjiang-dev pjiang-dev requested a review from a team as a code owner January 21, 2026 04:40
pjiang-dev and others added 2 commits January 20, 2026 20:55
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
}

export function getFilterResults(applications: Application[], pref: AppsListPreferences): FilteredApp[] {
export function getFilterResults(applications: AbstractApplication[], pref: AbstractAppsListPreferences): AbstractFilteredApp[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we are coercing pref to be AppsListPreferences in all its uses (pref as AppsListPreferences), would it be better to just keep its type as AppsListPreferences? Generally the as keyword is bad form because it breaks type safety.

labels: pref.labelsFilter.length === 0 || pref.labelsFilter.every(selector => LabelSelector.match(selector, app.metadata.labels)),
operation: pref.operationFilter.length === 0 || pref.operationFilter.includes(getOperationStateTitle(app))
}
filterResult: isApp(app)
Copy link
Contributor

Choose a reason for hiding this comment

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

same as with pref, since we validate that the object is an app, I don't think we should need to do app as Application through this map. Were there problems without those as statements?

emptyState={() => (
<EmptyState icon='fa fa-search'>
<h4>No matching applications found</h4>
<h4>No matching {isListOfApplications ? 'applications' : 'ApplicationSets'} found</h4>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should this be "application sets" instead of "ApplicationSets"?

const isOci = source?.repoURL?.startsWith('oci://');
const targetRevision = source ? source.targetRevision || 'HEAD' : 'Unknown';
const linkInfo = getApplicationLinkURL(app, ctx.baseHref);
const healthStatus = isApplication ? typedApp.status.health.status : getAppSetHealthStatus(typedAppSet);
Copy link
Contributor

Choose a reason for hiding this comment

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

I worry about the maintainability of some of these files. When we are filling a component with so many isApplication and !isApplication checks to make small modifications to the component, I wonder if it would be better to extract these into two separate components. i.e. an ApplicationTile and an AppSetTile.

We could leave these top-level declarations here, but instead of returning all these conditionally rendered sub-components, we can return either an ApplicationTile or an AppSetTile with self contained rendering logic that doesnt need to worry about what kind of tile it is.

const typedApp = isApplication ? (app as models.Application) : null;
const typedAppSet = !isApplication ? (app as models.ApplicationSet) : null;
const healthStatus = isApplication ? typedApp.status.health.status : getAppSetHealthStatus(typedAppSet);
return (
Copy link
Contributor

Choose a reason for hiding this comment

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

Same with the Application tiles, it could be good to extract all this conditional logic into self-contained components

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.

2 participants