Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide errors from input nodes #9633

Merged
merged 5 commits into from
Apr 5, 2024
Merged

Hide errors from input nodes #9633

merged 5 commits into from
Apr 5, 2024

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Apr 4, 2024

Pull Request Description

When a node has an error/warning/panic that exactly matches one of its input nodes, hide the message until the node is interacted with, showing an icon.

hiding-errors.mov

Important Notes

  • New icon is used for panics.
  • Opening circular menu now shifts any message out of the way, not just warnings.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@kazcw kazcw self-assigned this Apr 4, 2024
@kazcw kazcw linked an issue Apr 4, 2024 that may be closed by this pull request
@kazcw kazcw added the CI: No changelog needed Do not require a changelog entry for this PR. label Apr 4, 2024
…ed-errors

# Conflicts:
#	app/gui2/src/components/GraphEditor/GraphNode.vue
Comment on lines 12 to 28
type MessageType = 'error' | 'warning' | 'panic'
/** The type of a message. */
export class GraphNodeMessageType {
private constructor(private readonly type: MessageType) {}

static Error: GraphNodeMessageType = new GraphNodeMessageType('error')
static Warning: GraphNodeMessageType = new GraphNodeMessageType('warning')
static Panic: GraphNodeMessageType = new GraphNodeMessageType('panic')

get iconName() {
return iconForMessageType[this.type]
}

const iconForType: Record<GraphNodeMessageType, Icon | undefined> = {
get cssColor() {
return colorForMessageType[this.type]
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we actually need a separate class for it? I would stay with just MessageType and exported constants below.

app/gui2/src/stores/graph/graphDatabase.ts Outdated Show resolved Hide resolved
@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label Apr 5, 2024
@mergify mergify bot merged commit 5f46438 into develop Apr 5, 2024
34 of 35 checks passed
@mergify mergify bot deleted the wip/kw/hide-repeated-errors branch April 5, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an icon for Error and Panic when shown on a Component
2 participants