Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't record undo events for enable/disable #8048

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4dcf406
fix(generators): Fix generator typings (#7727)
cpcallen Dec 19, 2023
511ee08
release: Merge branch 'develop' into rc/v11.0.0
cpcallen Dec 23, 2023
2a20a3a
release: Update version number to 11.0.0-beta.0
cpcallen Dec 23, 2023
4cc4bd5
fix(generators): Fix generator type declarations (#7750)
cpcallen Jan 8, 2024
c1a9d31
release: Update version number to 11.0.0-beta.1
cpcallen Jan 8, 2024
7ef47d1
chore(dependency)!: Bump JSDOM to v23, dropping node 16. (#7729)
BeksOmega Jan 8, 2024
0ad0adf
feat!: add serialization hooks to procedure models (#7740)
BeksOmega Jan 8, 2024
b1ef6ae
feat!: modify icons to use the rendering queue (#7743)
BeksOmega Jan 8, 2024
2e1297e
fix: snap to grid immediately (#7745)
BeksOmega Jan 9, 2024
75007a0
chore!: delete deprecations for v11. (#7732)
BeksOmega Jan 10, 2024
f317068
fix: have insertion markers use json serialization (#7730)
BeksOmega Jan 10, 2024
43f6df9
fix!: `rendered` meaning (#7747)
BeksOmega Jan 10, 2024
8c5f32b
fix: bump neighbours performance regression (#7748)
BeksOmega Jan 17, 2024
5db9b5b
fix: block initialization (#7777)
BeksOmega Jan 18, 2024
016bc73
fix: export save and load procedure (#7806)
BeksOmega Jan 25, 2024
b2b12f4
merge develop into rc/v11.0.0
BeksOmega Feb 2, 2024
abe4cf9
chore: fix v11 branch build (#7836)
BeksOmega Feb 7, 2024
ad0c0e3
fix: lua generators using None instead of nil (#7837)
BeksOmega Feb 7, 2024
48228e4
chore: merge develop into v11 to fix CI (#7893)
BeksOmega Mar 8, 2024
fc4228c
feat: add comment view (for workspace comments, and block comments fo…
BeksOmega Mar 11, 2024
30127db
fix: comment min size (#7915)
BeksOmega Mar 11, 2024
cac6b64
chore: merge develop into v11
BeksOmega Mar 12, 2024
5d4e120
chore: merge develop into v11.0.0
BeksOmega Mar 12, 2024
a5126d1
fix!: have disposing be true from start of dispose (#7891)
BeksOmega Mar 13, 2024
67c3aae
feat!: delete angle, colour, and multiline input fields and blocks (#…
rachel-fenichel Mar 13, 2024
e91dd20
fix!: classes on text input bubble to match comment view (#7935)
BeksOmega Mar 14, 2024
8821c83
feat: allow overriding comment icons (#7937)
BeksOmega Mar 15, 2024
b70da6d
chore: delete blockfactory_old (#7933)
rachel-fenichel Mar 15, 2024
8fc439f
feat: add headless workspace comment class (#7916)
BeksOmega Mar 15, 2024
c97b136
feat(build)!: Introduce `exports` section in `package.json` (#7822)
cpcallen Mar 15, 2024
10ffcb7
release: Merge branch 'develop' into rc/v11.0.0
cpcallen Mar 18, 2024
250cf90
release: Update version number to 11.0.0-beta.4
cpcallen Mar 18, 2024
93acb62
feat: rendered workspace comment (#7918)
BeksOmega Mar 19, 2024
fd1a02f
feat: have RenderedWorkspaceComment implement IBoundedElement and IRe…
BeksOmega Mar 20, 2024
407ff44
feat: add JSON serialization for workspace comments (#7927)
BeksOmega Mar 20, 2024
5462b21
fix: comment have XML save and load new workspace comments classes (#…
BeksOmega Mar 20, 2024
d3575ad
fix(typings): Restore inadvertently-deleted `typings/msg/msg.d.ts`; a…
cpcallen Mar 21, 2024
3934447
release: Update version number to 11.0.0-beta.5
cpcallen Mar 21, 2024
b0430d5
release: Update version number to 11.0.0-beta.6
cpcallen Mar 21, 2024
7ab4a92
fix: Don't record undo events for enable/disable
NeilFraser Apr 24, 2024
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
3 changes: 0 additions & 3 deletions blocks/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

// Former goog.module ID: Blockly.libraryBlocks

import * as colour from './colour.js';
import * as lists from './lists.js';
import * as logic from './logic.js';
import * as loops from './loops.js';
Expand All @@ -18,7 +17,6 @@ import * as variablesDynamic from './variables_dynamic.js';
import type {BlockDefinition} from '../core/blocks.js';

export {
colour,
lists,
logic,
loops,
Expand All @@ -35,7 +33,6 @@ export {
*/
export const blocks: {[key: string]: BlockDefinition} = Object.assign(
{},
colour.blocks,
lists.blocks,
logic.blocks,
loops.blocks,
Expand Down
112 changes: 0 additions & 112 deletions blocks/colour.ts

This file was deleted.

15 changes: 10 additions & 5 deletions blocks/loops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
createBlockDefinitionsFromJsonArray,
defineBlocks,
} from '../core/common.js';
import * as eventUtils from '../core/events/utils.js';
import '../core/field_dropdown.js';
import '../core/field_label.js';
import '../core/field_number.js';
Expand Down Expand Up @@ -372,12 +373,16 @@ const CONTROL_FLOW_IN_LOOP_CHECK_MIXIN = {
this.setWarningText(
enabled ? null : Msg['CONTROLS_FLOW_STATEMENTS_WARNING'],
);

if (!this.isInFlyout) {
const group = Events.getGroup();
// Makes it so the move and the disable event get undone together.
Events.setGroup(e.group);
this.setEnabled(enabled);
Events.setGroup(group);
try {
// There is no need to record the enable/disable change on the undo/redo
// list since the change will be automatically recreated when replayed.
eventUtils.setRecordUndo(false);
this.setEnabled(enabled);
} finally {
eventUtils.setRecordUndo(true);
}
}
},
};
Expand Down
21 changes: 12 additions & 9 deletions blocks/procedures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as Xml from '../core/xml.js';
import * as fieldRegistry from '../core/field_registry.js';
import * as xmlUtils from '../core/utils/xml.js';
import type {Abstract as AbstractEvent} from '../core/events/events_abstract.js';
import {Align} from '../core/inputs/input.js';
import {Align} from '../core/inputs/align.js';
import type {Block} from '../core/block.js';
import type {BlockSvg} from '../core/block_svg.js';
import type {BlockCreate} from '../core/events/events_block_create.js';
Expand All @@ -25,6 +25,7 @@ import type {
ContextMenuOption,
LegacyContextMenuOption,
} from '../core/contextmenu_registry.js';
import * as eventUtils from '../core/events/utils.js';
import {FieldCheckbox} from '../core/field_checkbox.js';
import {FieldLabel} from '../core/field_label.js';
import {FieldTextInput} from '../core/field_textinput.js';
Expand Down Expand Up @@ -921,10 +922,9 @@ const PROCEDURE_CALL_COMMON = {
type: 'field_label',
text: this.arguments_[i],
}) as FieldLabel;
const input = this.appendValueInput('ARG' + i)
this.appendValueInput('ARG' + i)
.setAlign(Align.RIGHT)
.appendField(newField, 'ARGNAME' + i);
input.init();
}
}
// Remove deleted inputs.
Expand All @@ -937,7 +937,6 @@ const PROCEDURE_CALL_COMMON = {
if (this.arguments_.length) {
if (!this.getField('WITH')) {
topRow.appendField(Msg['PROCEDURES_CALL_BEFORE_PARAMS'], 'WITH');
topRow.init();
}
} else {
if (this.getField('WITH')) {
Expand Down Expand Up @@ -1316,12 +1315,16 @@ const PROCEDURES_IFRETURN = {
} else {
this.setWarningText(Msg['PROCEDURES_IFRETURN_WARNING']);
}

if (!this.isInFlyout) {
const group = Events.getGroup();
// Makes it so the move and the disable event get undone together.
Events.setGroup(e.group);
this.setEnabled(legal);
Events.setGroup(group);
try {
// There is no need to record the enable/disable change on the undo/redo
// list since the change will be automatically recreated when replayed.
eventUtils.setRecordUndo(false);
this.setEnabled(legal);
} finally {
eventUtils.setRecordUndo(true);
}
}
},
/**
Expand Down
33 changes: 0 additions & 33 deletions blocks/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
createBlockDefinitionsFromJsonArray,
defineBlocks,
} from '../core/common.js';
import '../core/field_multilineinput.js';
import '../core/field_variable.js';
import {ValueInput} from '../core/inputs/value_input.js';

Expand All @@ -48,38 +47,6 @@ export const blocks = createBlockDefinitionsFromJsonArray([
'tooltip': '%{BKY_TEXT_TEXT_TOOLTIP}',
'extensions': ['text_quotes', 'parent_tooltip_when_inline'],
},
{
'type': 'text_multiline',
'message0': '%1 %2',
'args0': [
{
'type': 'field_image',
'src':
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpP' +
'U2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0' +
'U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjm' +
'RIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z88' +
'73zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5luj' +
'nYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiD' +
'MYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYX' +
'fwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4z' +
'wA5X2Z9AYnQrEAAAAASUVORK5CYII=',
'width': 12,
'height': 17,
'alt': '\u00B6',
},
{
'type': 'field_multilinetext',
'name': 'TEXT',
'text': '',
},
],
'output': 'String',
'style': 'text_blocks',
'helpUrl': '%{BKY_TEXT_TEXT_HELPURL}',
'tooltip': '%{BKY_TEXT_TEXT_TOOLTIP}',
'extensions': ['parent_tooltip_when_inline'],
},
{
'type': 'text_join',
'message0': '',
Expand Down
Loading
Loading