Skip to content

Commit

Permalink
export some menu actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tek committed Oct 6, 2023
1 parent 19e85eb commit 67529f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
3 changes: 3 additions & 0 deletions packages/menu/lib/Ribosome/Menu.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ import Ribosome.Menu.Action (
menuToggle,
menuToggleAll,
menuUpdatePrompt,
menuUpdatePromptState,
menuAttachPrompt,
menuDetachPrompt,
)
import Ribosome.Menu.App (MenuApp, PromptApp, builtinHandlers, defaultHandlers, insert, promptControl, withInsert)
import Ribosome.Menu.Data.Entry (Entries, Entry)
Expand Down
11 changes: 1 addition & 10 deletions packages/menu/lib/Ribosome/Menu/Loop.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import qualified Log
import qualified Streamly.Prelude as Stream
import Streamly.Prelude (SerialT)

import Ribosome.Data.Mapping (MappingLhs (MappingLhs), MappingSpec)
import Ribosome.Data.Mapping (MappingLhs, MappingSpec)
import Ribosome.Host.Data.RpcError (RpcError)
import Ribosome.Menu.Action (MenuActionSem)
import qualified Ribosome.Menu.App
Expand Down Expand Up @@ -69,15 +69,6 @@ menuAction = \case
MenuAction.Quit result ->
pure (PromptAction.Quit result)

mappingResult ::
Members [MenuCore, Reader PromptState, Log] r =>
MappingLhs ->
MenuAction result ->
Sem r (PromptAction (MenuResult result))
mappingResult (MappingLhs trigger) action = do
Log.debug [exon|menu mapping #{trigger}: #{MenuAction.describe action}|]
menuAction action

handleMapping ::
Members [MenuCore, Reader PromptState, Log] r =>
(InputParams -> Maybe (MenuActionSem r result)) ->
Expand Down

0 comments on commit 67529f6

Please sign in to comment.