Skip to content
Merged
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
38a8b5f
Implement script asset error handling and UI improvements. Added a ne…
marklundin Aug 4, 2025
041824a
updated types
marklundin Aug 4, 2025
4060a4c
Enhance SerializableParsingError type by adding 'type' property to ca…
marklundin Aug 5, 2025
9bcf3cd
Update error handling in ESM script worker to include 'type' property…
marklundin Aug 5, 2025
4f221a8
updates
marklundin Aug 6, 2025
df62c31
Merge branch 'main' into feat-enhanced-script-parse
marklundin Aug 7, 2025
f5277cd
reverting the integration model markers
marklundin Aug 7, 2025
90154db
reverting model marker data in editor
marklundin Aug 7, 2025
a1b6025
Enhance script asset inspector with improved error handling and styling
marklundin Aug 8, 2025
cb8597b
Add icons for warning and error indicators in script asset inspector
marklundin Aug 8, 2025
03fdee8
Merge branch 'main' into feat-enhanced-script-parse
marklundin Aug 8, 2025
1da4ce1
linting
marklundin Aug 8, 2025
f23a33e
Merge branch 'feat-enhanced-script-parse' of https://github.com/playc…
marklundin Aug 8, 2025
a06c6f7
remove console open
marklundin Aug 8, 2025
a93ecaa
linting
marklundin Aug 8, 2025
da515c3
Merge branch 'main' into feat-enhanced-script-parse
marklundin Aug 11, 2025
5ba3a4c
Update @playcanvas/attribute-parser to version 1.10.1 in package.json…
marklundin Aug 11, 2025
2ee860e
Merge branch 'feat-enhanced-script-parse' of https://github.com/playc…
marklundin Aug 11, 2025
cb721ba
Merge branch 'main' into feat-enhanced-script-parse
marklundin Aug 11, 2025
e155950
Merge branch 'main' into feat-enhanced-script-parse
marklundin Aug 11, 2025
9ef77b2
refactor: streamline script attribute display logic in ScriptAssetIns…
marklundin Aug 11, 2025
bf2ba60
remove redundant error messages. These are now in editor console
marklundin Aug 11, 2025
f4e556d
feat: implement message-based communication for code editor initializ…
marklundin Aug 11, 2025
1b57e95
fix: enhance message handling for code editor initialization
marklundin Aug 11, 2025
832f8c7
Merge branch 'main' into feat-enhanced-script-parse
marklundin Aug 12, 2025
f8334cb
fix: remove redundant status error call in console event handler
marklundin Aug 12, 2025
a8998a1
refactor: improve error handling and styling in ScriptAssetInspector
marklundin Aug 12, 2025
0c3f55f
reverting the asset inspector changes. Separate PR
marklundin Aug 12, 2025
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
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@
"typescript": "5.6.3"
},
"dependencies": {
"@playcanvas/attribute-parser": "^1.10.0"
"@playcanvas/attribute-parser": "^1.10.1"
}
}
97 changes: 97 additions & 0 deletions sass/editor/_editor-asset-script-inspector.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
@use 'sass:color';

$bright-red: #e74c3c;
$bright-yellow: #f1c40f;
$status-info: #b1b8ba;
$status-error: $bright-red;
$status-warn: $bright-yellow;

.script-asset-inspector-container,
.script-asset-inspector-error-container {
display: flex;
Expand All @@ -6,6 +14,49 @@
margin: 6px;
}

.script-asset-inspector-attribute-error-container {
display: flex;
flex-direction: column;
border: none;
margin: 0;
background-color: #2c393c;

}

.pcui-label {
&.clickable-error {
cursor: pointer;
font-size: 11px;

&:hover {
text-decoration: underline;
}
}

&.pcui-error { // For simple errors
font-size: 11px;
}
}

.script-asset-inspector-script.pcui-error.clickable-error {
cursor: pointer;

&:hover {
text-decoration: underline;
}
}

.script-asset-inspector-attribute-error-title, .script-asset-inspector-attribute-warning-title {
font-family: inconsolatamedium, Monaco, Menlo, "Ubuntu Mono", Consolas, source-code-pro, monospace;
font-weight: normal;
font-size: 12px;
cursor: pointer;
}

.script-asset-inspector-attribute-error-title:hover, .script-asset-inspector-attribute-warning-title:hover {
text-decoration: underline;
}

.script-asset-inspector-error-container > .pcui-label {
white-space: normal;
}
Expand All @@ -28,6 +79,7 @@
white-space: normal;
}


.script-asset-inspector-attribute {
flex-grow: 1;
color: #b1b8ba;
Expand All @@ -43,3 +95,48 @@
.script-asset-inspector-attribute:hover {
background-color: #313e41;
}

.script-asset-inspector-warning {
color: $status-warn;
}

.script-asset-inspector-attribute-warning {
&::before {
@extend .font-icon;

content: '\E218';
margin-right: 6px;
}
}

.script-asset-inspector-attribute-warning.clickable-warning {
cursor: pointer;

&:hover {
text-decoration: underline;
}
}

.script-asset-inspector-attribute-error {
&::before {
@extend .font-icon;

content: '\E368';
margin-right: 6px;
}
}

// Tooltip warnings styling
.warnings-title.script-asset-inspector-warning {
// Normal text color for the header
}

.warning-item.script-asset-inspector-warning {
color: var(--pcui-warning-color);
font-size: 11px;
}

.open-console {
text-decoration: underline;
cursor: pointer;
}
7 changes: 4 additions & 3 deletions src/code-editor/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ class CodeEditor extends Editor {
this.once('loaded', () => {
this.emit('start');

// Send an event to the opener
const openerOrigin = new URL(document.referrer).origin;
window.opener.postMessage('start', openerOrigin);
if (window.opener) {
const openerOrigin = new URL(document.referrer).origin;
window.opener.postMessage('start', openerOrigin);
}

// if there is a merge in progress for our branch
if (config.self.branch.merge && !config.self.branch.merge.conflict) {
Expand Down
3 changes: 0 additions & 3 deletions src/editor/assets/handle-script-parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ editor.once('load', () => {
const errors = checkForErrors(res);
if (errors) {
editor.call('status:error', `There was an error while parsing script asset '${asset.get('name')}'`);
errors.forEach((error) => {
console.error('Error parsing script asset', error);
});
callback?.(null, res);
return;
}
Expand Down
1 change: 0 additions & 1 deletion src/editor/console/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ editor.on('load', () => {
return;
}
await addLog('error', msg, verboseMsg, onclick);
editor.call('status:error', msg);
});
editor.method('console:history', () => {
pendingHistory = true;
Expand Down
Loading