spinner overlay fixed

This commit is contained in:
Alastair Grant 2025-03-26 16:59:11 +01:00
parent 88a7e7f61d
commit 28ad7b3381
3 changed files with 15 additions and 10 deletions

View file

@ -47,9 +47,17 @@ export default class QuestionDocumentView extends ItemView {
private showSpinner(): HTMLDivElement {
const container = this.containerEl.querySelector(".test-document-container") || this.containerEl;
const container = this.containerEl;
const spinnerOverlay = container.createDiv({ cls: "spinner-overlay" });
const contentHeight = Math.max(
container.scrollHeight,
container.querySelector(".test-document-container")?.scrollHeight || 0
);
spinnerOverlay.style.height = `${contentHeight}px`;
const spinnerFixed = spinnerOverlay.createDiv({ cls: "spinner-fixed-center" });
spinnerFixed.createDiv({ cls: "spinner" });
@ -62,7 +70,9 @@ export default class QuestionDocumentView extends ItemView {
}
private hideSpinner(spinnerOverlay: HTMLDivElement) {
spinnerOverlay.remove();
if (spinnerOverlay) {
spinnerOverlay.detach();
}
}
private adjustTextareaHeight(textarea: HTMLTextAreaElement): void {

View file

@ -14,8 +14,6 @@ export default class SettingsTab extends PluginSettingTab {
const { containerEl } = this;
containerEl.empty();
containerEl.createEl("h2", { text: "RAG Test Plugin Settings" });
new Setting(containerEl)
.setName("LLM provider")
.setDesc("Select which LLM provider you want to use for generating and marking tests")
@ -192,7 +190,7 @@ export default class SettingsTab extends PluginSettingTab {
}
// About section
containerEl.createEl("h3", { text: "About API Keys" });
new Setting(containerEl).setName("About API keys").setHeading();
const apiInfoDiv = containerEl.createDiv({ cls: "api-key-info" });
apiInfoDiv.createEl("p", {
text: "Your API keys are stored locally in your vault and are only used to communicate with the selected LLM provider."

View file

@ -573,6 +573,7 @@
z-index: 1000;
background-color: rgba(0, 0, 0, 0.7);
pointer-events: all;
min-height: 100%; /* Ensure it's at least as tall as the container */
}
.spinner-fixed-center {
@ -649,10 +650,6 @@
transition: height 0.1s ease-out, border-color 0.2s ease;
}
.test-container-relative {
position: relative;
}
textarea.answer-input {
min-height: 60px;
max-height: 300px;