MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / render

Method render

src/views/StatsView.ts:284–353  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

282 }
283
284 async render() {
285 const container = this.contentEl.createDiv({
286 cls: "tasknotes-plugin tasknotes-container stats-container stats-view",
287 });
288
289 // Header
290 const header = container.createDiv({ cls: "stats-header stats-view__header" });
291 new Setting(header)
292 .setName(this.plugin.i18n.translate("views.stats.taskProjectStats"))
293 .setHeading();
294
295 // Refresh button
296 const refreshButton = header.createEl("button", {
297 cls: "stats-refresh-button stats-view__refresh-button",
298 text: this.plugin.i18n.translate("views.stats.refreshButton"),
299 });
300 this.registerDomEvent(refreshButton, "click", () => {
301 void this.refreshStats();
302 });
303
304 // Filters section
305 const filtersSection = container.createDiv({ cls: "stats-section stats-view__section" });
306 new Setting(filtersSection)
307 .setName(this.plugin.i18n.translate("views.stats.sections.filters"))
308 .setHeading();
309 this.filtersEl = filtersSection.createDiv({ cls: "stats-filters stats-view__filters" });
310 this.renderFilters();
311
312 // Overview section
313 const overviewSection = container.createDiv({ cls: "stats-section stats-view__section" });
314 new Setting(overviewSection)
315 .setName(this.plugin.i18n.translate("views.stats.sections.overview"))
316 .setHeading();
317 this.overviewStatsEl = overviewSection.createDiv({
318 cls: "stats-overview-grid stats-view__overview-grid",
319 });
320
321 // Today's stats
322 const todaySection = container.createDiv({ cls: "stats-section stats-view__section" });
323 new Setting(todaySection)
324 .setName(this.plugin.i18n.translate("views.stats.sections.today"))
325 .setHeading();
326 this.todayStatsEl = todaySection.createDiv({ cls: "stats-grid stats-view__stats-grid" });
327
328 // This week's stats
329 const weekSection = container.createDiv({ cls: "stats-section stats-view__section" });
330 new Setting(weekSection)
331 .setName(this.plugin.i18n.translate("views.stats.sections.thisWeek"))
332 .setHeading();
333 this.weekStatsEl = weekSection.createDiv({ cls: "stats-grid stats-view__stats-grid" });
334
335 // This month's stats
336 const monthSection = container.createDiv({ cls: "stats-section stats-view__section" });
337 new Setting(monthSection)
338 .setName(this.plugin.i18n.translate("views.stats.sections.thisMonth"))
339 .setHeading();
340 this.monthStatsEl = monthSection.createDiv({ cls: "stats-grid stats-view__stats-grid" });
341

Callers 1

onOpenMethod · 0.95

Calls 5

refreshStatsMethod · 0.95
renderFiltersMethod · 0.95
setHeadingMethod · 0.65
translateMethod · 0.65
setNameMethod · 0.45

Tested by

no test coverage detected