Skip to content

[Claude Code 0.2.35] [claude-3-7-sonnet-20250219] [$0.53] [🟢 works] [🔴 linter] [🔴 UX issues] [🔴 code is bad] feat: add code version history with restore functionality#175

Open
minervathebot wants to merge 2 commits intomainfrom
feat/claude-code-95
Open

[Claude Code 0.2.35] [claude-3-7-sonnet-20250219] [$0.53] [🟢 works] [🔴 linter] [🔴 UX issues] [🔴 code is bad] feat: add code version history with restore functionality#175
minervathebot wants to merge 2 commits intomainfrom
feat/claude-code-95

Conversation

@minervathebot
Copy link
Member

@minervathebot minervathebot commented Mar 16, 2025

How does this PR impact the user?

Description

This PR was created by claude-code@0.2.35 ran with:

claude

Then, we accepted all the suggestions that Claude made until it was done.

Prompt:

Please, solve the following issue. Title: feat: add code versions and an option to revert to a previous version. Description: Goal: let the user revert to the previous code version
Proposed implementation:

  • every time the user submits code, store it separately, don't overwrite the previous code version
    • we can use filenames with dates in them, for example: <userid>-<timestamp>.js
    • use a special name, like <userid>-latest.js for the latest code version so we can quickly retrieve it by path
  • add a modal that will allow the user to view previous submissions in the UI and revert to them
    • the button to open a modal should be above the code editor
    • the modal left side should be occupied by the read-only code editor
    • the modal on the right side should be occupied by the list of versions
    • user can click any of the versions to preview them in the modal
    • user can click the restore button to restore the version
    • restoring the code doesn't create a new version until the user submits the code again
      Let me know if you want to work on this ticket and if you have any questions!

Cost: $0.53 USD.

Notes

  • 🟢 the solution works
  • 🔴 linter is very unhappy
  • 🔴 there are UX issues
    • it should be wider and look better
    • it did miss the bug we have with the code editor form that when you click at the "code history" button, we trigger submit; this is a tricky issue to spot unless you test the solution, but it would be so cool if it did
  • 🔴 the code is bad
    • it should've used more of vue & nuxt hooks to fetch and manage data in CodeVersionHistoryModal
    • it shouldn't read all bot code versions into memory on start and only list and load them on demand

It also would be great to have tests for this, but it wasn't prompted to do them, so it's not judged on lacking them in this PR.

image

Checklist

  • my PR is focused and contains one wholistic change
  • I have added screenshots or screen recordings to show the changes

@yurijmikhalevich yurijmikhalevich changed the title [Claude Code] [Claude 3.7] [$0.53] feat: add code version history with restore functionality [Claude Code] [Claude 3.7] [$0.53] [🟢 pass] [🔴 linter] [🔴 UX issues] [🟡 code is fine] feat: add code version history with restore functionality Mar 21, 2025
@yurijmikhalevich yurijmikhalevich changed the title [Claude Code] [Claude 3.7] [$0.53] [🟢 pass] [🔴 linter] [🔴 UX issues] [🟡 code is fine] feat: add code version history with restore functionality [Claude Code] [Claude 3.7] [$0.53] [🟢 works] [🔴 linter] [🔴 UX issues] [🟡 code is fine] feat: add code version history with restore functionality Mar 21, 2025
@yurijmikhalevich yurijmikhalevich changed the title [Claude Code] [Claude 3.7] [$0.53] [🟢 works] [🔴 linter] [🔴 UX issues] [🟡 code is fine] feat: add code version history with restore functionality [Claude Code] [Claude 3.7] [$0.53] [🟢 works] [🔴 linter] [🔴 UX issues] [🔴 code is bad] feat: add code version history with restore functionality Mar 21, 2025
@yurijmikhalevich yurijmikhalevich changed the title [Claude Code] [Claude 3.7] [$0.53] [🟢 works] [🔴 linter] [🔴 UX issues] [🔴 code is bad] feat: add code version history with restore functionality [Claude Code 0.2.35] [claude-3-7-sonnet-20250219] [$0.53] [🟢 works] [🔴 linter] [🔴 UX issues] [🔴 code is bad] feat: add code version history with restore functionality Mar 22, 2025
@yurijmikhalevich yurijmikhalevich marked this pull request as ready for review March 23, 2025 19:48
@yurijmikhalevich yurijmikhalevich self-requested a review as a code owner March 23, 2025 19:48
…pes that are not undefined in botCodeStore.ts.

The errors BAD_REQUEST and NOT_FOUND were added to HTTP_STATUS_CODES in httpStatusCodes.ts.
The rules of "linting" of ESLint were complied in CodeVersionHistoryModal.vue and botCodeStore.ts.
The width was increased for modal form in ModalDialog.vue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants