Skip to content

Commit 8623c46

Browse files
authored
Merge pull request #107 from geriyoco/main
🚀 v1.2.0
2 parents b49b538 + f510814 commit 8623c46

30 files changed

+883
-507
lines changed

.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.vscode-test-web/**
44
out/**
55
node_modules/**
6-
src/**
6+
src/**/*.ts
77
.gitignore
88
.yarnrc
99
webpack.config.js

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## [1.2.0] - 2022-09-21
4+
### Added
5+
- Telemetry for feature insights. We strive to be transparent at what we collect. See [telemetry.json](telemetry.json) for all the events we collect. Following the [Microsoft Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement), we do not collect any Personally Identifiable Information (PII). Check out the open-source repository at [here](https://github.com/geriyoco/vscode-image-gallery) to inspect the code. You can always opt-out of telemetry by setting `geriyocoImageGallery.isTelemetryEnabled` to `false` in your VS Code settings. Visit [here](https://code.visualstudio.com/docs/getstarted/telemetry) to learn more about VS Code telemetry.
6+
7+
### Fixed
8+
- Image sort preference was not respected when file watcher is involved, e.g. after an image is added, deleted, or modified.
9+
310
## [1.0.0] - 2022-09-12
411
### Added
512
- Support sorting by name, type, size, created time, and modified time
@@ -84,4 +91,4 @@
8491
- Gallery can be opened by right clicking folders in the Explorer sidebar
8592

8693
## [0.0.1] - 2022-04-10
87-
- Initial release
94+
- Initial release

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Image Gallery
2-
[![.github/workflows/vsce_publish.yml](https://github.com/geriyoco/vscode-image-gallery/actions/workflows/vsce_publish.yml/badge.svg?branch=production)](https://github.com/geriyoco/vscode-image-gallery/actions/workflows/vsce_publish.yml)
2+
3+
[![](https://github.com/geriyoco/vscode-image-gallery/actions/workflows/vsce_publish.yml/badge.svg?branch=production)](https://github.com/geriyoco/vscode-image-gallery/actions/workflows/vsce_publish.yml)
4+
[![](https://vsmarketplacebadge.apphb.com/version-short/geriyoco.vscode-image-gallery.svg?label=Version)](https://marketplace.visualstudio.com/items?itemName=geriyoco.vscode-image-gallery)
5+
[![](https://vsmarketplacebadge.apphb.com/installs-short/geriyoco.vscode-image-gallery.svg?label=Installs)](https://marketplace.visualstudio.com/items?itemName=geriyoco.vscode-image-gallery)
6+
[![](https://vsmarketplacebadge.apphb.com/rating-short/geriyoco.vscode-image-gallery.svg?label=Rating)](https://marketplace.visualstudio.com/items?itemName=GeriYoco.vscode-image-gallery&ssr=false#review-details)
37

48
A light-weighted extension that brings you the best image browsing experience in VS Code, especially for remote / cloud development.
59

@@ -8,7 +12,7 @@ A light-weighted extension that brings you the best image browsing experience in
812
- **Gallery**: Collapsible grid view of all images in the selected folder, including its sub-folders
913
- **Performance**: Lazy loading of images (tested on 10k images with a start-up time of 1.5s)
1014
- **Refresh**: Automatically update view as images are modified, added, or deleted
11-
- **Light**: Extension size less than 500 kB, installation time is typically negligible
15+
- **Light**: Extension size less than 1 MB, installation time is typically negligible
1216

1317
## Usage
1418
![demo](docs/demo-v1.0.0.gif)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

package-lock.json

Lines changed: 103 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-image-gallery",
33
"displayName": "Image Gallery",
44
"description": "Improve image browsing experience, especially for remote development.",
5-
"version": "1.0.0",
5+
"version": "1.2.0",
66
"publisher": "GeriYoco",
77
"repository": {
88
"type": "git",
@@ -17,9 +17,9 @@
1717
"vscode": "^1.65.0"
1818
},
1919
"categories": [
20+
"Visualization",
2021
"Data Science",
21-
"Machine Learning",
22-
"Visualization"
22+
"Machine Learning"
2323
],
2424
"keywords": [
2525
"image",
@@ -29,10 +29,9 @@
2929
"visualization"
3030
],
3131
"activationEvents": [
32-
"onCommand:vscodeImageGallery.openGallery",
32+
"onCommand:gryc.openGallery",
3333
"onWebviewPanel:gryc.gallery",
34-
"onWebviewPanel:gryc.viewer",
35-
"onCustomEditor:gryc.editor"
34+
"onCustomEditor:gryc.viewer"
3635
],
3736
"main": "./dist/extension.js",
3837
"contributes": {
@@ -68,12 +67,19 @@
6867
"type": "string",
6968
"default": null,
7069
"markdownDescription": "Variant collations for certain locales. Possible values include:\n- \"`compat`\" - Arabic\n- \"`dict`\" - Sinhala\n- \"`emoji`\" - root\n- \"`eor`\" - root\n- \"`phonebk`\" - German\n- \"`phonetic`\" - Lingala\n- \"`pinyin`\" - Chinese\n- \"`reformed`\" - Swedish\n- \"`stroke`\" - Chinese\n- \"`trad`\"\n- \"`zhuyin`\" - Chinese"
70+
},
71+
72+
"telemetry.geriyocoImageGallery.isTelemetryEnabled": {
73+
"type": "boolean",
74+
"default": true,
75+
"markdownDescription": "Enable / disable telemetry of this extension. If any of the global telemetry settings, including `telemetryLevel`, `isTelemetryEnabled`, `onDidChangeTelemetryEnabled`, rejects telemetry, this setting will be treated as `false`, i.e. this extension will not send any telemetry."
7176
}
7277
}
7378
},
7479
"customEditors": [
7580
{
76-
"viewType": "gryc.editor",
81+
"displayName": "Viewer (GeriYoco Image Gallery)",
82+
"viewType": "gryc.viewer",
7783
"priority": "default",
7884
"selector": [
7985
{
@@ -84,15 +90,15 @@
8490
],
8591
"commands": [
8692
{
87-
"command": "vscodeImageGallery.openGallery",
93+
"command": "gryc.openGallery",
8894
"title": "Open Image Gallery (GeriYoco) 🖼️",
8995
"category": "Image Gallery"
9096
}
9197
],
9298
"menus": {
9399
"explorer/context": [
94100
{
95-
"command": "vscodeImageGallery.openGallery",
101+
"command": "gryc.openGallery",
96102
"group": "2_grycImageGallery@1",
97103
"when": "explorerResourceIsFolder && !virtualWorkspace"
98104
}
@@ -122,7 +128,6 @@
122128
"@typescript-eslint/parser": "^5.16.0",
123129
"@vscode/test-electron": "^2.1.3",
124130
"@vscode/test-web": "^0.0.24",
125-
"@vscode/codicons": "^0.0.31",
126131
"eslint": "^8.11.0",
127132
"glob": "^7.2.0",
128133
"mocha": "^9.2.2",
@@ -133,6 +138,7 @@
133138
"webpack-cli": "^4.9.2"
134139
},
135140
"dependencies": {
141+
"@vscode/extension-telemetry": "^0.6.2",
136142
"panzoom": "^9.4.2"
137143
}
138144
}

src/custom_typings.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
declare module 'custom_typings' {
2+
import * as vscode from 'vscode';
3+
4+
export type TImage = {
5+
id: string, // hash256(imageUri.path), e.g. hash256("/c:/Users/image.jpg")
6+
uri: vscode.Uri,
7+
ext: string, // file extension in upper case, e.g. "JPG"
8+
size: number,
9+
mtime: number,
10+
ctime: number,
11+
status: "" | "refresh",
12+
};
13+
14+
export type TFolder = {
15+
id: string, // hash256(folderUri.path), e.g. hash256("/c:/Users")
16+
path: string, // folderUri.path, e.g. "/c:/Users"
17+
images: {
18+
[imageId: string]: TImage,
19+
},
20+
};
21+
}

src/extension.ts

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,16 @@
11
import * as vscode from 'vscode';
2-
import * as gallery from './gallery';
3-
import * as viewer from './viewer';
2+
import * as gallery from './gallery/gallery';
3+
import * as viewer from './viewer/viewer';
4+
import * as telemetry from './telemetry';
45

56
export function activate(context: vscode.ExtensionContext) {
6-
console.log('Welcome! VS Code extension "GeriYoco: Image Gallery" is now active.');
7-
8-
const viewerEditor = new viewer.ViewerCustomEditor(context);
9-
const viewerPanel = vscode.window.registerCustomEditorProvider(
10-
viewer.ViewerCustomEditor.viewType,
11-
viewerEditor,
12-
{
13-
supportsMultipleEditorsPerDocument: true,
14-
webviewOptions: {
15-
retainContextWhenHidden: true,
16-
}
17-
},
18-
);
19-
context.subscriptions.push(viewerPanel);
20-
21-
22-
const disposableGallery = vscode.commands.registerCommand(
23-
'vscodeImageGallery.openGallery',
24-
async (galleryFolder?: vscode.Uri) => {
25-
const panel = await gallery.createPanel(context, galleryFolder);
26-
panel.webview.onDidReceiveMessage(
27-
message => gallery.messageListener(message, context, panel.webview),
28-
undefined,
29-
context.subscriptions
30-
);
31-
32-
const fileWatcher = gallery.createFileWatcher(context, panel.webview, galleryFolder);
33-
context.subscriptions.push(fileWatcher);
34-
panel.onDidDispose(
35-
() => fileWatcher.dispose(),
36-
undefined,
37-
context.subscriptions
38-
);
39-
}
40-
);
41-
context.subscriptions.push(disposableGallery);
7+
telemetry.activate(context);
8+
gallery.activate(context);
9+
viewer.activate(context);
4210
}
4311

44-
export function deactivate() { }
12+
export function deactivate() {
13+
gallery.deactivate();
14+
viewer.deactivate();
15+
telemetry.deactivate();
16+
}

0 commit comments

Comments
 (0)