From 1ee82a68b0970508aa2845338127323a09164f46 Mon Sep 17 00:00:00 2001 From: Guy Sandler Date: Thu, 15 Oct 2026 16:41:11 -0700 Subject: [PATCH] widget system done! --- _locales/en/messages.json | 11 ++-- css/content.css | 12 ++-- css/popup.css | 18 +++++- html/popup.html | 114 +++++++++++++++++++++----------------- js/content.js | 98 ++++++++++++++++++++++++++++++-- js/popup.js | 70 ++++++++++++++++------- 6 files changed, 237 insertions(+), 86 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index b40a7ca..cbd0ecf 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -131,11 +131,14 @@ "widget_position": { "message": "Position" }, - "widget_order_top": { - "message": "Top container order" + "widget_order_title": { + "message": "Widget order" }, - "widget_order_bottom": { - "message": "Bottom container order" + "widget_short_notes": { + "message": "Notes" + }, + "widget_short_gpa": { + "message": "GPA" }, "grade_settings": { "message": "Grade Settings" diff --git a/css/content.css b/css/content.css index e78001c..51d8d08 100644 --- a/css/content.css +++ b/css/content.css @@ -448,18 +448,20 @@ container-style card and the expanded calculator keeps full width. */ .canvasrefined-gpa-card.container-mode {width:100%;box-sizing:border-box;margin:0 0 4px;display:block;} .canvasrefined-gpa.container-mode {margin:0 0 18px;} -/* Dashboard notes placed inside the card grid (before/after cards): shaped - like a course card (262px wide, rounded, Canvas card shadow) and kept at a - similar height so the grid row stays balanced. */ +/* Dashboard notes placed inside the card grid (before/after cards): styled + exactly like the GPA card / Canvas course cards — 262px wide, rounded, + card shadow, and the same 36px gutters so it aligns in the grid. */ .canvasrefined-dashboard-notes.in-cards { width: 262px; min-height: 260px; box-sizing: border-box; - margin: 0; + margin: 36px 0 0 36px; + border: none; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,.3); - display: flex; + display: inline-flex; flex-direction: column; + vertical-align: top; } .canvasrefined-dashboard-notes.in-cards .canvasrefined-notes-surface {flex: 1; display: flex; flex-direction: column;} .canvasrefined-dashboard-notes.in-cards .canvasrefined-notes-editor, diff --git a/css/popup.css b/css/popup.css index c83105f..1f20283 100644 --- a/css/popup.css +++ b/css/popup.css @@ -381,11 +381,27 @@ input[type="checkbox"]:checked {background: #8dd28d;} /* Widget container-order strips (Widgets tab): boxes sized by each widget's % of the shared container, separated by draggable dividers. */ -.widget-order-strip {display:flex;align-items:stretch;width:100%;height:64px;margin-top:8px;} +.widget-order-strip {display:flex;align-items:stretch;width:100%;height:44px;margin-top:6px;} .wos-item {border:1px solid #ffffff2e;background:var(--inputbg);border-radius:7px;display:flex;align-items:center;padding:0 10px;font-size:12px;color:#e2e2e2;min-width:0;overflow:hidden;white-space:nowrap;cursor:grab;user-select:none;} .wos-item.dragging {opacity:.45;} .wos-divider {flex:0 0 6px;width:6px;align-self:stretch;margin:0 5px;border-radius:3px;background:#8a8a8a;cursor:col-resize;} .wos-divider:hover {background:#e2e2e2;} +/* Widget order box (Widgets tab): one shared "Widget order" rectangle with + a section per area (Top / Before cards / After cards / Bottom); each + section shows only when 2+ enabled widgets share that area. */ +.widget-order-section + .widget-order-section {margin-top: 16px;} +.widget-order-label {font-size: 12px;color: #c7c7c7;} +.widget-order-strip {margin-top: 6px;} +/* Before/after strips: sequence only, so boxes share the width evenly with + a gap between them instead of draggable dividers. */ +.widget-order-strip[data-area="cards_start"], +.widget-order-strip[data-area="cards_end"] {column-gap: 8px;} +.widget-order-strip[data-area="cards_start"] .wos-item, +.widget-order-strip[data-area="cards_end"] .wos-item {flex: 1 1 0;} +/* Widget sections (Widgets tab): two side-by-side columns; add future + widgets as one more .option-container inside .widgets-grid. */ +.widgets-grid {display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:stretch;margin-top:8px;} +.widgets-grid .option-container {margin-top:0;box-sizing:border-box;} /* Widget position dropdowns (Widgets tab) — mirror #todo_timeframe exactly: same font, padding, radius, colors and full-width stacked layout. */ .widget-pos {font-size:12px;background:var(--inputbg);color:#e2e2e2;border:none;border-radius:7px;padding:6px 8px;font-family:inherit;width:100%;box-sizing:border-box;margin-top:2px;margin-bottom:6px;color-scheme:dark;} diff --git a/html/popup.html b/html/popup.html index dff1aab..7c68f0c 100644 --- a/html/popup.html +++ b/html/popup.html @@ -1113,66 +1113,78 @@

Widgets

- +