How to switch between tasks

Sturdy allows you to easily and quickly switch between tasks by using multiple draft change. Draft changes are a unit of isolation in Sturdy, which means that code changes in one draft are independent from those in another. It is quick to create and dispose of draft. This guide will go through how you can use multiple drafts to seamlessly switch between tasks. Make sure you are familiar with editing code in Sturdy before continuing.

Multitasking with draft changes

You can use draft change to jump between multiple work in progress items. After you have created, imported or joined an existing codebase:

  1. Create a new draft change by clicking the "plus" icon next to the codebase name in the left sidebar
  2. Navigate to the new draft named "Untitled draft"
  3. Rename the newly created draft to "Feature Alpha" using the "Edit" button
  4. Click the "Connect folder for editing" button at the top of the draft change page
  5. The chosen folder is now connected to the "Feature Alpha" draft
  6. Using your IDE of choice, create some changes to the code
  7. The diffs of your changes appear in the "Feature Alpha" d
  8. Create a new draft change by clicking the "plus" icon next to the codebase name in the left sidebar
  9. Navigate to the new draft named "Untitled draft"
  10. Rename the newly created draft change to "Feature Beta" using the "Edit" button
  11. Click the "Connect folder for editing" button at the top of the draft change page
  12. The chosen folder is now connected to the "Feature Beta" draft change
    1. Observe that in the left sidebar, the computer icon has moved from "Feature Alpha" to "Feature Beta"
    2. Hover over the computer icon next to "Feature Beta" to reveal additional information
  13. In your IDE of choice, observe that the code changes that you made earlier are not present
    1. This is because the changes were made in draft "Feature Alpha" and your directory is now connected to the "Feature Beta" draft change
  14. Using your IDE:
    1. Create some new file changes, different from the ones you did earlier for the first draft
  15. The diffs of your changes appear in the "Feature Beta" draft
  16. Using the sidebar on the left, navigate back to the "Feature Alpha" draft
    1. In Sturdy you can see the diffs that you made earlier
  17. Click the "Connect folder for editing" button at the top of the draft change page to connect your folder to "Feature Alpha"
    1. Observe that in the left sidebar, the computer icon has moved from "Feature Beta" to "Feature Alpha"
    2. In your IDE, observe that your code now has the changes from "Feature Alpha" and no longer has the "Feature Beta" changes

Draft changes in Sturdy are lightweight and can be created at any time. This allows you to have multiple experiments at the same time, or the ability to quickly fix a bug without disrupting your primary task.

ℹ️ In Sturdy, there is no need to 'save' or 'stash' changes when switching between drafts.
ℹ️ You can connect the directory on your computer to draft changes created by others on your team. Learn more about collaborating with others .

Draft changes bases on other drafts

It can be useful to create drafts based on other drafts or on parts of one. Consider the following two examples:

  1. You have written some code on which you wish to get feedback, and deploy independently. You wish to continue building on this code, as a separate unit of work
  2. While you are building a feature you spot a small bug or typo in some unrelated code, which you decide to fix. You wish to extract the bug/typo fix and have it deployed separately

Sturdy allows you to create new draft change based on the work in an existing draft. Within an existing draft which already has some work in progress code changes:

  1. Using the checkbox on the left of changes, select one or multiple diffs that you wish to copy to a new draft change
    1. Optional: Use the "Select All" checkbox at the top in order to quickly select all diffs
  2. Observe the banner in blue at the top of the app indicating "n change(s) selected"
  3. Click the "Copy to New Draft" button to create a new draft change with the selected changes
  4. Observe that a new draft change named "Fork of name of the original" has been created
  5. Using the sidebar on the left, navigate to the draft "Fork of name of the original"
  6. Observe that the new draft change has only the changes that you selected
  7. Rename the draft change to reflect the changes included, for example "Quick bugfix"

Creating draft change based on other drafts is a powerful tool that allows you to quickly and easily ship small incremental changes.