Skip to content

Commit 3b4e6f5

Browse files
authored
Polishing session view (#7075)
- Adds back button - Adds open on web command - Use codicons - Fix overflow - Add state restore
1 parent c4afa24 commit 3b4e6f5

File tree

15 files changed

+362
-116
lines changed

15 files changed

+362
-116
lines changed

package.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
"onFileSystem:newIssue",
5252
"onFileSystem:pr",
5353
"onFileSystem:githubpr",
54-
"onFileSystem:review"
54+
"onFileSystem:review",
55+
"onWebviewPanel:pr.padawanSessionLogView"
5556
],
5657
"browser": "./dist/browser/extension",
5758
"l10n": "./dist/browser/extension",
@@ -1654,6 +1655,11 @@
16541655
"command": "padawan.openSessionLog",
16551656
"title": "Open Padawan Session Log",
16561657
"category": "%command.pull.request.category%"
1658+
},
1659+
{
1660+
"command": "sessionLog.openOnWeb",
1661+
"title": "Open on Web",
1662+
"icon": "$(globe)"
16571663
}
16581664
],
16591665
"viewsWelcome": [
@@ -2367,6 +2373,10 @@
23672373
{
23682374
"command": "review.copyPrLink",
23692375
"when": "github:inReviewMode"
2376+
},
2377+
{
2378+
"command": "sessionLog.openOnWeb",
2379+
"when": "false"
23702380
}
23712381
],
23722382
"view/title": [
@@ -2833,6 +2843,11 @@
28332843
"command": "pr.addFileComment",
28342844
"group": "navigation",
28352845
"when": "(resourceScheme == pr) || (resourcePath in github:viewedFiles) || (resourcePath in github:unviewedFiles)"
2846+
},
2847+
{
2848+
"command": "sessionLog.openOnWeb",
2849+
"group": "navigation",
2850+
"when": "activeWebviewPanelId == 'pr.padawanSessionLogView'"
28362851
}
28372852
],
28382853
"editor/content": [
@@ -3918,6 +3933,7 @@
39183933
"prepare": "husky install"
39193934
},
39203935
"devDependencies": {
3936+
"@shikijs/monaco": "^3.7.0",
39213937
"@types/chai": "^4.1.4",
39223938
"@types/glob": "7.1.3",
39233939
"@types/lru-cache": "^5.1.0",
@@ -3953,18 +3969,21 @@
39533969
"jsdom": "19.0.0",
39543970
"jsdom-global": "3.0.2",
39553971
"json5": "2.2.2",
3972+
"markdown-it": "^14.1.0",
39563973
"merge-options": "3.0.4",
39573974
"minimist": "^1.2.6",
39583975
"mkdirp": "1.0.4",
39593976
"mocha": "^9.0.1",
39603977
"mocha-junit-reporter": "1.23.0",
39613978
"mocha-multi-reporters": "1.1.7",
3979+
"monaco-editor-webpack-plugin": "^7.1.0",
39623980
"os-browserify": "^0.3.0",
39633981
"p-all": "^1.0.0",
39643982
"path-browserify": "1.0.1",
39653983
"process": "^0.11.10",
39663984
"raw-loader": "4.0.2",
39673985
"react-testing-library": "7.0.1",
3986+
"shiki": "^3.7.0",
39683987
"sinon": "9.0.0",
39693988
"source-map-support": "0.5.19",
39703989
"stream-browserify": "^3.0.0",
@@ -3984,7 +4003,7 @@
39844003
"dependencies": {
39854004
"@octokit/rest": "20.1.2",
39864005
"@octokit/types": "13.8.0",
3987-
"@shikijs/monaco": "^3.7.0",
4006+
"@vscode/codicons": "^0.0.36",
39884007
"@vscode/extension-telemetry": "0.7.5",
39894008
"@vscode/prompt-tsx": "^0.3.0-alpha.12",
39904009
"apollo-boost": "^0.4.9",
@@ -3997,12 +4016,10 @@
39974016
"fast-deep-equal": "^3.1.3",
39984017
"jszip": "^3.10.1",
39994018
"lru-cache": "6.0.0",
4000-
"markdown-it": "^14.1.0",
40014019
"marked": "^4.0.10",
40024020
"monaco-editor": "^0.52.2",
40034021
"react": "^16.12.0",
40044022
"react-dom": "^16.12.0",
4005-
"shiki": "^3.7.0",
40064023
"ssh-config": "4.1.1",
40074024
"stream-http": "^3.2.0",
40084025
"tunnel": "0.0.6",
@@ -4012,4 +4029,4 @@
40124029
"vsls": "^0.3.967"
40134030
},
40144031
"license": "MIT"
4015-
}
4032+
}

src/common/timelineEvent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export interface ReopenedEvent {
151151
createdAt: string;
152152
}
153153

154-
export interface SessionLinkInfo {
154+
export interface SessionPullInfo {
155155
host: string;
156156
owner: string;
157157
repo: string;
@@ -163,7 +163,7 @@ export interface CopilotStartedEvent {
163163
event: EventType.CopilotStarted;
164164
createdAt: string;
165165
onBehalfOf: IAccount;
166-
sessionLink?: SessionLinkInfo;
166+
sessionLink?: SessionPullInfo;
167167
}
168168

169169
export interface CopilotFinishedEvent {
@@ -178,7 +178,7 @@ export interface CopilotFinishedErrorEvent {
178178
event: EventType.CopilotFinishedError;
179179
createdAt: string;
180180
onBehalfOf: IAccount;
181-
sessionLink: SessionLinkInfo;
181+
sessionLink: SessionPullInfo;
182182
}
183183

184184
export type TimelineEvent = CommitEvent | ReviewEvent | CommentEvent | NewCommitsSinceReviewEvent | MergedEvent | AssignEvent | UnassignEvent | HeadRefDeleteEvent | CrossReferencedEvent | ClosedEvent | ReopenedEvent | CopilotStartedEvent | CopilotFinishedEvent | CopilotFinishedErrorEvent;

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ async function init(
249249

250250
context.subscriptions.push(new GitLensIntegration());
251251

252-
const sessionLogViewManager = new SessionLogViewManager(credentialStore, context);
252+
const sessionLogViewManager = new SessionLogViewManager(credentialStore, context, reposManager, telemetry);
253253
context.subscriptions.push(sessionLogViewManager);
254254

255255
await vscode.commands.executeCommand('setContext', 'github:initialized', true);

src/github/pullRequestOverview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { disposeAll } from '../common/lifecycle';
1212
import Logger from '../common/logger';
1313
import { DEFAULT_MERGE_METHOD, PR_SETTINGS_NAMESPACE } from '../common/settingKeys';
1414
import { ITelemetry } from '../common/telemetry';
15-
import { ReviewEvent, SessionLinkInfo } from '../common/timelineEvent';
15+
import { ReviewEvent, SessionPullInfo } from '../common/timelineEvent';
1616
import { asPromise, formatError } from '../common/utils';
1717
import { IRequestMessage, PULL_REQUEST_OVERVIEW_VIEW_TYPE } from '../common/webview';
1818
import { SessionLogViewManager } from '../view/sessionLogView';
@@ -454,7 +454,7 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
454454
}
455455
}
456456

457-
private async openSessionLog(_message: IRequestMessage<{ link: SessionLinkInfo }>): Promise<void> {
457+
private async openSessionLog(_message: IRequestMessage<{ link: SessionPullInfo }>): Promise<void> {
458458
try {
459459
SessionLogViewManager.instance?.openForPull(this._item);
460460
} catch (e) {

src/github/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ export function parseSelectRestTimelineEvents(
10021002
events: OctokitCommon.ListEventsForTimelineResponse[]
10031003
): Common.TimelineEvent[] {
10041004
const parsedEvents: Common.TimelineEvent[] = [];
1005-
const sessionLink: Common.SessionLinkInfo = {
1005+
const sessionLink: Common.SessionPullInfo = {
10061006
host: issueModel.githubRepository.remote.gitProtocol.host,
10071007
owner: issueModel.githubRepository.remote.owner,
10081008
repo: issueModel.githubRepository.remote.repositoryName,

0 commit comments

Comments
 (0)