Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
842cb3d
creation and integration of react project
SamaAshrafAhmed Sep 24, 2025
f60fce5
returned description
SamaAshrafAhmed Sep 24, 2025
6f29d41
created prs table and sidebar
SamaAshrafAhmed Sep 26, 2025
e5fb448
added github integration apis
SamaAshrafAhmed Oct 1, 2025
51df963
added link to change current repo
SamaAshrafAhmed Oct 1, 2025
27f6cd1
added risk score and label into prs table
SamaAshrafAhmed Oct 2, 2025
6c9bd5c
removed unneccessary comments
SamaAshrafAhmed Oct 2, 2025
894bf41
replaced old risk api, and added reviewers recommendation feature
SamaAshrafAhmed Nov 8, 2025
e06be90
webapp dashboard
SamaAshrafAhmed Mar 28, 2026
aa42115
integrated risk api and repos selection api
SamaAshrafAhmed May 19, 2026
ae3b7c2
made risk score calculated for one pr at a time
SamaAshrafAhmed May 19, 2026
58bb4a7
fixed files changed reloading issue
SamaAshrafAhmed May 19, 2026
8641717
integrated Profiling api and created ui
SamaAshrafAhmed May 19, 2026
f4c80af
integrated Jira Authentication and reviewer recommendation
SamaAshrafAhmed Jun 12, 2026
cbd219e
integrated pr summerizer,added reviewer recommendation justification …
SamaAshrafAhmed Jun 16, 2026
fcc68c6
integrated business impact feature and interaction upon it in dashboard
SamaAshrafAhmed Jun 18, 2026
7f581b3
jira auth modifications for vs code extension
SamaAshrafAhmed Jul 2, 2026
f9af96f
feat: refactor Jira authentication logic into GlobalJiraListener and …
MalakHisham121 Jul 2, 2026
8850ff2
Merge pull request #26 from MalakHisham121/frontend_v2
MalakHisham121 Jul 2, 2026
c0adc54
fixed issue within github installation
SamaAshrafAhmed Jul 2, 2026
423fe4b
feat: implement manual Jira code authentication flow and update servi…
MalakHisham121 Jul 2, 2026
acd4c7f
feat: import useEffect hook in JiraLogin component
MalakHisham121 Jul 2, 2026
cfef136
Merge pull request #27 from MalakHisham121/frontend_v2
MalakHisham121 Jul 2, 2026
5680adb
fixed choosing jira project issue
SamaAshrafAhmed Jul 3, 2026
b6bc2f8
fixed change repo flow
SamaAshrafAhmed Jul 3, 2026
82dc814
feat: add Jira OAuth callback support and improve manual code extract…
MalakHisham121 Jul 3, 2026
c35ff53
Merge remote-tracking branch 'origin/frontend_v2' into frontend_v2
MalakHisham121 Jul 3, 2026
d2cd5cf
Merge pull request #29 from MalakHisham121/frontend_v2
MalakHisham121 Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions codience/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{
"version": "0.2.0",
"configurations": [

{
"name": "Run Extension",
"type": "extensionHost",
Expand Down
12 changes: 11 additions & 1 deletion codience/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"problemMatcher": {
"owner": "typescript",
"pattern": {
"regexp": "^(.*)$"
},
"background": {
"activeOnStart": true,
"beginsPattern": "^\\[watch\\] build started",
"endsPattern": "^\\[watch\\] build finished"
}
},
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
Expand Down
Binary file added codience/media/icon.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions codience/out/extension.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions codience/out/extension.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions codience/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 26 additions & 13 deletions codience/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "codience",
"publisher": "malakhisham121",
"displayName": "Codience",
"description": "AI-powered prioritization tool that ranks tasks by business impact, complexity, and risk directly inside VS Code",
"version": "0.0.1",
Expand All @@ -9,15 +10,27 @@
"categories": [
"Other"
],
"activationEvents": [],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "codience.helloWorld",
"title": "Hello World"
}
]
"viewsContainers": {
"activitybar": [
{
"id": "sidebarContainer",
"title": "Codience",
"icon": "media/icon.webp"
}
]
},
"views": {
"sidebarContainer": [
{
"id": "sidebarView",
"name": "",
"type": "webview",
"icon": "media/image.png"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run package",
Expand All @@ -34,16 +47,16 @@
"test": "vscode-test"
},
"devDependencies": {
"@types/vscode": "^1.103.0",
"@types/mocha": "^10.0.10",
"@types/node": "22.x",
"@types/node": "^22.19.19",
"@types/vscode": "^1.103.0",
"@typescript-eslint/eslint-plugin": "^8.39.0",
"@typescript-eslint/parser": "^8.39.0",
"eslint": "^9.32.0",
"@vscode/test-cli": "^0.0.11",
"@vscode/test-electron": "^2.5.2",
"esbuild": "^0.25.8",
"eslint": "^9.32.0",
"npm-run-all": "^4.1.5",
"typescript": "^5.9.2",
"@vscode/test-cli": "^0.0.11",
"@vscode/test-electron": "^2.5.2"
"typescript": "^5.9.2"
}
}
176 changes: 158 additions & 18 deletions codience/src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,166 @@
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
import * as vscode from "vscode";
import * as fs from "fs";
import * as path from "path";

// This method is called when your extension is activated
// Your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {
const provider = new SidebarProvider(context.extensionUri);

// Use the console to output diagnostic information (console.log) and errors (console.error)
// This line of code will only be executed once when your extension is activated
console.log('Congratulations, your extension "codience" is now active!');
context.subscriptions.push(
vscode.window.registerWebviewViewProvider(SidebarProvider.viewType, provider),
);

// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
const disposable = vscode.commands.registerCommand('codience.helloWorld', () => {
// The code you place here will be executed every time your command is executed
// Display a message box to the user
vscode.window.showInformationMessage('Hello World from Codience!');
});
// Register a URI handler so external OAuth redirects (vscode://.../?code=...)
// can be forwarded back to the webview.
const uriHandler = vscode.window.registerUriHandler({
handleUri(uri: vscode.Uri) {
try {
if (uri.path !== "/callback" && uri.path !== "/jira-login") {
return;
}

context.subscriptions.push(disposable);
const params = new URLSearchParams(uri.query);
const code = params.get("code");
if (!code) {
return;
}

// forward to the provider (if it has an active webview)
provider.handleIncomingUri(code, uri.toString());
} catch (err) {
console.error("Failed to handle incoming URI", err);
}
},
});
context.subscriptions.push(uriHandler);
}

// This method is called when your extension is deactivated
export function deactivate() {}

class SidebarProvider implements vscode.WebviewViewProvider {
public static readonly viewType = "sidebarView";

private _webviewView?: vscode.WebviewView;

constructor(private readonly _extensionUri: vscode.Uri) {}

// Called by the activate() URI handler to push the code back into the webview
public handleIncomingUri(code: string | null, fullUri?: string) {
if (!this._webviewView) {
return;
}
this._webviewView.webview.postMessage({
type: "jiraAuthCode",
code,
uri: fullUri,
});
}

resolveWebviewView(
webviewView: vscode.WebviewView,
context: vscode.WebviewViewResolveContext,
_token: vscode.CancellationToken,
) {
this._webviewView = webviewView;
const webview = webviewView.webview;

webview.options = {
enableScripts: true,
localResourceRoots: [
vscode.Uri.joinPath(this._extensionUri, "webview-ui", "webview-ui", "dist"),
],
};

try {
const indexPath = path.join(
this._extensionUri.fsPath,
"webview-ui",
"webview-ui",
"dist",
"index.html",
);

let html = fs.readFileSync(indexPath, "utf-8");

html = html.replace(
/(src|href)="(.+?)"/g,
(_match: string, attr: string, link: string) => {
if (/^https?:\/\//.test(link)) {
return _match;
}

const uri = webview.asWebviewUri(
vscode.Uri.joinPath(
this._extensionUri,
"webview-ui",
"webview-ui",
"dist",
link,
),
);

return `${attr}="${uri}"`;
},
);

html = html.replace(
"<head>",
`<head>
<meta http-equiv="Content-Security-Policy"
content="
default-src 'none';
img-src ${webview.cspSource} https:;
style-src ${webview.cspSource} 'unsafe-inline';
script-src ${webview.cspSource};
connect-src
https://codience.onrender.com
https://sphery-arlen-nondecorative.ngrok-free.dev
https://fordless-samella-unexpendable.ngrok-free.dev
http://localhost:5051
http://127.0.0.1:5051
http://localhost:8000
http://127.0.0.1:8000
http://127.0.0.1:8001
http://127.0.0.1:8002
http://127.0.0.1:8003;
">
`,
);

webview.html = html;
} catch (err: any) {
console.error("Error loading webview index.html:", err);
webview.html = `<!DOCTYPE html>
<html>
<body>
<h2>Error loading webview</h2>
<pre>${err.message}</pre>
<pre>${err.stack}</pre>
</body>
</html>`;
}

// Wire messages from the webview:
// - openExternal: extension will open the external browser for OAuth
webview.onDidReceiveMessage((message) => {
try {
if (!message || typeof message !== "object") {
return;
}
if (message.command === "openExternal" && message.url) {
let url = String(message.url);
if (url.includes("state=vscode") && vscode.env.uriScheme !== "vscode") {
url = url.replace("state=vscode", `state=vscode-${vscode.env.uriScheme}`);
}
vscode.env.openExternal(vscode.Uri.parse(url));
}
} catch (err) {
console.error("Error handling message from webview:", err);
}
});

// Clear stored webview when disposed
webviewView.onDidDispose(() => {
this._webviewView = undefined;
});
}
}
Loading