Skip to content

Feat/frontend update#125

Merged
DaTiC0 merged 3 commits into
mainfrom
feat/frontend-update
May 4, 2026
Merged

Feat/frontend update#125
DaTiC0 merged 3 commits into
mainfrom
feat/frontend-update

Conversation

@DaTiC0

@DaTiC0 DaTiC0 commented May 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • What changed?
  • Why was it needed?

Validation

  • Local checks passed (make test)
  • Runtime check done where relevant (make health)
  • CI checks are green

AI-Assisted Review (if applicable)

  • I used AI assistance for parts of this change
  • I manually reviewed all AI-generated code
  • I verified no secrets/credentials were added

Risk & Rollback

  • Risk level: Low / Medium / High
  • Rollback plan (if needed):

Summary by Sourcery

Improve MD3 frontend styling consistency and navigation affordances across device and MQTT log pages.

Enhancements:

  • Adjust input, placeholder, and utility styles for better contrast and consistent accent usage.
  • Unify ghost button appearance and introduce danger and accent utility classes for reuse.
  • Fix layout structure in the index power usage section and add dashboard navigation from devices and MQTT log views.

@sourcery-ai

sourcery-ai Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Frontend styling and layout refinements for inputs, buttons, and grid layouts, plus navigation improvements on devices and MQTT log pages.

File-Level Changes

Change Details Files
Improve text input readability and placeholder styling, and expand grid/layout utility classes.
  • Change .md-input text color from hardcoded white to var(--text-primary) and set caret-color to match
  • Add .md-input::placeholder rule using var(--text-secondary) and full-opacity placeholders
  • Introduce .summary-box--full utility to span full grid width
  • Add .u-opacity-6 utility for reduced opacity text
static/md3.css
Standardize button styles and introduce new accent/ghost/danger helpers.
  • Add .accent-text and .accent-checkbox helpers for accent-colored text and form controls
  • Introduce .u-danger-button for red destructive actions
  • Update .u-ghost-button to include a border and use bg-widget instead of transparent
static/md3.css
Fix layout structure in the index power usage card.
  • Adjust indentation and ensure the flex-column wrapper around the Main Studio icon/text is correctly nested inside the flex container
templates/index.html
Improve navigation from the devices page back to the dashboard.
  • Add flex-row container with a Back to Dashboard ghost-styled button linking to routes.index
templates/devices.html
Unify MQTT log page button styling with shared ghost button styles.
  • Replace inline-styled refresh button with md-button u-ghost-button while keeping sizing inline styles
  • Replace inline-styled back link button with md-button u-ghost-button and remove explicit background/border styling
templates/mqtt_log.html

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates input and button styling, adds several CSS utility classes and a wifi icon, and includes navigation improvements. Feedback highlights opportunities to improve CSS maintainability by removing redundant classes and !important flags, and suggests replacing inline styles with utility classes for better consistency.

Comment thread static/md3.css Outdated
.u-width-auto { width: auto; }
.span-2 { grid-column: span 2; }
.span-full { grid-column: span 3; }
.summary-box--full { grid-column: span 3; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The class .summary-box--full is redundant as it is identical to the existing .span-full class defined on the line above. Reusing existing utility classes helps keep the CSS file smaller and more maintainable.

Comment thread static/md3.css
.accent-text { color: var(--accent); }
.accent-checkbox { accent-color: var(--accent); }
.u-danger-button { background: #ef4444; color: #fff; border: none; }
.u-ghost-button { background: var(--bg-widget) !important; border: 1px solid var(--border) !important; color: var(--text-secondary) !important; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The use of !important is generally discouraged because it overrides the natural CSS cascade and makes future styling adjustments difficult. Since .u-ghost-button is defined after .md-button, it will naturally override the base styles when both classes are applied to the same element. Consider removing these flags.

.u-ghost-button { background: var(--bg-widget); border: 1px solid var(--border); color: var(--text-secondary); }

Comment thread templates/devices.html Outdated
</div>

<div class="flex-row u-margin-top-2">
<a href="{{ url_for('routes.index') }}" class="md-button u-ghost-button" style="width: auto; padding: 0.75rem 2rem;">Back to Dashboard</a>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid using inline styles for layout and dimensions. You can use the existing .u-width-auto utility class instead of style="width: auto;". For the padding, consider defining a reusable utility class or a button modifier (e.g., .md-button--compact) to ensure consistency across the application.

            <a href="{{ url_for('routes.index') }}" class="md-button u-ghost-button u-width-auto" style="padding: 0.75rem 2rem;">Back to Dashboard</a>

Comment thread templates/mqtt_log.html Outdated
Comment on lines +70 to +71
<button class="md-button u-ghost-button" style="width: auto; padding: 0.75rem 2rem;" onclick="location.reload()">Refresh Log</button>
<a href="{{ url_for('routes.index') }}" class="md-button u-ghost-button" style="width: auto; padding: 0.75rem 2rem;">Back to Dashboard</a>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These buttons use duplicated inline styles. It is better to use utility classes like .u-width-auto and define a shared class for the specific padding to ensure a consistent UI and easier maintenance.

            <button class="md-button u-ghost-button u-width-auto" style="padding: 0.75rem 2rem;" onclick="location.reload()">Refresh Log</button>
            <a href="{{ url_for('routes.index') }}" class="md-button u-ghost-button u-width-auto" style="padding: 0.75rem 2rem;">Back to Dashboard</a>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • Consider replacing the repeated inline button styles (width/padding/background/border) with shared utility or variant classes so the button appearance is controlled purely via CSS instead of templates.
  • The new .u-danger-button uses a hard-coded red color; aligning this with existing theme variables (e.g., a --danger token) would keep the palette consistent and make future theme changes easier.
  • The new .summary-box--full class overlaps with the existing .span-full grid utility; consider reusing or extending the existing utility to avoid duplicating grid-span behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider replacing the repeated inline button styles (width/padding/background/border) with shared utility or variant classes so the button appearance is controlled purely via CSS instead of templates.
- The new `.u-danger-button` uses a hard-coded red color; aligning this with existing theme variables (e.g., a `--danger` token) would keep the palette consistent and make future theme changes easier.
- The new `.summary-box--full` class overlaps with the existing `.span-full` grid utility; consider reusing or extending the existing utility to avoid duplicating grid-span behavior.

## Individual Comments

### Comment 1
<location path="static/md3.css" line_range="259" />
<code_context>
-.u-ghost-button { background: var(--bg-widget) !important; color: var(--text-secondary) !important; }
+.accent-text { color: var(--accent); }
+.accent-checkbox { accent-color: var(--accent); }
+.u-danger-button { background: #ef4444; color: #fff; border: none; }
+.u-ghost-button { background: var(--bg-widget) !important; border: 1px solid var(--border) !important; color: var(--text-secondary) !important; }
 .u-margin-left-auto { margin-left: auto; }
</code_context>
<issue_to_address>
**suggestion:** Align danger button colors with theme variables rather than hardcoded hex values.

Using `#ef4444` instead of a theme token makes this button harder to keep consistent across themes and future palette changes. Please hook this class up to the existing semantic danger/destructive color variable so it stays aligned with the design system.

Suggested implementation:

```
.u-danger-button { background: var(--color-danger); color: var(--color-on-danger); border: none; }

```

The exact variable names for the semantic danger colors may differ in your design system (common alternatives are `--danger`, `--danger-bg`, `--danger-foreground`, `--md-sys-color-error`, etc.). Please update `--color-danger` and `--color-on-danger` in this change to match the existing danger/destructive tokens defined elsewhere in `md3.css` or your global theme variables so that this class is fully aligned with your design system.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread static/md3.css Outdated
.u-ghost-button { background: var(--bg-widget) !important; color: var(--text-secondary) !important; }
.accent-text { color: var(--accent); }
.accent-checkbox { accent-color: var(--accent); }
.u-danger-button { background: #ef4444; color: #fff; border: none; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Align danger button colors with theme variables rather than hardcoded hex values.

Using #ef4444 instead of a theme token makes this button harder to keep consistent across themes and future palette changes. Please hook this class up to the existing semantic danger/destructive color variable so it stays aligned with the design system.

Suggested implementation:

.u-danger-button { background: var(--color-danger); color: var(--color-on-danger); border: none; }

The exact variable names for the semantic danger colors may differ in your design system (common alternatives are --danger, --danger-bg, --danger-foreground, --md-sys-color-error, etc.). Please update --color-danger and --color-on-danger in this change to match the existing danger/destructive tokens defined elsewhere in md3.css or your global theme variables so that this class is fully aligned with your design system.

@DaTiC0

DaTiC0 commented May 4, 2026

Copy link
Copy Markdown
Owner Author

@copilot Please address the comments from this code review:

Overall Comments

  • Consider replacing the repeated inline button styles (width/padding/background/border) with shared utility or variant classes so the button appearance is controlled purely via CSS instead of templates.
  • The new .u-danger-button uses a hard-coded red color; aligning this with existing theme variables (e.g., a --danger token) would keep the palette consistent and make future theme changes easier.
  • The new .summary-box--full class overlaps with the existing .span-full grid utility; consider reusing or extending the existing utility to avoid duplicating grid-span behavior.

Individual Comments

Comment 1

-.u-ghost-button { background: var(--bg-widget) !important; color: var(--text-secondary) !important; } +.accent-text { color: var(--accent); } +.accent-checkbox { accent-color: var(--accent); } +.u-danger-button { background: #ef4444; color: #fff; border: none; } +.u-ghost-button { background: var(--bg-widget) !important; border: 1px solid var(--border) !important; color: var(--text-secondary) !important; } .u-margin-left-auto { margin-left: auto; } **suggestion:** Align danger button colors with theme variables rather than hardcoded hex values.

Using #ef4444 instead of a theme token makes this button harder to keep consistent across themes and future palette changes. Please hook this class up to the existing semantic danger/destructive color variable so it stays aligned with the design system.

Suggested implementation:

.u-danger-button { background: var(--color-danger); color: var(--color-on-danger); border: none; }

The exact variable names for the semantic danger colors may differ in your design system (common alternatives are --danger, --danger-bg, --danger-foreground, --md-sys-color-error, etc.). Please update --color-danger and --color-on-danger in this change to match the existing danger/destructive tokens defined elsewhere in md3.css or your global theme variables so that this class is fully aligned with your design system.
</issue_to_address>

…ss, add button--compact variant

Agent-Logs-Url: https://github.com/DaTiC0/smart-google/sessions/0b2abbe2-8aef-4402-8ae2-5e46e1a6e7d0

Co-authored-by: DaTiC0 <13198638+DaTiC0@users.noreply.github.com>

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor

@copilot Please address the comments from this code review:

Overall Comments

...

Addressed all three points in commit 62c5ae7:

  1. Inline button styles → Added .md-button--compact { width: auto; padding: 0.75rem 2rem; } variant class and replaced all three occurrences of style="width: auto; padding: 0.75rem 2rem;" in devices.html and mqtt_log.html with this class.

  2. --danger token → Added --danger: #ef4444; to :root and updated .u-danger-button to use var(--danger) instead of the hardcoded value.

  3. .summary-box--full duplicate → Removed .summary-box--full from the CSS entirely and updated device_status.html to use the existing .span-full class instead.

Copilot finished work on behalf of DaTiC0 May 4, 2026 10:36
@DaTiC0
DaTiC0 merged commit a91b0a7 into main May 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants