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

Closing doc tabs #215

Merged
merged 17 commits into from
Jun 22, 2021
Merged

Conversation

akshay1992kalbhor
Copy link
Contributor

@akshay1992kalbhor akshay1992kalbhor commented Jun 16, 2021

Few notes

  1. Only the last tab can be cleanly closed. Because we are using tab indexes deleting from middle messes stuff up
  2. Layer Panels are being updated
  3. No confirmation dialog box up yet
  4. Closing last tab crashes everything

Closes #211.


This change is Reviewable

@akshay1992kalbhor
Copy link
Contributor Author

akshay1992kalbhor commented Jun 17, 2021

  • Can delete any tab
  • Deleting last tab opens new doc
  • Layer panels are correctly updated
  • Can use shortcut Ctrl + w to close selected doc
  • Add a confirmation dialog box

client/web/src/components/workspace/Panel.vue Outdated Show resolved Hide resolved
client/web/src/components/workspace/Panel.vue Outdated Show resolved Hide resolved
client/web/src/components/workspace/Panel.vue Outdated Show resolved Hide resolved
client/web/src/response-handler.ts Outdated Show resolved Hide resolved
client/web/wasm/src/document.rs Outdated Show resolved Hide resolved
client/web/wasm/src/document.rs Outdated Show resolved Hide resolved
core/editor/src/document/document_message_handler.rs Outdated Show resolved Hide resolved
core/editor/src/document/document_message_handler.rs Outdated Show resolved Hide resolved
core/editor/src/document/document_message_handler.rs Outdated Show resolved Hide resolved
core/editor/src/document/document_message_handler.rs Outdated Show resolved Hide resolved
@Keavon
Copy link
Member

Keavon commented Jun 20, 2021

At a broader scale, it would be great to switch from using indexes to document IDs. It would especially help simplify a good amount of the complexity that this PR introduces with all the fragile special cases for dealing with the shift caused by array mutation. It will be even more necessary when it comes time to implement tab rearranging. I'll let you decide if you want to refactor it now, or merge this now and you (or someone else, if you don't volunteer) can submit a followup PR to address it. I expect that followup PR would remove more lines of code than it adds, which is a very good thing (simplicity is key to maintainability). This is great work and thanks for your changes! Sorry it took a day until I was available to review.

Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 7 files at r1, 2 of 6 files at r2, 5 of 5 files at r4.
Reviewable status: all files reviewed, 11 unresolved discussions (waiting on @akshay1992kalbhor)

Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @akshay1992kalbhor)

@Keavon Keavon merged commit 0b08732 into GraphiteEditor:master Jun 22, 2021
Keavon added a commit that referenced this pull request Jul 30, 2023
* Can only remove last document successfully

* Correctly update the layer tree panel

* Remove comments

* Add support for randomly closing docs

* Create new doc after closing last doc

* Update layer panel when creating new docs

* Fix bug that crashed the program when first doc was closed

* Refactor to make code simpler and increase readability

* Add shortcut to close active doc (Shift + C)

* Add a confirmation dialog box before closing tabs

* New docs get the correct title

* Remove comments and fix typos

* Disable 'eslint-no-alert'

* Refactor and fix document title bug

* Rename the FrontendMessage and ReponseType for showing close confirmation modal

* Change the message displayed in the close confirmation modal

Co-authored-by: Keavon Chambers <[email protected]>
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.

Support for closing document tabs
2 participants