Skip to content

Better styles, WIP#11

Open
larsen wants to merge 4 commits intomasterfrom
styling
Open

Better styles, WIP#11
larsen wants to merge 4 commits intomasterfrom
styling

Conversation

@larsen
Copy link
Copy Markdown
Owner

@larsen larsen commented Oct 18, 2020

Addresses #4

@larsen larsen added the WIP label Oct 18, 2020
@larsen larsen requested a review from Copilot May 21, 2025 11:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the UI to use a unified mui namespace for Material-UI components, updates styling with a new custom-styles map, and adds a search-area wrapper for the search input.

  • Switched individual component imports to reagent-material-ui.components alias mui
  • Revised custom-styles, introduced search-area and updated search-field
  • Replaced all raw components with mui/... variants in appbar and layout

"secondary"
"primary")
:on-click (fn [_] (toggle-tag-filter tag-name))}]))
[mui/chip {:key (gensym "tag-")
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Using gensym for React keys generates a new key on each render, causing unnecessary remounts and loss of component state. Use a stable identifier (e.g., a unique tag ID or the tag name) as the key instead.

Suggested change
[mui/chip {:key (gensym "tag-")
[mui/chip {:key tag-name

Copilot uses AI. Check for mistakes.
[search-field]]]]])
[mui/typography {:variant "h6"} "Bookmarks"]
[mui/typography (clojure.string/join ", " (:tag-filter @app-state))]
[(with-custom-styles search-area)]]]])
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Wrapping the HOC invocation in an extra vector may prevent proper prop injection. It should be used directly as [with-custom-styles search-area] so that the injected classes prop flows correctly.

Suggested change
[(with-custom-styles search-area)]]]])
[with-custom-styles search-area]]]])

Copilot uses AI. Check for mistakes.
:inputProps {:aria-label "search"}
:on-change (fn [evt] (swap! app-state assoc :search-filter (event-value evt)))}])})))
:on-change (fn [evt]
(js/console.log evt)
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

[nitpick] This appears to be a leftover debugging statement. Consider removing it or replacing it with a structured logging approach before merging.

Copilot uses AI. Check for mistakes.
Comment on lines +187 to +189
;; FIXME with this structure it breaks the keybind
[mui/input-base
{; :ref (fn [el] (reset! search-field! el))
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

The FIXME comment indicates incomplete work. Either resolve the keybind issue or remove the comment once addressed to keep the codebase clean.

Suggested change
;; FIXME with this structure it breaks the keybind
[mui/input-base
{; :ref (fn [el] (reset! search-field! el))
[mui/input-base
{:ref (fn [el] (reset! search-field! el))

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants