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

✨ Nextcloud-wide mechanism to translate, lengthen text, make more serious, etc. #39478

Closed
julien-nc opened this issue Jul 19, 2023 · 6 comments

Comments

@julien-nc
Copy link
Member

As an extension to the new text processing OCP API (#38854), we would like to implement a frontend component using this API. It would allow apps to push text content to a UI element that would then let users choose a task to perform. The result would be passed back to the app's frontend.

The event bus could be used to let apps communication with this widget.

@julien-nc julien-nc added this to the Nextcloud 27.1.0 milestone Jul 19, 2023
@julien-nc julien-nc self-assigned this Jul 19, 2023
@jancborchardt jancborchardt changed the title Text processing widget Nextcloud-wide mechanism to mark text → show menu to translate, lengthen text, make more serious, etc. Jul 19, 2023
@jancborchardt jancborchardt changed the title Nextcloud-wide mechanism to mark text → show menu to translate, lengthen text, make more serious, etc. ✨ Nextcloud-wide mechanism to mark text → show menu to translate, lengthen text, make more serious, etc. Jul 19, 2023
@nimishavijay
Copy link
Member

High level specs and mockups:

  • entry
    • depends on the downstream app (placement of text processing button)
    • AND top right corner text processing button
    • AND smart picker
  • click on entry point button
    • choose action in an action menu --> open text processing component
    • OR directly open the text processing component with no action selected
  • text processing component
    • MVP: modal
  • inside the modal
    • Nextcloud assistant chip
    • dropdown with the different actions
    • heading/title
    • description (optional)
    • input text (taken from whatever text is selected in downstream app, editable)
    • submit button
  • on submit
    • synchronous or async
    • synchronous: do not exit the text processing component until processing is finished, show loading status
      • if processing is taking too long
        • in loading state buttons to run in bg, indicate notification will be received
      • after processing
      • output (editable)
      • insert/replace or copy buttons
    • asynchronous: exit the TP component during processing, notify that result will be available after completion
    • after processing
    • show notification after TP is completed with a button to show results
    • clicking on button opens TP component with input, output and copy button

General idea:

image

Modal specifics:

Entry Summarizing Done
image image image
  • nice to haves
    • floating TP component
    • sidebar TP component
    • options for each action
    • additional contextual data for each TP action (like name of conversation in Talk, name of text file, etc)
    • top right history

@julien-nc
Copy link
Member Author

Some news:

Since the tasks are most likely long, only the async workflow has been implemented yet.

Workflow when using the header menu button:

vokoscreenNG-2023-08-07_12-08-58.mp4

Opening the assistant from another app:

vokoscreenNG-2023-08-07_12-19-30.mp4

Here is the page showing the results when the notification is clicked on a mobile/desktop client (that can't display the modal):
image

If an app opens the assistant, it gives it some extra info (appId and task identifier) so that when the task finishes, the assistant lets the app decide if the assistant should produce a notification and if the notification should show the "classic" result modal/page or if it should have a custom link target.

TODO:

  • improve the notification title/message
  • add a "discard" button in the result modal (what should it do?)

@nimishavijay
Copy link
Member

Reference for the "button style" selector:

image

Also super tiny detail that I just noticed: When the result is copied, the color of the icon doesn't need to change to green, it can stay white so that we don't have any accessibility contrast issues :)

@marcelklehr
Copy link
Member

I feel like the current logo for the assistant is sort of non-descript, what do you think about using this one instead? https://pictogrammers.com/library/mdi/icon/assistant/

@nimishavijay
Copy link
Member

@jancborchardt what do you think about that icon? since it has to do with branding as well? :)

@jancborchardt jancborchardt changed the title ✨ Nextcloud-wide mechanism to mark text → show menu to translate, lengthen text, make more serious, etc. ✨ Nextcloud-wide mechanism to translate, lengthen text, make more serious, etc. Jan 17, 2024
@jancborchardt
Copy link
Member

Closing this as it has been done and is shipped already. :) Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

6 participants