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

feature(fe2): View mode FE integration #3651

Merged
merged 35 commits into from
Dec 12, 2024

Conversation

andrewwallacespeckle
Copy link
Contributor

Description & motivation

Changes:

To-do before merge:

Screenshots:

Validation of changes:

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

Copy link

linear bot commented Dec 6, 2024

const handler = handlers[shortcut.action as ViewerShortcutAction]
if (handler) {
onKeyboardShortcut([...shortcut.modifiers], shortcut.key, () => {
if (!isTypingComment.value) handler()
Copy link
Contributor

Choose a reason for hiding this comment

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

@andrewwallacespeckle I guess this will not block shortcuts when typing elsewhere (feedback modal, filter input etc?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, will double check and test this. Will leave unresolved until I do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used VueUse here and it seems to work well. You can check it out in this commit:
5a68e55

@andrewwallacespeckle andrewwallacespeckle marked this pull request as ready for review December 10, 2024 23:03
Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

}
})
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, this extension was here mostly as a placeholder for the frontend. Removing it is the way to go 👍

@@ -48,5 +63,7 @@ export class ViewModes extends Extension {
break
}
this.viewer.requestRender(UpdateFlags.RENDER_RESET)

this.emit(ViewModeEvent.Changed, viewMode)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the approach of defining it's own events here! 👍

Copy link
Contributor

@AlexandruPopovici AlexandruPopovici left a comment

Choose a reason for hiding this comment

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

All good from my point of view. I'm happy seeing additions to the viewer and it's extensions, especially when they are so on point! Excellent work!

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

@benjaminvo benjaminvo left a comment

Choose a reason for hiding this comment

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

I can't dismiss this panel anymore:
CleanShot 2024-12-12 at 13 00 39@2x

Please remove the hover transitions from the menu items in this menu. They make it feel slow:
CleanShot 2024-12-12 at 13 01 44@2x

}
} as const

export const ToolShortcuts = {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a must, but you can add : readonly, then TS will complain if you try to modify these consts, I started using that for consts that shouldn't change as well

Mikehrn
Mikehrn previously approved these changes Dec 12, 2024
Copy link
Contributor

@Mikehrn Mikehrn left a comment

Choose a reason for hiding this comment

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

Code looks good 😄

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

benjaminvo
benjaminvo previously approved these changes Dec 12, 2024
Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

@andrewwallacespeckle andrewwallacespeckle merged commit 87221ca into main Dec 12, 2024
40 checks passed
@andrewwallacespeckle andrewwallacespeckle deleted the andrew/web-2119-add-view-mode-selector branch December 12, 2024 17:19
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.

4 participants