Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install libsecret-1
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev

- name: Use Node.js "20.x"
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -56,7 +59,7 @@ jobs:

- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: tools/playwright/test-results
14 changes: 8 additions & 6 deletions packages/comments/src/browser/comments-zone.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class CommentsZoneWidget extends ResizeZoneWidget implements ICommentsZon
@Autowired(ICommentsFeatureRegistry)
private readonly commentsFeatureRegistry: ICommentsFeatureRegistry;

private wrapperRoot: ReactDOM.Root;
private wrapperRoot: ReactDOM.Root | undefined;

private _editor: IEditor;

Expand All @@ -185,29 +185,31 @@ export class CommentsZoneWidget extends ResizeZoneWidget implements ICommentsZon
private _onHide = new Emitter<void>();
public onHide: Event<void> = this._onHide.event;

constructor(editor: IEditor, thread: ICommentsThread, options?: IOptions) {
constructor(editor: IEditor, public readonly thread: ICommentsThread, options?: IOptions) {
super(editor.monacoEditor, thread.range, {
...options,
showInHiddenAreas: true,
});
this._editor = editor;

const _wrapper = document.createElement('div');
this._isShow = !thread.isCollapsed.get();

const _wrapper = document.createElement('div');
this._container.appendChild(_wrapper);
this.observeContainer(_wrapper);
const customRender = this.commentsFeatureRegistry.getZoneWidgetRender();

this.wrapperRoot = ReactDOM.createRoot(_wrapper);
this.wrapperRoot.render(
<ConfigProvider value={this.appConfig}>
{customRender ? customRender(thread, this) : <CommentsZone thread={thread} widget={this} />}
{customRender ? customRender(this.thread, this) : <CommentsZone thread={this.thread} widget={this} />}
</ConfigProvider>,
);

this.addDispose({
dispose: () => {
this.wrapperRoot.unmount();
this.wrapperRoot?.unmount();
this.wrapperRoot = undefined;
},
});
}
Expand All @@ -227,7 +229,7 @@ export class CommentsZoneWidget extends ResizeZoneWidget implements ICommentsZon
}

public hide() {
super.dispose();
super.hide();
this._isShow = false;
this._onHide.fire();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/comments/src/browser/comments.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ export class CommentsService extends Disposable implements ICommentsService {
}
} else {
// 临时隐藏,当切回来时会恢复
thread.hideWidgetsByDispose();
thread.hide();
}
return thread;
})
Expand Down
Loading