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

add smartPicker for file embeddings #108

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

grnd-alt
Copy link
Member

@grnd-alt grnd-alt commented Aug 7, 2024

resolves: #74

smart picker button top right (same icon as in text from material design)

image

open smart picker selecting files

image

multiple file embeddings added via smart picker

image

@grnd-alt grnd-alt linked an issue Aug 7, 2024 that may be closed by this pull request
@juliushaertl
Copy link
Member

juliushaertl commented Aug 7, 2024

  • Are we somehow able to inject this into the main menubar? Otherwise maybe not for this PR, but would we we able to build our own menubar instead?
  • Let's call the button Smart Picker which is the name that is used across apps

Edit: Removed the other comment as i missed the smart picker part from the screenshots, but the code makes it clear

@juliushaertl
Copy link
Member

Looks great otherwise 👍

Signed-off-by: grnd-alt <salimbelakkaf@outlook.de>
@grnd-alt grnd-alt force-pushed the feat/74-smart-picker-for-inserting-embeddings branch from b3b681d to d874915 Compare August 8, 2024 09:17
@grnd-alt
Copy link
Member Author

grnd-alt commented Aug 8, 2024

@juliushaertl I've hacked it a little bit so the button is in the tool bar. It is not supported by the lib to add custom elements to that bar. It is though, also required by some other people: excalidraw/excalidraw#7583
so we could think about an upstream contribution, or also do our own toolbar, seems other people have already done it as well. Don't know if it's a good idea to keep my hacked version. Also Excalidraw uses the same Icon for their 'more tools' button as we do for our smart picker button, which we should probably do something about

@@ -72,6 +76,16 @@ export default function App({ fileId, isEmbedded, fileName }: WhiteboardAppProps

if (excalidrawAPI && !collab) setCollab(new Collab(excalidrawAPI, fileId))
if (collab && !collab.portal.socket) collab.startCollab()
useEffect(() => {
const extraTools = document.getElementsByClassName('App-toolbar__extra-tools-trigger')[0]
const smartPick = document.createElement('label')
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a tooltip as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Tooltip already exists for me because of the title attribute in renderSmartPicker on line 188

src/App.tsx Outdated Show resolved Hide resolved
src/App.tsx Outdated Show resolved Hide resolved
src/App.tsx Outdated Show resolved Hide resolved
Copy link
Member

@juliushaertl juliushaertl left a comment

Choose a reason for hiding this comment

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

Very nice, works well, just had a few more polishing comments :)

Signed-off-by: grnd-alt <salimbelakkaf@outlook.de>
@grnd-alt grnd-alt force-pushed the feat/74-smart-picker-for-inserting-embeddings branch from d874915 to a4160d4 Compare August 19, 2024 08:26
@juliushaertl juliushaertl merged commit 0a37e9b into main Aug 19, 2024
23 checks passed
@juliushaertl juliushaertl deleted the feat/74-smart-picker-for-inserting-embeddings branch August 19, 2024 08:51
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.

Smart picker for inserting embeddings
2 participants