Commit graph

147 commits

Author SHA1 Message Date
Kevin Turcios
0d968a0652
Fix VSCode extension build: regenerate package-lock.json (#2617)
## Summary

- Snyk PR #2305 bumped `diff` from 8.0.2 to 8.0.3 in
`js/VSC-Extension/package.json` without regenerating the lockfile
- This causes `npm ci` to fail with a "package.json and
package-lock.json are in sync" error
- Ran `npm install` to regenerate `package-lock.json` (resolves `diff`
to 8.0.4, the latest matching `^8.0.3`)

## Test plan

- [x] Verified `npm ci` succeeds with the updated lockfile
- [x] Diff is minimal: only the `diff` package version change (4
insertions, 4 deletions)
2026-04-23 05:44:18 -05:00
HeshamHM28
f909642ce1
feat: Add Line Profiler visualization to webapp (#2268)
## Summary
Adds a line-by-line performance profiler visualization to the webapp,
allowing users to compare execution times between original and optimized
code.

  ## Changes

  ### New Line Profiler View
- **`LineProfilerView.tsx`**: Side-by-side comparison component showing:
    - Line-by-line execution times with heat map visualization
    - Syntax highlighting using `prism-react-renderer`
    - Collapsible function blocks
    - Light/dark mode support
    - Heat legend (cold → hot based on % time)

- **`lineProfilerParser.ts`**: Parser utilities for line profiler data:
- `parseLineProfilerResults()` - parses markdown table output from
Python's line_profiler
- `formatTime()` - converts timer units to human-readable format (ns,
µs, ms, s)
    - `getHeatLevel()` - determines heat coloring based on % time

- **`/review-optimizations/[traceId]/profiler/page.tsx`**: New route for
the profiler view

  ### API Changes
- **`create-pr.ts`**: Adds "📊 Performance Profile" link to PR
description when profiler data exists
- **`github-app.ts`**: Removes line profiler data from metadata when PR
is closed/merged
- **`create-staging.ts`**, **`suggest-pr-changes.ts`**: Handle line
profiler data in staging
- **`staging-storage-strategy.ts`**: Interface updates for line profiler
fields

  ### Webapp Integration
- **`page.tsx`**: Added "Performance Profile" button (only visible when
profiler data exists)
- **`action.ts`**: Sends line profiler data when creating PR from webapp
  Fixes CF-1018
  


https://codeflash-ai.slack.com/files/U08MSR1UN6L/F0A9YVDJY75/screen_recording_2026-01-21_at_10.03.18___pm.mov
https://github.com/HeshamHM28/my-best-repo/pull/21

linked to https://github.com/codeflash-ai/codeflash/pull/1139

---------

Co-authored-by: Aseem Saxena <aseem.bits@gmail.com>
2026-01-28 08:36:54 -08:00
snyk-io[bot]
f7f3e7f0bd
[Snyk] Security upgrade diff from 8.0.2 to 8.0.3 (#2305)
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)

### Snyk has created this PR to fix 1 vulnerabilities in the npm
dependencies of this project.

#### Snyk changed the following file(s):

- `js/VSC-Extension/package.json`




#### Vulnerabilities that will be fixed with an upgrade:

|  | Issue | Score | 

:-------------------------:|:-------------------------|:-------------------------
![medium
severity](https://res.cloudinary.com/snyk/image/upload/w_20,h_20/v1561977819/icon/m.png
'medium severity') | Regular Expression Denial of Service (ReDoS)
<br/>[SNYK-JS-DIFF-14917201](https://snyk.io/vuln/SNYK-JS-DIFF-14917201)
| &nbsp;&nbsp;**708**&nbsp;&nbsp;




---

> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - Max score is 1000. Note that the real score may have changed since
the PR was raised.
> - This PR was automatically created by Snyk using the credentials of a
real user.

---

**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open fix PRs._

For more information: <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI1YmZkM2I3OC1iNmQ1LTRmNTYtODBhNC1iZDg4YmMzMTA4NDAiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjViZmQzYjc4LWI2ZDUtNGY1Ni04MGE0LWJkODhiYzMxMDg0MCJ9fQ=="
width="0" height="0"/>
🧐 [View latest project
report](https://app.snyk.io/org/sarthak-aNe3RTvxtiDtBRn3AkWpLk/project/9d3b7f4a-fb81-42ff-ac9e-3cf1a6bff233?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;fix-pr)
📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=github-cloud-app&utm_content=fix-pr-template)
🛠 [Adjust project
settings](https://app.snyk.io/org/sarthak-aNe3RTvxtiDtBRn3AkWpLk/project/9d3b7f4a-fb81-42ff-ac9e-3cf1a6bff233?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;fix-pr/settings)
📚 [Read about Snyk's upgrade
logic](https://docs.snyk.io/scan-with-snyk/snyk-open-source/manage-vulnerabilities/upgrade-package-versions-to-fix-vulnerabilities?utm_source=github-cloud-app&utm_content=fix-pr-template)

---

**Learn how to fix vulnerabilities with free interactive lessons:**

🦉 [Regular Expression Denial of Service
(ReDoS)](https://learn.snyk.io/lesson/redos/?loc&#x3D;fix-pr)

[//]: #
'snyk:metadata:{"breakingChangeRiskLevel":null,"FF_showPullRequestBreakingChanges":false,"FF_showPullRequestBreakingChangesWebSearch":false,"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"diff","from":"8.0.2","to":"8.0.3"}],"env":"prod","issuesToFix":["SNYK-JS-DIFF-14917201"],"prId":"5bfd3b78-b6d5-4f56-80a4-bd88bc310840","prPublicId":"5bfd3b78-b6d5-4f56-80a4-bd88bc310840","packageManager":"npm","priorityScoreList":[708],"projectPublicId":"9d3b7f4a-fb81-42ff-ac9e-3cf1a6bff233","projectUrl":"https://app.snyk.io/org/sarthak-aNe3RTvxtiDtBRn3AkWpLk/project/9d3b7f4a-fb81-42ff-ac9e-3cf1a6bff233?utm_source=github-cloud-app&utm_medium=referral&page=fix-pr","prType":"fix","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":["updated-fix-title","priorityScore"],"type":"auto","upgrade":["SNYK-JS-DIFF-14917201"],"vulns":["SNYK-JS-DIFF-14917201"],"patch":[],"isBreakingChange":false,"remediationStrategy":"vuln"}'

Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com>
2026-01-27 17:37:39 +05:30
HeshamHM28
78a848c166 Refactor optimization result properties in SidebarProvider, CommentThreadProvider, and OptimizationService
- Updated property names from original_line_profiler_results and optimized_line_profiler_results to original_line_profiler and optimized_line_profiler for consistency.
- Adjusted related code in SidebarProvider and CommentThreadProvider to reflect the new property names.
- Ensured that the OptimizationService interface and its implementation are aligned with the updated property names.
2026-01-20 01:45:53 +02:00
HeshamHM28
15d51b5b8d
Merge branch 'main' into feat/line/profiler/vsc 2026-01-19 15:19:07 -08:00
Mohamed Ashraf
aca72a9f45 making sure optimmization is marked when PR is created 2026-01-14 23:34:02 +02:00
Mohamed Ashraf
b24283f852 ADDING PR creation feature 2026-01-14 23:04:14 +02:00
Mohamed Ashraf
f0b105eb18 - Introduced a new array to track content provider disposables, ensuring proper cleanup to prevent memory leaks.
- Added disposal logic before registering new content providers and during cleanup to maintain resource efficiency.
2026-01-14 17:29:15 +02:00
Mohamed Ashraf
deef77043c Enhance GitPatchProvider with line ending normalization and improved multi-file diff handling
- Added a function to normalize line endings to LF for consistent patch processing.
- Updated `showPatch` method to always use the native diff editor, removing the webview fallback.
- Improved handling of multi-file patches by opening separate diff editors for each file.
- Enhanced error handling and logging for better debugging and user feedback.
- Removed unused code related to pull request creation and secondary action buttons in the explanation panel.
2026-01-14 17:15:54 +02:00
mashraf-222
da2ae7be1f
Merge branch 'main' into vsc/enhance-optimization-view 2026-01-14 13:48:52 +02:00
mashraf-222
2e93de2f17
fix bug for versioning detaction for vsc (#2216)
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2026-01-14 10:45:07 +00:00
HeshamHM28
9162b41c37 feat: Add line profiler results handling and parsing utilities 2026-01-13 21:53:16 +02:00
mashraf-222
1758271a86
Merge branch 'main' into vsc/enhance-optimization-view 2026-01-13 15:02:06 +02:00
Mohamed Ashraf
1b32e1bb0c update the min CLI version to be 0.19.1 for 2026-01-09 21:00:03 +02:00
Mohamed Ashraf
c7058aaee3 adding buttons for apply changes or raising PR 2026-01-09 20:28:29 +02:00
Mohamed Ashraf
43b6496a8a Implemented a native VSCode diff editor for optimization results 2026-01-09 19:07:03 +02:00
Mohamed Ashraf
b18f876f0f Refactor getRelativePathIfAbsolute to improve path handling 2026-01-09 16:29:42 +02:00
Mohamed Ashraf
4586bc7624 fix kebab menu UI 2026-01-08 12:15:49 +02:00
Mohamed Ashraf
aa70c3acec clean up logs 2026-01-08 12:03:21 +02:00
Mohamed Ashraf
15edd71f06 fix the optimize file button 2026-01-08 11:59:49 +02:00
Mohamed Ashraf
2f843e098d fix codelens 2025-12-25 17:02:30 +02:00
Sarthak Agarwal
4b0614e002
VSC version upgrade to 19 (#2128) 2025-12-23 22:21:52 +05:30
mashraf-222
8a69be8891
[VSC] update init steps title (#2120)
Raised based on this suggestion
https://github.com/codeflash-ai/codeflash-internal/pull/2117#discussion_r2639555574
<img width="367" height="741" alt="image"
src="https://github.com/user-attachments/assets/30f2fe2f-0c4e-4b57-a1ef-1a29c6967723"
/>
2025-12-22 22:13:12 +05:30
Mohamed Ashraf
2b32282cd5 update init steps titles 2025-12-18 17:29:21 +02:00
Aseem Saxena
fd306859fa
Merge branch 'main' into vsc/add-3-init-steps-overview 2025-12-16 18:50:53 -08:00
Aseem Saxena
1192df12a6
feedback loop for unmatched test results (#2059)
fixes CF-932

# Pull Request Checklist

## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets

## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes

## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code

## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---

## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->

---------

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
Co-authored-by: ali <mohammed18200118@gmail.com>
Co-authored-by: Kevin Turcios <106575910+KRRT7@users.noreply.github.com>
2025-12-17 08:14:32 +05:30
Mohamed Ashraf
c3d23840df add the codeflash logo again 2025-12-16 20:18:14 +02:00
Mohamed Ashraf
a5cffafaae clean up 2025-12-16 20:03:38 +02:00
Mohamed Ashraf
e01e4eee2c Additional improvements 2025-12-16 19:49:46 +02:00
Mohamed Ashraf
ab12e7ac89 VSC: Add steps progress indicator 2025-12-16 19:34:18 +02:00
mashraf-222
96ea895c99
VSC optimization screen redesign (#2104)
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2025-12-15 21:36:25 +05:30
Mohamed Ashraf
dcba33e7d7 Update the shared getFileNameFromPath to handle Windows paths properly 2025-12-10 09:09:16 +02:00
Mohamed Ashraf
66e3f2f55c Merge branch 'main' into ashraf/cf-918-fix-vsc-extension-windows-bugs 2025-12-10 09:09:03 +02:00
HeshamHM28
734efeba10
Review Screen Auto Open (#2096)
Fixes CF-906
2025-12-09 17:02:25 +02:00
ali
b1ae0d5772
remove the test framework option 2025-12-09 15:49:33 +02:00
mohammed ahmed
0677d7f1c8
[VSC] New version release (0.0.18) (#2090)
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2025-12-07 12:46:31 +05:30
mashraf-222
42a63fed57
VSCE validate tests directory (#2057)
Co-authored-by: HeshamHM28 <HeshamMohamedFathy@outlook.com>
2025-12-05 18:31:30 +05:30
HeshamHM28
b70b1ac178
[FEAT] One click to install codeflash (#2053)
fixes CF-869


https://github.com/user-attachments/assets/4ae54838-fcb2-454a-886f-eaf367766d38

---------

Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2025-12-05 00:12:39 +05:30
HeshamHM28
f681e8c0db
Add Codeflash Docs Link in VSC (#2054)
Fixes cf-867 CF-893

<img width="402" height="648" alt="Screenshot 2025-11-26 at 5 11 19 PM"
src="https://github.com/user-attachments/assets/9e0341af-7744-434f-a30b-28d0f54c9cd5"
/>
<img width="401" height="859" alt="Screenshot 2025-11-26 at 5 11 29 PM"
src="https://github.com/user-attachments/assets/8610dee8-6545-4e7b-99d5-c995189ecac8"
/>
<img width="387" height="786" alt="Screenshot 2025-11-26 at 5 11 52 PM"
src="https://github.com/user-attachments/assets/001ccb25-8821-49da-ad4f-487a13e13dae"
/>

 Add help button linking to Codeflash documentation

  Added a help button (?) that links to https://docs.codeflash.ai/

  Locations:
  - Main sidebar tabs header - top right corner, next to the
  Optimization/Tasks tabs
  - Sign in form - top right corner
  - Init form - top right corner
  - Demo optimization page - top right corner

---------

Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2025-12-05 00:08:53 +05:30
Mohamed Ashraf
1b4257aeb7 update delimiter to be windows compatible 2025-12-04 04:48:09 +02:00
Saurabh Misra
036f00fef1
Merge branch 'main' into change/back/button/icon 2025-12-04 02:16:49 +05:30
HeshamHM28
d99981930a
Merge branch 'main' into change/back/button/icon 2025-12-03 12:40:16 -08:00
HeshamHM28
68fb5bb96e
Merge branch 'main' into chore/make/code-block 2025-12-03 04:46:54 -08:00
mohammed ahmed
7f96369bbd
[VSC] Stop demo optimization & runtime info for successful opts (#2046)
depends on https://github.com/codeflash-ai/codeflash/pull/942

- Fixes [CF-905](https://linear.app/codeflash-ai/issue/CF-905)
- Fixes [CF-897](https://linear.app/codeflash-ai/issue/CF-897)
- Fixes [CF-901](https://linear.app/codeflash-ai/issue/CF-901)
- Fixes [CF-898](https://linear.app/codeflash-ai/issue/CF-898)
- Fixes [CF-904](https://linear.app/codeflash-ai/issue/CF-904)
2025-12-02 15:18:26 -08:00
HeshamHM28
7cd8a5f6f5 fix bug 2025-12-02 16:06:09 +02:00
HeshamHM28
27341e217a Add collapsibleCodeblocks 2025-11-28 17:30:06 +02:00
Mohamed Ashraf
7fd6a0101b ensure the optimization starts for the function 2025-11-28 05:37:15 +02:00
Mohamed Ashraf
1d07d27700 windows fix in vsc correct function choosing from the file 2025-11-28 04:58:19 +02:00
Mohamed Ashraf
d532db4072 windows fixes
- fix the showen file name to optimize instead of the whole directory
- correct file recognetion inside root module
2025-11-28 04:44:31 +02:00
HeshamHM28
1f8e36e4e6 change the Back icon to cancel icon 2025-11-26 18:13:37 +02:00