Skip to content

Commit

Permalink
Merge branch 'main' into reactive-toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py authored Oct 9, 2024
2 parents 44604d7 + 1b9ad11 commit eda079a
Show file tree
Hide file tree
Showing 26 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/base/src/3dview/mainview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export class MainView extends React.Component<IProps, IStates> {
DEFAULT_EDGE_COLOR.set(getCSSVariableColor(DEFAULT_EDGE_COLOR_CSS));
SELECTED_MESH_COLOR.set(getCSSVariableColor(SELECTED_MESH_COLOR_CSS));

this._camera = new THREE.PerspectiveCamera(90, 2, 0.1, 1000);
this._camera = new THREE.PerspectiveCamera(50, 2, 0.1, 1000);
this._camera.position.set(8, 8, 8);
this._camera.up.set(0, 0, 1);

Expand Down Expand Up @@ -1266,7 +1266,7 @@ export class MainView extends React.Component<IProps, IStates> {
this._scene.remove(this._camera);

if (this._cameraSettings.type === 'Perspective') {
this._camera = new THREE.PerspectiveCamera(90, 2, 0.1, 1000);
this._camera = new THREE.PerspectiveCamera(50, 2, 0.1, 1000);
} else {
const width = this.divRef.current?.clientWidth || 0;
const height = this.divRef.current?.clientHeight || 0;
Expand Down
8 changes: 8 additions & 0 deletions packages/base/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,10 @@ export function addCommands(
icon: wireframeIcon
});

tracker.currentChanged.connect(() => {
commands.notifyCommandChanged(CommandIDs.wireframe);
});

commands.addCommand(CommandIDs.chamfer, {
label: trans.__('Make chamfer'),
isEnabled: () => {
Expand Down Expand Up @@ -1071,6 +1075,10 @@ export function addCommands(
}
});

tracker.currentChanged.connect(() => {
commands.notifyCommandChanged(CommandIDs.updateClipView);
});

commands.addCommand(CommandIDs.exportJcad, {
label: trans.__('Export to .jcad'),
isEnabled: () => {
Expand Down
2 changes: 1 addition & 1 deletion python/jupytercad_app/src/app/plugins/launcher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const launcherPlugin: JupyterFrontEndPlugin<void> = {
if (!label) {
continue;
}
if (label.innerHTML.includes('New JCAD File')) {
if (label.innerHTML.includes('CAD File')) {
const els = element
.getElementsByClassName('jp-Launcher-sectionTitle')
?.item(0);
Expand Down
5 changes: 3 additions & 2 deletions python/jupytercad_core/src/jcadplugin/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ const activate = (
mimeTypes: ['text/json'],
extensions: ['.jcad', '.JCAD'],
fileFormat: 'text',
contentType: 'jcad'
contentType: 'jcad',
icon: logoIcon
});

const jcadSharedModelFactory: SharedDocumentFactory = () => {
Expand All @@ -111,7 +112,7 @@ const activate = (
});

app.commands.addCommand(CommandIDs.createNew, {
label: args => 'New JCAD File',
label: args => 'CAD File',
caption: 'Create a new JCAD Editor',
icon: logoIcon,
execute: async args => {
Expand Down
4 changes: 3 additions & 1 deletion python/jupytercad_core/src/stepplugin/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { IThemeManager, WidgetTracker } from '@jupyterlab/apputils';
import { JupyterCadStepModelFactory } from './modelfactory';
import { JupyterCadWidgetFactory } from '../factory';
import { JupyterCadStepDoc } from './model';
import { logoIcon } from '@jupytercad/base';

const FACTORY = 'JupyterCAD STEP Viewer';

Expand Down Expand Up @@ -53,7 +54,8 @@ const activate = (
mimeTypes: ['text/json'],
extensions: ['.step', '.STEP'],
fileFormat: 'text',
contentType: 'step'
contentType: 'step',
icon: logoIcon
});

const stepSharedModelFactory: SharedDocumentFactory = () => {
Expand Down
4 changes: 3 additions & 1 deletion python/jupytercad_core/src/stlplugin/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { IThemeManager, WidgetTracker } from '@jupyterlab/apputils';
import { JupyterCadStlModelFactory } from './modelfactory';
import { JupyterCadWidgetFactory } from '../factory';
import { JupyterCadStlDoc } from './model';
import { logoIcon } from '@jupytercad/base';

const FACTORY = 'JupyterCAD STL Viewer';

Expand Down Expand Up @@ -53,7 +54,8 @@ const activate = (
mimeTypes: ['text/json'],
extensions: ['.stl', '.STL'],
fileFormat: 'text',
contentType: 'stl'
contentType: 'stl',
icon: logoIcon
});

const stlSharedModelFactory: SharedDocumentFactory = () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions ui-tests/tests/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,9 @@ test.describe('UI Test', () => {

test.describe('JCAD creation test', () => {
test.describe('Extension activation test', () => {
test('should create a new JCAD file', async ({ page, request }) => {
test('should create a CAD File', async ({ page, request }) => {
await page.goto();
await page
.getByLabel('notebook content')
.getByText('New JCAD File')
.click();
await page.getByLabel('notebook content').getByText('CAD File').click();

await page.getByTitle('New Box').getByRole('button').click();
await page.getByRole('button', { name: 'Submit' }).click();
Expand Down
Binary file modified ui-tests/tests/ui.spec.ts-snapshots/JCAD-Console-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ui.spec.ts-snapshots/JCAD-Modified-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ui.spec.ts-snapshots/JCAD-New-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ui.spec.ts-snapshots/JCAD-Redo-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ui.spec.ts-snapshots/JCAD-Undo-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ui.spec.ts-snapshots/Render-fan-stl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/tests/ui.spec.ts-snapshots/Render-test-jcad-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eda079a

Please sign in to comment.