From cccc6734b2baa855d7d6d207ee83d0959330343f Mon Sep 17 00:00:00 2001
From: Josue Barros
Date: Tue, 24 Nov 2026 11:51:26 -0300
Subject: [PATCH 1/3] fix(ui): retry loading source repository details
When the repository details request fails, show a Retry action that reloads the details without remounting the source panel, preserving unsaved edits and edit mode.
Fixes #31068
Assisted-by: opencode:deepseek-flash
Signed-off-by: Josue Barros
---
.../application-parameters.test.tsx | 25 +++++++++++++
.../application-parameters.tsx | 37 +++++++++++++------
2 files changed, 51 insertions(+), 11 deletions(-)
diff --git a/ui/src/app/applications/components/application-parameters/application-parameters.test.tsx b/ui/src/app/applications/components/application-parameters/application-parameters.test.tsx
index 94c27f1d959c2..1507c2479104f 100644
--- a/ui/src/app/applications/components/application-parameters/application-parameters.test.tsx
+++ b/ui/src/app/applications/components/application-parameters/application-parameters.test.tsx
@@ -112,6 +112,31 @@ describe('ApplicationParameters ref-only sources', () => {
expect(screen.getByText(/Source 2: TYPE=Plugin/)).toBeInTheDocument();
});
+ test('retries loading source details without reloading the page', async () => {
+ const app = applicationWithValuesSource({
+ repoURL: 'https://git.example.com/org/value-files.git',
+ targetRevision: 'main',
+ ref: 'values'
+ } as models.ApplicationSource);
+ appDetails.mockRejectedValueOnce(new Error('failed to load application details'));
+ appDetails.mockResolvedValueOnce({
+ type: 'Helm',
+ helm: {name: 'prometheus', valueFiles: [], parameters: [], fileParameters: []}
+ } as models.RepoAppDetails);
+
+ const user = userEvent.setup();
+ render(
+
+
+
+ );
+
+ expect(await screen.findByRole('alert')).toBeInTheDocument();
+ await user.click(screen.getByRole('button', {name: 'Retry'}));
+ await waitFor(() => expect(screen.queryByRole('alert')).not.toBeInTheDocument());
+ expect(appDetails).toHaveBeenCalledTimes(2);
+ });
+
test('makes external values guidance accessible and saves typed files without Enter', async () => {
const app = applicationWithValuesSource({
repoURL: 'https://git.example.com/org/value-files.git',
diff --git a/ui/src/app/applications/components/application-parameters/application-parameters.tsx b/ui/src/app/applications/components/application-parameters/application-parameters.tsx
index fdf081b12ada8..1914446efde26 100644
--- a/ui/src/app/applications/components/application-parameters/application-parameters.tsx
+++ b/ui/src/app/applications/components/application-parameters/application-parameters.tsx
@@ -281,20 +281,20 @@ export const ApplicationParameters = (props: {
// For single source field, details page where we have to do the load to retrieve repo details
// Input changes frequently due to updates higher in the tree, do not show loading state when reloading
return (
- getSingleSource(application)}>
- {({details, error}: SourceDetails) => {
+ getSingleSource(application)}>
+ {({details, error}: SourceDetails, retry) => {
if (!details) {
return null;
}
const attr = gatherDetails(0, details, [], source, app, setRemovedOverrides, removedOverrides, appParamsDeletedState, setAppParamsDeletedState, false);
return (
<>
-
+
{getEditablePanel(attr, details)}
>
);
}}
-
+
);
}
}
@@ -344,12 +344,12 @@ export const ApplicationParameters = (props: {
{isRefOnlySource(app.spec.sources[index]) ? (
getEditablePanelForOneSource(undefined, index, app.spec.sources[index])
) : (
- getSourceFromAppSources(src, app.metadata.name, app.spec.project, index, 0)}>
- {({details, error}: SourceDetails) => getEditablePanelForOneSource(details, index, app.spec.sources[index], error)}
-
+ {({details, error}: SourceDetails, retry) => getEditablePanelForOneSource(details, index, app.spec.sources[index], error, retry)}
+
)}
@@ -450,7 +450,7 @@ export const ApplicationParameters = (props: {
);
}
- function getEditablePanelForOneSource(repoAppDetails: models.RepoAppDetails | undefined, ind: number, src: models.ApplicationSource, detailsError?: Error): any {
+ function getEditablePanelForOneSource(repoAppDetails: models.RepoAppDetails | undefined, ind: number, src: models.ApplicationSource, detailsError?: Error, onRetry?: () => void): any {
let floatingTitle: string;
const lowerPanelAttributes: EditablePanelItem[] = [];
const upperPanelAttributes: EditablePanelItem[] = [];
@@ -520,7 +520,7 @@ export const ApplicationParameters = (props: {
return (
}
+ banner={}
saveTop={props.save}
saveBottom={
props.save &&
@@ -1152,14 +1152,29 @@ async function getSingleSource(app: models.Application): Promise
return {details: null};
}
-const SourceDetailsWarning = ({error}: {error?: Error}) =>
+const SourceDetailsWarning = ({error, onRetry}: {error?: Error; onRetry?: () => void}) =>
error ? (
{' '}
-
+ {' '}
+ {onRetry && (
+
+ )}
) : null;
+const SourceDetailsLoader = ({input, load, children}: {input: any; load: (input: any) => Promise; children: (result: SourceDetails, retry: () => void) => React.ReactNode}) => {
+ const [attempt, setAttempt] = React.useState(0);
+ const loaderInput = React.useMemo(() => ({input, attempt}), [input, attempt]);
+ return (
+ load(value)}>
+ {(result: SourceDetails) => children(result, () => setAttempt(current => current + 1))}
+
+ );
+};
+
function applyExplicitSourceType(source: models.ApplicationSource, details: models.RepoAppDetails): models.RepoAppDetails {
const explicitDetails = getExplicitSourceDetails(source);
if (!hasExplicitSourceType(source) || details.type === explicitDetails.type) {
From 333d026b2670c3e77ea650e4b451e5194162c239 Mon Sep 17 00:00:00 2001
From: Josue Barros
Date: Tue, 24 Nov 2026 13:04:22 -0300
Subject: [PATCH 2/3] style: format source retry component
Apply the repository Prettier layout so the UI lint job passes.
Assisted-by: opencode:deepseek-flash
Signed-off-by: Josue Barros
---
.../application-parameters.tsx | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/ui/src/app/applications/components/application-parameters/application-parameters.tsx b/ui/src/app/applications/components/application-parameters/application-parameters.tsx
index 1914446efde26..26af8a4453ea8 100644
--- a/ui/src/app/applications/components/application-parameters/application-parameters.tsx
+++ b/ui/src/app/applications/components/application-parameters/application-parameters.tsx
@@ -450,7 +450,13 @@ export const ApplicationParameters = (props: {
);
}
- function getEditablePanelForOneSource(repoAppDetails: models.RepoAppDetails | undefined, ind: number, src: models.ApplicationSource, detailsError?: Error, onRetry?: () => void): any {
+ function getEditablePanelForOneSource(
+ repoAppDetails: models.RepoAppDetails | undefined,
+ ind: number,
+ src: models.ApplicationSource,
+ detailsError?: Error,
+ onRetry?: () => void
+ ): any {
let floatingTitle: string;
const lowerPanelAttributes: EditablePanelItem[] = [];
const upperPanelAttributes: EditablePanelItem[] = [];
@@ -1165,7 +1171,15 @@ const SourceDetailsWarning = ({error, onRetry}: {error?: Error; onRetry?: () =>
) : null;
-const SourceDetailsLoader = ({input, load, children}: {input: any; load: (input: any) => Promise; children: (result: SourceDetails, retry: () => void) => React.ReactNode}) => {
+const SourceDetailsLoader = ({
+ input,
+ load,
+ children
+}: {
+ input: any;
+ load: (input: any) => Promise;
+ children: (result: SourceDetails, retry: () => void) => React.ReactNode;
+}) => {
const [attempt, setAttempt] = React.useState(0);
const loaderInput = React.useMemo(() => ({input, attempt}), [input, attempt]);
return (
From 9cbe5fe7c5a26c48c60f4b5a596c5701ca4ec245 Mon Sep 17 00:00:00 2001
From: Josue Barros
Date: Tue, 24 Nov 2026 13:59:43 -0300
Subject: [PATCH 3/3] fix(ui): harden source-details retry loading
Track pending requests, ignore stale responses, key requests only by the fields the loader reads, and disable Retry while the source panel is being edited.
Assisted-by: opencode:deepseek-flash
Signed-off-by: Josue Barros
---
.../application-parameters.tsx | 91 +++++++++++++------
1 file changed, 64 insertions(+), 27 deletions(-)
diff --git a/ui/src/app/applications/components/application-parameters/application-parameters.tsx b/ui/src/app/applications/components/application-parameters/application-parameters.tsx
index 26af8a4453ea8..798835946aac8 100644
--- a/ui/src/app/applications/components/application-parameters/application-parameters.tsx
+++ b/ui/src/app/applications/components/application-parameters/application-parameters.tsx
@@ -167,6 +167,7 @@ export const ApplicationParameters = (props: {
const [isAddingSource, setIsAddingSource] = React.useState(false);
const [isSavingSource, setIsSavingSource] = React.useState(false);
const [appParamsDeletedState, setAppParamsDeletedState] = React.useState([]);
+ const [sourceEditing, setSourceEditing] = React.useState(false);
if (app.spec.sources?.length > 0 && !props.details) {
// For multi-source case only
@@ -281,15 +282,18 @@ export const ApplicationParameters = (props: {
// For single source field, details page where we have to do the load to retrieve repo details
// Input changes frequently due to updates higher in the tree, do not show loading state when reloading
return (
- getSingleSource(application)}>
- {({details, error}: SourceDetails, retry) => {
+ getSingleSource(application)}>
+ {({details, error}: SourceDetails, retry, pending) => {
if (!details) {
return null;
}
const attr = gatherDetails(0, details, [], source, app, setRemovedOverrides, removedOverrides, appParamsDeletedState, setAppParamsDeletedState, false);
return (
<>
-
+
{getEditablePanel(attr, details)}
>
);
@@ -347,8 +351,11 @@ export const ApplicationParameters = (props: {
getSourceFromAppSources(src, app.metadata.name, app.spec.project, index, 0)}>
- {({details, error}: SourceDetails, retry) => getEditablePanelForOneSource(details, index, app.spec.sources[index], error, retry)}
+ {({details, error}: SourceDetails, retry, pending) =>
+ getEditablePanelForOneSource(details, index, app.spec.sources[index], error, retry, pending || sourceEditing)
+ }
)}
@@ -366,6 +373,12 @@ export const ApplicationParameters = (props: {
return (
{
+ setSourceEditing(current => !current);
+ if (repoAppDetails?.plugin) {
+ setAppParamsDeletedState([]);
+ }
+ }}
save={
props.save &&
(async (input: models.Application) => {
@@ -435,12 +448,6 @@ export const ApplicationParameters = (props: {
return errors;
}}
- onModeSwitch={
- repoAppDetails?.plugin &&
- (() => {
- setAppParamsDeletedState([]);
- })
- }
title={repoAppDetails?.type?.toLocaleUpperCase()}
items={items as EditablePanelItem[]}
noReadonlyMode={props.noReadonlyMode}
@@ -455,7 +462,8 @@ export const ApplicationParameters = (props: {
ind: number,
src: models.ApplicationSource,
detailsError?: Error,
- onRetry?: () => void
+ onRetry?: () => void,
+ retryDisabled = false
): any {
let floatingTitle: string;
const lowerPanelAttributes: EditablePanelItem[] = [];
@@ -526,7 +534,13 @@ export const ApplicationParameters = (props: {
return (
}
+ banner={}
+ onModeSwitch={() => {
+ setSourceEditing(current => !current);
+ if (repoAppDetails?.plugin) {
+ setAppParamsDeletedState([]);
+ }
+ }}
saveTop={props.save}
saveBottom={
props.save &&
@@ -602,12 +616,6 @@ export const ApplicationParameters = (props: {
return errors;
}}
- onModeSwitch={
- repoAppDetails?.plugin &&
- (() => {
- setAppParamsDeletedState([]);
- })
- }
titleBottom={repoAppDetails?.type?.toLocaleUpperCase()}
titleTop={'SOURCE ' + (ind + 1)}
floatingTitle={floatingTitle ? floatingTitle : null}
@@ -1158,13 +1166,13 @@ async function getSingleSource(app: models.Application): Promise
return {details: null};
}
-const SourceDetailsWarning = ({error, onRetry}: {error?: Error; onRetry?: () => void}) =>
+const SourceDetailsWarning = ({error, onRetry, disabled}: {error?: Error; onRetry?: () => void; disabled?: boolean}) =>
error ? (
{' '}
{' '}
{onRetry && (
-