Skip to content

Enhance flow handling by integrating forwards dynamically#587

Open
stijnpotters1 wants to merge 4 commits into
masterfrom
fix/dynamic-forwards
Open

Enhance flow handling by integrating forwards dynamically#587
stijnpotters1 wants to merge 4 commits into
masterfrom
fix/dynamic-forwards

Conversation

@stijnpotters1

@stijnpotters1 stijnpotters1 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Now i have made logic to make different colors for each handle type.
The thing is that we could reuse the colour logic of #536 here as well. But this needs to be merged first
image
image

@stijnpotters1 stijnpotters1 self-assigned this Jun 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

@stijnpotters1 stijnpotters1 linked an issue Jun 30, 2026 that may be closed by this pull request
function colourFromName(type: string): string {
let hash = 0
for (const character of type) {
hash = (hash * 31 + (character.codePointAt(0) ?? 0)) % (360 - GREEN_BAND_SIZE)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So why a base value of 31?
I remember seeing this done before and I questioned it back then too, making it a const and having a descriptive name would help a lot

Comment on lines +19 to +21
if (element?.labels?.EIP === 'Router') return forwards

return { success: {}, ...forwards }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why add the success forward for all other elements?
If inheritance is handled correctly then every element that inherits from FixedForwardPipe should have the sucess forward which is defined on there

return { success: {}, ...forwards }
}

export function getDefaultSourceHandles(resolvedForwards: Record<string, ElementProperty> | undefined): SourceHandle[] {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
export function getDefaultSourceHandles(resolvedForwards: Record<string, ElementProperty> | undefined): SourceHandle[] {
export function getDefaultSourceHandles(resolvedForwards?: Record<string, ElementProperty>): SourceHandle[] {

@philipsens

Copy link
Copy Markdown
Member

The border is a bit weird. Can you fix that?
image

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.

Gather the right forwards from the FrankDoc.json

3 participants