Skip to content

PLU-743: [IF-THEN-THEN-V2-17] Deprecate branch name - #2002

Merged
ogp-weeloong merged 1 commit into
feat/if-then-then-real/fe-variable-scopingfrom
feat/if-then-then-real/fe-deprecate-branch-name
Aug 28, 2026
Merged

PLU-743: [IF-THEN-THEN-V2-17] Deprecate branch name#2002
ogp-weeloong merged 1 commit into
feat/if-then-then-real/fe-variable-scopingfrom
feat/if-then-then-real/fe-deprecate-branch-name

Conversation

@ogp-weeloong

@ogp-weeloong ogp-weeloong commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Context

We are enabling steps to be inserted after If-thens. The main changes:

  1. Introduce a endStepId marker in each if-then step, so that we know when the conditional steps end.
    1. The region between an If-Then action and its end step is called a "block".
    2. For empty blocks, the endStepId is set to the if-then's step ID.
  2. Abandon the branch concept because its extra complexity.

Important

Important

This new If-Then is called If-Then V2 in the codebase; we don't want to make a big bang change.

This PR

Deprecates the branchName parameter for If-Then V2. High level approach:

  1. Make branchName an optional param (we expect to move people to V2 ASAP so this shouldn't be too big of a problem)
  2. Add an edge case to argsToDisplay to hide branch name - this is bad (tm) but I'll clean it up once v2 is rolled out fully.

Edge case: a branch might have both step name and branch name. In this case, we display it as ${branchName} (${customStepName}).

Tests

This is the top stack in the PR, so here are the tests:

With LD flag OFF

  • Check that published legacy pipes' If-Then still work.
  • Check that I cannot add If-Then in an If-Then
  • Check that I cannot add For-Each in an If-Then.
  • [Legacy pipe] Check that I can only add If-Then at the end of a pipe without For-Each
  • [Legacy pipe] Check that I can only add If-Then at the end of For-Each, in a pipe with For-each
  • [Legacy pipe] Check that I cannot add steps after If-then.
  • [Legacy pipe] Check that I cannot add steps after If-then when the If-Then is in a For-each.
  • [Legacy pipe] Check that when I create a new If-Then branch in a legacy pipe with existing If-Then, stepIdToJumpTo is not populated
  • [Legacy pipe] Check that when I create a new If-Then block in a pipe without existing If-then, stepIdToJumpTo is not populated.
  • [Legacy pipe] Check that I can re-order branches within an If-Then block, and the new step order is respected when the pipe runs
  • [Legacy pipe] Check that I can re-order steps outside the If-Then block, and the new step order is respected when the pipe runs

With LD flag ON

  • Check that all If-Thens (>=1 block) in published pipe work.
  • Check that I cannot add If-Then in an If-Then.
  • Check that I cannot add For-Each in an If-Then.
  • Check that I can add steps after If-Then
  • Check that I can add steps after an If-Then located in a For-Each
  • Check that I can add If-Then in the middle of a pipe.
  • Check that I can add If-Then in the middle of a For-Each
  • Check that when I create a new If-Then block in a pipe without any If-Then, stepIdToJumpTo is populated.
  • Check that when I create a new If-Then block in a For-Each in a pipe without any If-Then, stepIdToJumpTo is populated.
  • Check that I can re-order steps outside If-Then (both before and after), and the new step order is respected when the pipe runs
  • Check that I can re-order steps outside If-Then (both before and after) within a For-Each, and the new step order is respected when the pipe runs
  • [Legacy -> new] Check that I can add steps after an If-Then when the pipe has a legacy If-then (i.e. no stepIdToJumpTo), and that the added steps run outside of the If-Then conditional
  • [Legacy -> new] Check that I can add steps after an If-Then in a For-Each when the pipe has a legacy If-then (i.e. no stepIdToJumpTo), and that the added steps run outside of the If-Then conditional

ogp-weeloong commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@ogp-weeloong ogp-weeloong changed the title feat(editor): deprecate if-then branchName for V2, combine into stepName for leftover V1 PLU-743: [IF-THEN-THEN-V2-17] Deprecate branch name Aug 17, 2026
@linear-code

linear-code Bot commented Aug 17, 2026

Copy link
Copy Markdown

PLU-743

@ogp-weeloong
ogp-weeloong requested a review from a team August 17, 2026 07:31
@ogp-weeloong
ogp-weeloong marked this pull request as ready for review August 17, 2026 07:44
@ogp-weeloong
ogp-weeloong force-pushed the feat/if-then-then-real/fe-deprecate-branch-name branch from 38dffaa to 4a91d4d Compare August 25, 2026 11:09
@kevinkim-ogp

Copy link
Copy Markdown
Contributor

Code review

Found 2 issues:

  1. New fallback string "If-then Branch" is inconsistent with the standardized "If-then" default introduced by this same PR (CLAUDE.md says "ONE TERM PER ENTITY: Do not rotate synonyms. Pick one standard name for an object or concept and use it consistently")

Branch.tsx now falls back to 'If-then Branch' for an unnamed branch, while getStepName.ts in the same PR standardizes the fallback everywhere else (drawer title, block header) to 'If-then'. A user with an unnamed if-then step will see two different labels for the same concept.

<Text
textStyle="subhead-1"
color="base.content.default"
noOfLines={1}
>
{(branchSteps[0].parameters.branchName as string) ||
'If-then Branch'}
</Text>

return {
stepName: customStepName || 'If-then',
defaultStepName: 'If-then',
}

  1. New comment restates the code's own branching logic instead of stating only the non-obvious reason (CLAUDE.md says "ONE WHY PER COMMENT: State the single non-obvious reason the code exists or behaves this way. Do not also trace the code's internal branching or filtering logic in prose. That is still WHAT, even when framed as justification")

The third line ("we combine them if thats the case") just narrates the if condition and combination logic directly below it.

// Edge case: If-then V2 is enabled and viewer is looking at a V1 if-then.
// V1 if-thens may have both stepname and branch names - we combine them if
// thats the case.
if (!isV2 && isIfThenV2Enabled && branchName) {

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@kevinkim-ogp kevinkim-ogp left a comment

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.

lgtm, tested works! few things to clarify:

  • branch/step name:
    • should we update the stepName tobranchName for all branches when upgrading from v1 to v2? feels like better UX than to only have some updated and some not
    • small thing: focusing on the step name, then hitting enter without typing anything causes us to end up with Branch 1 (Branch 1)(assuming that 'Branch 1' is the original branch name)
    • feels a little odd to type a new step name -> save -> see the name as branchName (newStepName) (might not be worth it to fix if complex logic is needed)
  • small ordering thing with MRF
    • if there are no actions between MRF step 1 and MRF step 2 -> cannot draft the if-then in between
    • add an action between MRF step 1 and MRF step 2 -> can drag if-then inside
  • removing MRF steps
    • deleting MRF steps deletes other actions that are below the MRF workflow steps, is this intended?
  • we might also want to update the templates to immediately adopt v2?

@ogp-weeloong
ogp-weeloong force-pushed the feat/if-then-then-real/fe-deprecate-branch-name branch from 4a91d4d to e5d7edf Compare August 27, 2026 05:32
@ogp-weeloong
ogp-weeloong force-pushed the feat/if-then-then-real/fe-deprecate-branch-name branch from e5d7edf to efc791b Compare August 27, 2026 13:29
…ame for leftover V1

Hides Branch Name once the owner's V2 flag is on, makes it optional
backend-side, folds it into leftover V1 steps' name, and fixes an emptied
custom name rendering blank (default renamed to "If-then").

# Conflicts:
#	packages/frontend/src/components/FlowSubstep/index.tsx
@ogp-weeloong
ogp-weeloong force-pushed the feat/if-then-then-real/fe-deprecate-branch-name branch from efc791b to 554294e Compare August 27, 2026 15:53
@ogp-weeloong
ogp-weeloong merged commit 3376abf into feat/if-then-then-real/trunk Aug 28, 2026
5 checks passed
@ogp-weeloong
ogp-weeloong deleted the feat/if-then-then-real/fe-deprecate-branch-name branch August 28, 2026 01:49
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