Skip to content

Issue discussions Vue refactor

username-removed-502136 requested to merge issue-discussions-refactor into master

This MR is about to refactor Issue discussions with Vue to allow us to build new features onto it, like starting a new thread from a non-discussion comment.

Related with #30299 (moved) and !11687 (closed)

/cc @DouweM

List of things to do as discussed with @jschatz1 in this MR

  • You can't stop the polling... For when you change tabs. Can't use the current polling function because VueX.
  • When you poll you lose the emojis.
  • [ ] After a Slash command the state is not updating. (This also doesn't happen on master or gitlab.com, waiting on @DouweM feedback on this) issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/35929
  • Using a Vue Instance to pass events to jQuery code. Remove the Vue instance to stop providing events.
  • If you close the issue in issue buttons. If you do something in the sidebar. Nothing updated.
  • When you leave the page the reply should still be there.
  • Make sure we show first class action errors properly.

List of bugs @iamphill found:

  • Alignment seems all wrong
  • JS error when saving edit on note:
  • Can't reply on a discussion
  • [ ] I wonder if we should trigger a poll when we close/re-open the issue or apply slash commands issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/35929
  • I'm not sure how I did it, but I managed to get the issue state as closed but the Close issue button was still there: issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/35929
  • Toggle discussion doesn't work
  • Added a award emoji to a single note got an error but the emoji stayed there even after a refresh
  • Register/Sign-in link lead to nowhere
  • Submit button doesn't disable when submitting a comment
  • Linking to a comment doesn't work
  • Slash commands should be disabled on edit comments
  • It is possible to submit an empty reply to a discussion

List of things @jschatz1 said to not fix in this MR:

  • We are updating using the window.gl obj and updating that obj through vue.
  • No tests for the VueX part.
  • No tests for the Vue components
### Frontend checklist
  • Render single note
  • Render discussion
    • Implement toggle control for discussions
    • Show register and sign in links in discussion footer for anon user
  • Render system notes
  • First class note actions
    • Handle note edit
    • Handle note delete
    • Handle discussion reply
    • Handle new comment created
    • Handle new discussion created
  • First class issue actions
    • Handle issue close
    • Handle comment and close
    • Handle start discussion and close
    • Handle issue reopen
    • Handle comment and reopen
    • Handle start discussion and reopen
    • Make sure that we updating the issue badge after closing/reopening the issue
  • Award Emoji
    • Create award emoji list
    • Handle adding new emoji from emoji dropdown
    • Handle adding new emoji from emoji list
    • Handle emoji click in emoji list
    • Highlight already awarded emoji
    • Handle mutual exclusive emojis
    • Render 👍 and 👎 at the beginning of the list
    • Disable adding 👍 and 👎 to your own comment
  • Realtime
    • Implement polling for changes
    • Handle response and render new notes/discussions
    • Refactor polling mechanism to use next generation polling
  • Known issues, improvements, things to do later
    • Fix syntax highlighting
    • Fix KaTex rendering
    • Fix to do list editability
    • Make sure that we create dummy note placeholders while requesting
    • Make sure that we implement Slash commands and autocompletes properly
    • Make sure that up arrow puts last comment into edit mode
    • Create empty comment widget with register and sign in links if user has no permission
    • Remove award emoji related vendored svg's and use them from icons folder
    • Timestamp needs to link to #note_<id>
    • When anchor is #note_<id>, we need to jump to that note
    • Scroll the anchored note into view after notes rendered if page has note anchor
    • "Add reaction" needs to be hidden when signed out
    • Options menu and "Report as abuse" need to be hidden when signed out
    • "Report as abuse" should not be shown for comments by current user when signed in
    • "Preview" pane should say "Nothing to preview" when textarea is empty
    • "Comment" button should be disabled when textarea is empty
    • New notes and note edits don't have preview
    • "Toggle discussion" arrow doesn't flip
    • ESC doesn't cancel a note edit or discussion reply (immediately cancels when textarea is empty, and shows confirmation alert otherwise)
    • Show register and sign in links instead of comment when signed out
    • Fix autocomplete bug, request returns HTML and it causes recursive errors on the page
    • Fix slash command only comment
    • Fix syntax highlighting after editing a comment
    • When issue is closed/reopened from the issue actions at the top of the page, it should properly update close/reopen button state on the main note form at the bottom of the page
    • Handle quick actions notes.js:285
    • Fix visual bugs new note form, note type dropdown
    • Fix resurrecting autosaved comments into the reply widget
    • Make sure that we show first class action errors properly
    • Bottom padding of discussion reply "Comment" button is inconsistent with MR page
    • Discussion reply form should say "Markdown and quick actions are supported", not just "Markdown is supported" (only when adding a reply, not when editing)
    • When issue state changed using a slash command, we don't update the issue state buttons on the new note form
    • 💯 emoji bug
    • Polling removes awards
    • Zen mode editing shows comment toolbar SS
    • Keyboard shortcuts
  • Technical Debts - [ ] All components starts with issue_note prefix and all of them under notes/components folder. Most of them should be moved into shared components folder and issue_ prefix should be removed
    • Use constants in Vuex
    • Separate state, getters, actions, mutations in Vuex store to their own files
Edited by Jacob Schatz

Merge request reports