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

✨ Modified file indicator #1437

Closed
6 tasks done
matthijseikelenboom opened this issue Sep 26, 2023 · 3 comments
Closed
6 tasks done

✨ Modified file indicator #1437

matthijseikelenboom opened this issue Sep 26, 2023 · 3 comments
Labels
enhancement New feature or request needs refinement This issue is not complete and has to be refined by the maintainers

Comments

@matthijseikelenboom
Copy link
Contributor

matthijseikelenboom commented Sep 26, 2023

Description

As a user
I want to be able to see an indicator when I modify a file
Because I want to know if I still need to save my changes to disk.

Acceptance criteria

  • There is a visible indicator on the tab that is open that shows up when there are modifications that haven't been saved yet
  • These indicators show up on both the active tab and non active tabs
  • When trying to close a tab with this indicator, a popup should show up that gives the option to:
    • Save the changes
    • Discard the changes
    • Cancel the action and do nothing

Scope

In scope

  • Adding an indicator for tabs that have unsaved modifications
  • Adding a popup when trying to close a tab that has unsaved modifications

Out of scope

  • Anything else

Implementation design

A good place to start is probably in the CodeEdit/CodeEdit/Features/CodeFile/ folder. Specifically CodeFile.swift where the content of the file itself is loaded into. To check if a file has unsaved changes we can be solved in multiple ways. But the best way to do it, is probably to hash the content of a file from disk and to create a hash of the current content in memory and compare them. If they are equal, there are no changes and if they are not equal, there are changes and the indicator has to be shown on the tab.

We need two new Views: One for the indicator and one for the popup. These files can be put in the feature folder Editor/Tabs.

image

Tasks

  • Make a boolean variable that can be used to show the indicator when needed
  • Make a View that represents the indicator
    • (This should be a small circle, like the one in VSCode)
  • Add the indicator the tab View with correct conditional cases
  • Make a popup View with close options
  • Create PR & merge
  • Indicator in red close window control – ✨ Show an unsaved indicator when file has been edited but not saved #1173
@austincondiff
Copy link
Collaborator

We need to finish this by adding an unsaved indicator to the red close window control if any tabs are open with changes per #1173. @avinizhanov would you like to look at this?

@avinizhanov
Copy link
Contributor

@austincondiff ok

@austincondiff
Copy link
Collaborator

Closing because #1173 is now closed due to #1457 being merged.

@github-project-automation github-project-automation bot moved this from 📋 Todo to 🏁 Complete in CodeEdit Project Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs refinement This issue is not complete and has to be refined by the maintainers
Projects
Status: 🏁 Complete
Development

No branches or pull requests

3 participants