Decouple dialog refocus from PanelsService via FocusService
Dialogs only needed refocus(); injecting PanelsService boots a whole workspace, which secondary windows must not do. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
viewChild,
|
||||
} from '@angular/core';
|
||||
import { DialogsService, type PromptRequest } from '../dialogs.service';
|
||||
import { PanelsService } from '../panels.service';
|
||||
import { FocusService } from '../focus.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-prompt-dialog',
|
||||
@@ -54,7 +54,7 @@ export class PromptDialog {
|
||||
|
||||
private readonly box = viewChild.required<ElementRef<HTMLInputElement>>('box');
|
||||
private readonly dialogs = inject(DialogsService);
|
||||
private readonly panels = inject(PanelsService);
|
||||
private readonly focus = inject(FocusService);
|
||||
|
||||
constructor() {
|
||||
afterNextRender(() => {
|
||||
@@ -79,6 +79,6 @@ export class PromptDialog {
|
||||
|
||||
private close(): void {
|
||||
this.dialogs.prompt.set(null);
|
||||
this.panels.refocus();
|
||||
this.focus.bump();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user