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

also run handleInfoPanelEvent for dialogs other than GoalModal #1071

Merged
merged 2 commits into from
Jan 31, 2023
Merged
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
2 changes: 1 addition & 1 deletion src/Swarm/TUI/Controller.hs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ handleModalEvent = \case
uiState . uiGoal . listWidget .= newList
GoalSummary -> handleInfoPanelEvent modalScroll (VtyEvent ev)
_ -> handleInfoPanelEvent modalScroll (VtyEvent ev)
_ -> return ()
_ -> handleInfoPanelEvent modalScroll (VtyEvent ev)
Copy link
Member

Choose a reason for hiding this comment

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

I almost wish we returned EventM Name AppState Bool to indicate whether the event was handled or fell through.

Then the top handler would know to call the next handler that might be interested.

Copy link
Member Author

Choose a reason for hiding this comment

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

A Bool doesn't really sound like it would help that much, it would just be one more thing to get wrong...

What we should REALLY do is have an effect system for tracking a type-level list of unhandled events! 😜

where
refreshList lw = nestEventM' lw $ handleListEventWithSeparators ev isHeader

Expand Down