Improve script error dialogs #304
- Include the script's directory path #304. - Exclude Windows-specific instructions on non-Windows OS. - Standardize language across dialogs for consistency. Other supporting changes: - Add script diagnostics data collection from main process. - Document script file storage and execution tamper protection in SECURITY.md. - Remove redundant comment in `NodeReadbackFileWriter`. - Centralize error display for uniformity and simplicity. - Simpify `WindowVariablesValidator` to omit checks when not on the renderer process. - Improve and centralize Electron environment detection. - Use more emphatic language (don't worry) in error messages.
This commit is contained in:
@@ -15,7 +15,9 @@ describe('RendererApiProvider', () => {
|
||||
setupContext(context: RendererApiProviderTestContext): RendererApiProviderTestContext;
|
||||
readonly expectedValue: unknown;
|
||||
}
|
||||
const testScenarios: Record<PropertyKeys<Required<WindowVariables>>, WindowVariableTestCase> = {
|
||||
const testScenarios: Record<
|
||||
PropertyKeys<Required<WindowVariables>>,
|
||||
WindowVariableTestCase> = {
|
||||
isRunningAsDesktopApplication: {
|
||||
description: 'returns true',
|
||||
setupContext: (context) => context,
|
||||
@@ -32,9 +34,12 @@ describe('RendererApiProvider', () => {
|
||||
})(),
|
||||
log: expectFacade({
|
||||
instance: new LoggerStub(),
|
||||
setupContext: (c, logger) => c.withLogger(logger),
|
||||
setupContext: (c, instance) => c.withLogger(instance),
|
||||
}),
|
||||
dialog: expectIpcConsumer(IpcChannelDefinitions.Dialog),
|
||||
scriptDiagnosticsCollector: expectIpcConsumer(
|
||||
IpcChannelDefinitions.ScriptDiagnosticsCollector,
|
||||
),
|
||||
};
|
||||
Object.entries(testScenarios).forEach((
|
||||
[property, { description, setupContext, expectedValue }],
|
||||
@@ -109,10 +114,10 @@ class RendererApiProviderTestContext {
|
||||
|
||||
public provideWindowVariables() {
|
||||
return provideWindowVariables(
|
||||
() => this.log,
|
||||
() => this.os,
|
||||
this.apiFacadeCreator,
|
||||
this.ipcConsumerCreator,
|
||||
() => this.os,
|
||||
() => this.log,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user