* Read view configuration options from BasesViewConfig.
()
| 294 | * Read view configuration options from BasesViewConfig. |
| 295 | */ |
| 296 | private readViewOptions(): void { |
| 297 | // Guard: config may not be set yet if called too early |
| 298 | if (!this.config || typeof this.config.get !== "function") { |
| 299 | tasknotesLogger.debug("[TaskListView] Config not available yet in readViewOptions", { |
| 300 | category: "configuration", |
| 301 | operation: "config-not-yet-readviewoptions", |
| 302 | }); |
| 303 | return; |
| 304 | } |
| 305 | |
| 306 | try { |
| 307 | this.subGroupPropertyId = this.config.getAsPropertyId("subGroup"); |
| 308 | // Read enableSearch toggle (default: false for backward compatibility) |
| 309 | const enableSearchValue = this.config.get("enableSearch"); |
| 310 | this.enableSearch = (enableSearchValue as boolean) ?? false; |
| 311 | const defaultCollapsedStateValue = this.config.get("defaultCollapsedState"); |
| 312 | |
| 313 | this.defaultCollapsedState = |
| 314 | defaultCollapsedStateValue === "Collapsed" || defaultCollapsedStateValue === "1" |
| 315 | ? "Collapsed" |
| 316 | : "Expanded"; |
| 317 | const expandedRelationshipFilterModeValue = this.config.get( |
| 318 | "expandedRelationshipFilterMode" |
| 319 | ); |
| 320 | this.expandedRelationshipFilterMode = normalizeExpandedRelationshipFilterMode( |
| 321 | expandedRelationshipFilterModeValue |
| 322 | ); |
| 323 | this.hideTopLevelSubtasks = this.config.get("hideTopLevelSubtasks") === true; |
| 324 | // Mark config as successfully loaded |
| 325 | this.configLoaded = true; |
| 326 | } catch (e) { |
| 327 | // Use defaults |
| 328 | tasknotesLogger.warn("[TaskListView] Failed to parse config:", { |
| 329 | category: "configuration", |
| 330 | operation: "parse-config", |
| 331 | error: e, |
| 332 | }); |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | private clearGroupingSnapshot(): void { |
| 337 | this.currentPrimaryGroupKeys = []; |