Skip to content

feat(ui): add option to open document in a new tab from drawer #12036

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tak-amboss
Copy link
Contributor

What?

Adds an option to open the current document in a new tab when opened in a drawer.

Why?

There is currently no direct way to open a document when opened in a drawer. However, sometimes editors want to edit one or multiple documents from relationships independently of the current edit view and need an easy option to open these separately.

How?

Converts the document id to a link if in drawer context.

image

@JarrodMFlesch
Copy link
Contributor

Hey thanks for this! My only concern is that this only works for ID's and not useAsTitle titles. For that you would need to adjust the RenderTitle component. But I am wondering if just having an external link icon (which I think we already have) that users can click would be easier. @tylandavis what do you think?

@tylandavis
Copy link
Member

My only concern is that this only works for ID's and not useAsTitle titles.

I believe inside a drawer, we always render the ID: 96776asd9876asdf9asdf component regardless of useAsTitle (the example above does) as well as custom IDs, so I think turning this into a clickable link is a good move as it doesn't add extra components to the view.

A couple UX things that come to my mind:

  • If I made edits and then click the link to open in a new tab, what happens to my edits?
    • Could probably show the unsaved changes modal.
  • When opening a new tab, should the drawer close? I don't know that it would be good to have the related document's form open in two places.

@tak-amboss
Copy link
Contributor Author

If I made edits and then click the link to open in a new tab, what happens to my edits?

  • Could probably show the unsaved changes modal.

The leave page modal in general doesn't show if a link is opened in a new tab, because you're technically not leaving the page. So if you open it in a new tab, you will then still have the option to either continue editing / saving or closing the drawer which would then trigger the leave page modal as currently.

When opening a new tab, should the drawer close? I don't know that it would be good to have the related document's form open in two places.

I personally don't think a link which opens in a new tab should have additional side effects. A "close drawer and open in new tab"-action would IMO be a different thing.

@tak-amboss tak-amboss force-pushed the feat-open-in-new-tab-link branch from 6fabec2 to 2de5f8c Compare April 15, 2025 08:06
@tak-amboss tak-amboss force-pushed the feat-open-in-new-tab-link branch 2 times, most recently from bbf97e6 to bd98758 Compare April 15, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants