Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Working Copy How To?

in General Posts: 1,089

Search isn’t helping me find anything about how to connect my Codea project to Working Copy. Links or hints please? Thanks!


  • Posts: 1,089

    OK I managed to "Save to Working Copy" using Export Zip (not entirely obvious but Working Copy has some limited help). I see there is a possibility Process in Working Copy but that did nothing.

    The 2.6.1 writeup seems to say that I can simultaneously edit in Working Copy and Codea. That would be interesting to try. How is it done?

    Is there a users' guide for Codea somewhere that I've missed?


  • dave1707dave1707 Mod
    Posts: 9,415

    The users guide for Codea is the built in documentation and whatever you find in the forum. As for Working Copy, I haven’t the slightest idea. Never used it.

  • Posts: 1,089

    The docs on functions and such are great. Things like this, not so much. I wish Simeon would video his tests or something. :)

    Dave, what, if anything, do you use for code versioning?

  • dave1707dave1707 Mod
    Posts: 9,415

    @RonJeffries I don’t do anything for versioning other than making a copy of the project before I make changes. I don’t write anything so big that I can't take the copy and redo what I want if I mess things up.

  • SimeonSimeon Admin Mod
    edited December 2018 Posts: 5,694


    1. Open up working copy and Codea side-by-side (you don't have to do this, but it helps)
    2. Under Repositories in Working Copy hit + to add a new one
    3. Choose Setup Synced Directory
    4. Navigate to On My iPad -> Codea
    5. Tap the project you want to keep synced to git
    6. Working Copy will show the syncing pane, press Done when it's done

    Now you probably want to do an initial commit in working copy

    1. In your repo (named something like My Project.codea tap the first item in the list named "Repository"
    2. Press Commit Changes
    3. Type a commit message, select all files to commit, then press Commit

    Now start editing your project in Codea, you'll see the state of the repository in Working Copy update as you edit files in Codea. You can now commit these changes in Working Copy as you edit.

    Any time you revert or switch branches in Working Copy the Codea project will update too.

    The Twitter video I posted about this shows the same steps:

  • Posts: 1,089

    Super, I'll try that. Please go paste that somewhere into the docs where folks can find it. :)

  • Posts: 1,089

    I hear that, dave. same for me, really, but my religion requires me to try these things and possibly use them even if only in the small. :)

  • Posts: 1,089

    OK, learned some things. First, Files On my iPad / Codea has all my Codea stuff in it. I probably missed some memos, so I'm probably worse than a newbie, but I don't know how I was supposed to find that out.

    Second, the video goes super fast. I had to pause it and try to slowly drag the slider to see what was going on.

    Third, when I finally opened the right folder and did the sync, it (of course) worked fine.

    I'd like to help make things like this easier. I can write and learn. I'm not sure I have much time to put into it, but maybe there's some way I can help.

  • SimeonSimeon Admin Mod
    Posts: 5,694

    Sorry about the video speed, it was originally for twitter, which means short attention spans.

    You're right that putting it in the docs is needed. But sometimes I feel like putting it in the docs is also burying it.

    My personal preference for learning tends to be those "Tip of the day" / "Did you know" style messages that come up every so often. I wonder if this is more suited to something like that.

  • Posts: 1,089

    Well, what are the odds that the tip of the day will answer the question the user has at that moment? I'd guess low. Of course a giant manual would bury things too. Possibly some better organization here would be useful, maybe a How To section or something. I've tried writing stuff elsewhere and linking here, to little avail. But something might be done, if we could think of it.

  • SimeonSimeon Admin Mod
    Posts: 5,694

    Yeah that's true, I often don't find out about an interesting feature until I've seen quite a few tips. But then I probably wouldn't have been open to reading through anything to find them.

    I'm thinking about including a quick start style page in the new code editor. Using 5 - 10 second looping videos to show how to perform common actions. Then I can include more in-depth pieces at the bottom of that area such as managing projects with Git.

  • Posts: 1,089

    Welcome back a year later. When I navigate in Working Copy to the on my ipad / Codea folder, WC does not show individual projects, so I can't select them to sync.

    Ideas welcome ... thanks!

  • edited February 2020 Posts: 1,089

    This helpful tip from Anders Borum, the creator of Working Copy:

    Something unfortunately changed in iOS 13 such that a document picker can either be used to pick folders or used to pick documents but not both.

    Codea documents are directories but not folders which makes them sort of fall between the cracks.

    The solution is to create an empty repository or clone any existing repository matching a Codea project, then invoke the share sheet for this repository where you pick “Setup Package Sync” that will let you pick Codea projects. It is no coincidence that the icon for this action looks like this.

    (It looks like the Codea logo. :) )

    Works just right!

  • Posts: 1,277

    I just lost a half hour of work to a Codea crash. I’m so glad to have found this. Never again!

  • dave1707dave1707 Mod
    Posts: 9,415

    There’s always the long press on the “run icon”, top right, that gives you the option to save your code before it’s run.

  • Posts: 1,089

    i've wondered about that. i've seen CodeaUnit tests fail to run because the code it reads isn't the code in the tab. why aren't changed tabs always saved?

  • Posts: 1,277
  • edited April 4 Posts: 171


    long press on the “run icon”

    Is this documented anywhere?

  • Posts: 1,277

    @dave1707 that actually doesn’t guarantee that data persists either. I just ran a project that way and still lost data.

  • dave1707dave1707 Mod
    Posts: 9,415

    @UberGoober The save should save the code, what data are you talking about.

  • dave1707dave1707 Mod
    Posts: 9,415

    @skar I don’t think it documented anywhere, if it is I don’t know about it. I think it’s just in the Codea version release info which is in a discussion “Codea Roadmap”near the top of the forum. It hasn’t been updated for awhile.

  • Posts: 1,277

    @dave1707 In running the tests for my project, I create, write to, read from, load, and delete tabs.

    I don’t know if that affects anything, but it,might, so I mention it.

    The way the bad thing happens is: I edit code, I run the project, I go back to the editor, my edits are gone.

    This has happened even with the “save & run” feature you mentioned, I’m sorry to say.

    And it happens both on tabs I’m writing to and tabs I’m not.

    Before I run my projects these days I close out of them and open them again.

    Even that does not 100% prevent this from happening, but it seems to make it less likely.

    It’s almost guaranteed to happen if Codea crashes while the project is running.

    It has happened without crashes too, though.

    I was slightly excited to learn about “save & run,” because quitting out of a project every time I want to run it is a pain.

    But as I said, it doesn’t prevent the bug either.

  • dave1707dave1707 Mod
    Posts: 9,415

    @UberGoober Is there a reason you’re not writing to “project data”. I’ve also seen times where you write info to a tab and the info doesn’t show until you exit the project and reload it.

  • dave1707dave1707 Mod
    Posts: 9,415

    @UberGoober I just found a bug when writing to a tab. I reported it to Simeon, so we’ll see what happens. The problem was in the newest Codea version I just downloaded and I also tried it on an older version and the problem happened there too. So maybe there will be a fix soon.

  • Posts: 1,277

    @dave1707 nice snooping!

    I’m not writing to project data because my goal is to create a tab that gives users code they can copy and paste into their own projects.

  • SimeonSimeon Admin Mod
    Posts: 5,694

    @dave1707 @UberGoober it would be good to know if you still experience any data loss issues with beta build 266

  • dave1707dave1707 Mod
    edited April 5 Posts: 9,415

    @Simeon (version 266) Same problem I reported earlier about using saveProjectTab. Code disappears when a tab is created. Also using saveProjectTab, if I do the long press and select save &run, the code is saved but the new tab doesn’t show until I exit the code and go back in.

  • Posts: 1,277

    I’m using “working copy” now and I don’t know if this has anything to do with that, but yesterday I saw an edit revert right in front of my eyes.

    I understand if it’s hard to believe, I could barely believe it myself.

    I think it happened while the keyboard was either appearing or being dismissed.

    Also, and I don’t know how it might be related, but the editing cursor is constantly jumping to the top of the tab I’m on.

    I am using working copy in split-screen with Codea, maybe that’s having an effect? I’ll stop doing that and see if it changes things.

  • Posts: 1,277

    The editor-scrolling-to-top bug seems to be gone in 266

  • Posts: 2,348
    @Simeon - noted, on a couple of occasions that Codea crashed on me when I was editing. Haven't posted yet as can't seem to duplicate. Seems to be just after placing cursor and deleting character to left.
  • Posts: 1,277

    266: I just lost a bunch of data on a tab that I write to during the app's running time.

    I had updated the values and saved over them a bunch of times.

    Then I closed Codea, and a while later I came back to the app and everything I'd done was gone.

    This is exactly what happened in the last version, and the reason why I went and got Working Copy. Luckily I'd committed everything I did before the data was lost, so I was able to pull it all back from the git.

  • Posts: 1,089

    i'm rather sure that Working Copy won't revert unless you ask it to. I have found that Codea often seems not to pick up on a revert, and I always exit the project before I do a revert. I've not seen that fail.

    I do not often write to tabs, so have no info on that.

Sign In or Register to comment.