Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export default function Page() {

const isLoading =
navigation.state !== "idle" &&
navigation.formMethod === "post" &&
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "create";

const [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ function DeleteAlertChannelButton(props: { id: string }) {

const isLoading =
navigation.state !== "idle" &&
navigation.formMethod === "post" &&
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "delete";

const [form] = useForm({
Expand Down Expand Up @@ -422,7 +422,7 @@ function DisableAlertChannelButton(props: { id: string }) {

const isLoading =
navigation.state !== "idle" &&
navigation.formMethod === "post" &&
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "delete";
Comment on lines +425 to 426

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Disable-alert button never shows its loading indicator

The loading-state check looks for the action value "delete" (navigation.formData?.get("action") === "delete" at apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx:426) but the button actually submits "disable" (line 444), so the condition is never true and the button text stays as "Disable" instead of changing to "Disabling" during submission.

Impact: Users get no visual feedback that the disable action is in progress.

Action value mismatch inherited from copy-paste of DeleteAlertChannelButton

The DisableAlertChannelButton component's isLoading expression was copy-pasted from DeleteAlertChannelButton at apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx:384-387, which correctly checks for "delete". The value was never updated to "disable" to match the button at line 444:

<Button name="action" value="disable" ...>
  {isLoading ? "Disabling" : "Disable"}
</Button>

Before this PR, the bug was masked because formMethod === "post" (lowercase) never matched Remix v2's uppercase "POST", making isLoading always false for a different reason. Now that the PR correctly uses "POST", this action-value mismatch becomes the sole reason isLoading is broken.

Suggested change
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "delete";
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "disable";
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


const [form] = useForm({
Expand Down Expand Up @@ -462,7 +462,7 @@ function EnableAlertChannelButton(props: { id: string }) {

const isLoading =
navigation.state !== "idle" &&
navigation.formMethod === "post" &&
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "delete";
Comment on lines +465 to 466

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Enable-alert button never shows its loading indicator

The loading-state check looks for the action value "delete" (navigation.formData?.get("action") === "delete" at apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx:466) but the button actually submits "enable" (line 484), so the condition is never true and the button text stays as "Enable" instead of changing to "Enabling" during submission.

Impact: Users get no visual feedback that the enable action is in progress.

Action value mismatch inherited from copy-paste of DeleteAlertChannelButton

The EnableAlertChannelButton component's isLoading expression was copy-pasted from DeleteAlertChannelButton at apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx:384-387, which correctly checks for "delete". The value was never updated to "enable" to match the button at line 484:

<Button name="action" value="enable" ...>
  {isLoading ? "Enabling" : "Enable"}
</Button>

Before this PR, the bug was masked because formMethod === "post" (lowercase) never matched Remix v2's uppercase "POST", making isLoading always false for a different reason. Now that the PR correctly uses "POST", this action-value mismatch becomes the sole reason isLoading is broken.

Suggested change
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "delete";
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "enable";
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


const [form] = useForm({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ function RenameDashboardDialog({ title }: { title: string }) {

const isRenaming =
navigation.state !== "idle" &&
navigation.formMethod === "post" &&
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "rename";

// Close dialog when navigation completes
Expand Down Expand Up @@ -724,7 +724,7 @@ function DeleteDashboardDialog({ title }: { title: string }) {

const isDeleting =
navigation.state !== "idle" &&
navigation.formMethod === "post" &&
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "delete";

// Close dialog when navigation completes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export default function Page() {
const selectedEnvironments = environments.filter((env) => selectedEnvironmentIds.has(env.id));
const previewIsSelected = selectedEnvironments.some((env) => env.type === "PREVIEW");

const isLoading = navigation.state !== "idle" && navigation.formMethod === "post";
const isLoading = navigation.state !== "idle" && navigation.formMethod === "POST";

const [form, fields] = useForm<z.infer<typeof schema>>({
id: "create-environment-variables",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ function DeleteEnvironmentVariableButton({

const isLoading =
navigation.state !== "idle" &&
navigation.formMethod === "post" &&
navigation.formMethod === "POST" &&
navigation.formData?.get("action") === "delete";

const [form] = useForm({
Expand Down