This repository was archived by the owner on Jul 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 374
feature: implement new ProjectTree design with popout menus #4361
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
7595021
Update en-US.json
beyackle 78c3f7a
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
beyackle e0576b5
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
beyackle e6c088d
bring in stuff from the draft branch
beyackle 49d7ce0
make deletion work
beyackle 73b657e
Merge branch 'main' into beyackle/botProjectTreeOnly
beyackle 9fa39e9
add error/warning icons
beyackle 28c4baf
Merge branch 'main' into beyackle/botProjectTreeOnly
beyackle e49078c
Merge branch 'beyackle/botProjectTreeOnly' of https://github.com/micr…
beyackle bdb21db
Merge branch 'main' into beyackle/botProjectTreeOnly
beyackle 28fcadf
read notification map for state
beyackle ca31c22
Merge branch 'beyackle/botProjectTreeOnly' of https://github.com/micr…
beyackle 34d6415
fix type-checking and start on unit tests
beyackle 9cee86c
add sampleDialog and fix more tests
beyackle ea7ced6
add showAll
beyackle 7a4fa20
rename to onAllSelected because it's a callback
beyackle 69ddaa3
update unit tests
beyackle fa557ef
Merge branch 'main' into beyackle/botProjectTreeOnly
beyackle ebf8450
fix onSelect handling in ProjectTree
beyackle ad66423
Update qna.test.tsx
beyackle 48ab9bf
Merge branch 'main' into beyackle/botProjectTreeOnly
beyackle 76bee68
Update design.test.tsx
beyackle b877aca
add unit test
beyackle 762b2b5
Merge branch 'main' into beyackle/botProjectTreeOnly
beyackle 463870a
Merge branch 'main' into beyackle/botProjectTreeOnly
beyackle 014a094
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
beyackle 89caba3
Merge branch 'main' into beyackle/botProjectTreeOnly
beyackle a02da9b
fixes from PR comments
beyackle 0a20716
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
beyackle d00c42d
Merge branch 'main' into beyackle/botProjectTreeOnly
beyackle 90c92d0
Merge branch 'main' into beyackle/botProjectTreeOnly
cwhitten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| // This is a copy of the JSON that defines the EchoBot sample plus some | ||
| // additional dialogs and triggers, including a trigger with a syntax | ||
| // error for use with testing error messages. | ||
|
|
||
| export const SAMPLE_DIALOG = { | ||
| isRoot: true, | ||
| displayName: 'EchoBot-1', | ||
| id: 'echobot-1', | ||
| content: { | ||
| $kind: 'Microsoft.AdaptiveDialog', | ||
| $designer: { id: '433224', description: '', name: 'EchoBot-1' }, | ||
| autoEndDialog: true, | ||
| defaultResultProperty: 'dialog.result', | ||
| triggers: [ | ||
| { | ||
| $kind: 'Microsoft.OnUnknownIntent', | ||
| $designer: { id: '821845' }, | ||
| actions: [ | ||
| { $kind: 'Microsoft.SendActivity', $designer: { id: '003038' }, activity: '${SendActivity_003038()}' }, | ||
| ], | ||
| }, | ||
| { | ||
| $kind: 'Microsoft.OnConversationUpdateActivity', | ||
| $designer: { id: '376720' }, | ||
| actions: [ | ||
| { | ||
| $kind: 'Microsoft.Foreach', | ||
| $designer: { id: '518944', name: 'Loop: for each item' }, | ||
| itemsProperty: 'turn.Activity.membersAdded', | ||
| actions: [ | ||
| { | ||
| $kind: 'Microsoft.IfCondition', | ||
| $designer: { id: '641773', name: 'Branch: if/else' }, | ||
| condition: 'string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)', | ||
| actions: [ | ||
| { | ||
| $kind: 'Microsoft.SendActivity', | ||
| $designer: { id: '859266', name: 'Send a response' }, | ||
| activity: '${SendActivity_Welcome()}', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| { $kind: 'Microsoft.OnError', $designer: { id: 'XVSGCI' } }, | ||
| { | ||
| $kind: 'Microsoft.OnIntent', | ||
| $designer: { id: 'QIgTMy', name: 'more errors' }, | ||
| intent: 'test', | ||
| actions: [{ $kind: 'Microsoft.SetProperty', $designer: { id: 'VyWC7G' }, value: '=[' }], | ||
| }, | ||
| ], | ||
| generator: 'echobot-1.lg', | ||
| $schema: | ||
| 'https://raw.githubusercontent.com/microsoft/BotFramework-Composer/stable/Composer/packages/server/schemas/sdk.schema', | ||
| id: 'EchoBot-1', | ||
| recognizer: 'echobot-1.lu.qna', | ||
| }, | ||
| diagnostics: [ | ||
| { | ||
| message: | ||
| "must be an expression: syntax error at line 1:1 mismatched input '<EOF>' expecting {STRING_INTERPOLATION_START, '+', '-', '!', '(', '[', ']', '{', NUMBER, IDENTIFIER, STRING}", | ||
| source: 'echobot-1', | ||
| severity: 0, | ||
| path: 'echobot-1.triggers[3].actions[0]#Microsoft.SetProperty#value', | ||
| }, | ||
| ], | ||
| referredDialogs: [], | ||
| lgTemplates: [ | ||
| { name: 'SendActivity_003038', path: 'echobot-1.triggers[0].actions[0]' }, | ||
| { name: 'SendActivity_Welcome', path: 'echobot-1.triggers[1].actions[0].actions[0].actions[0]' }, | ||
| ], | ||
| referredLuIntents: [{ name: 'test', path: 'echobot-1.triggers[3]#Microsoft.OnIntent' }], | ||
| luFile: 'echobot-1', | ||
| qnaFile: 'echobot-1', | ||
| lgFile: 'echobot-1', | ||
| triggers: [ | ||
| { id: 'triggers[0]', displayName: '', type: 'Microsoft.OnUnknownIntent', isIntent: false }, | ||
| { id: 'triggers[1]', displayName: '', type: 'Microsoft.OnConversationUpdateActivity', isIntent: false }, | ||
| { id: 'triggers[2]', displayName: '', type: 'Microsoft.OnError', isIntent: false }, | ||
| { id: 'triggers[3]', displayName: 'more errors', type: 'Microsoft.OnIntent', isIntent: true }, | ||
| ], | ||
| intentTriggers: [ | ||
| { intent: 'test', dialogs: [] }, | ||
| { intent: 'test', dialogs: [] }, | ||
| ], | ||
| skills: [], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
Composer/packages/client/src/components/ProjectTree/ExpandableNode.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| /** @jsx jsx */ | ||
| import { jsx, css } from '@emotion/core'; | ||
| import { useState, MouseEvent, KeyboardEvent } from 'react'; | ||
|
|
||
| type Props = { | ||
| children: React.ReactNode; | ||
| summary: React.ReactNode; | ||
| depth?: number; | ||
| detailsRef?: (el: HTMLElement | null) => void; | ||
| }; | ||
|
|
||
| const summaryStyle = css` | ||
| label: summary; | ||
| display: flex; | ||
| padding-left: 12px; | ||
| padding-top: 6px; | ||
| `; | ||
|
|
||
| const nodeStyle = (depth: number) => css` | ||
| margin-left: ${depth * 16}px; | ||
| `; | ||
|
|
||
| export const ExpandableNode = ({ children, summary, detailsRef, depth = 0 }: Props) => { | ||
| const [isExpanded, setExpanded] = useState(true); | ||
|
|
||
| function handleClick(ev: MouseEvent) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't the event type: React.MouseEvent<HTMLElement, MouseEvent>
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not according to TypeScript. That's a standard HTML tag, and following the chain of type declarations that VSCode gives me leads to this line in the TS lib:
|
||
| if ((ev.target as Element)?.tagName.toLowerCase() === 'summary') { | ||
| setExpanded(!isExpanded); | ||
| } | ||
| ev.preventDefault(); | ||
| } | ||
|
|
||
| function handleKey(ev: KeyboardEvent) { | ||
| if (ev.key === 'Enter' || ev.key === 'Space') setExpanded(!isExpanded); | ||
| } | ||
|
|
||
| return ( | ||
| <div css={nodeStyle(depth)} data-testid="dialog"> | ||
| <details ref={detailsRef} open={isExpanded}> | ||
| {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-noninteractive-tabindex */} | ||
| <summary css={summaryStyle} role="button" tabIndex={0} onClick={handleClick} onKeyUp={handleKey}> | ||
| {summary} | ||
| </summary> | ||
| {children} | ||
| </details> | ||
| </div> | ||
| ); | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.