-
Notifications
You must be signed in to change notification settings - Fork 11
1298 enhancement/cleanup code quality #1320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
0864436
fd89731
6b8de75
a5b78fe
80d9d74
eb45ab8
fba2909
3511923
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Color constants — keep in sync with inst/shiny/www/styles/modules/_colors.scss | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Color constants duplicate and diverge from existing SCSS variables The existing
The sync comment on line 1 is good, but there's no mechanism to enforce it. A future developer changing the SCSS variable won't know to update the R constant (and vice versa). Suggestion: Add a matching comment in
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the review. Now added bidirectional sync comment in |
||
| # See https://github.com/pharmaverse/aNCA/issues/1298 | ||
|
|
||
| # Backgrounds | ||
| BG_GREY_LIGHT <- "#eeeeee" | ||
| BG_GREY_HEADER <- "#e9e9e9" | ||
| BG_HIGHLIGHT_BLUE <- "#CCE5FF" | ||
| BG_BLUE_LIGHT <- "#e6f2ff" | ||
| ANCA_WHITE <- "#ffffff" | ||
|
|
||
| # Text | ||
| TEXT_MUTED <- "#999999" | ||
| TEXT_DIM <- "#888888" | ||
| TEXT_SUBTLE <- "#777777" | ||
| TEXT_SECONDARY <- "#666666" | ||
| TEXT_HEADING <- "#555555" | ||
|
|
||
| # Borders | ||
| BORDER_LIGHT <- "#dddddd" | ||
| BORDER_MUTED <- "#cccccc" | ||
| BORDER_PANEL <- "#dee2e6" | ||
|
|
||
| # Accent | ||
| ACCENT_BLUE <- "#0d6efd" | ||
| ACCENT_ORANGE <- "#ffa62d" | ||
| ACCENT_DANGER <- "#dc3545" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,7 +154,7 @@ tab_about_server <- function(id) { | |
| } | ||
| ) | ||
| tags$blockquote( | ||
| style = "border-left: 3px solid #ccc; padding-left: 1em; color: #555;", | ||
| style = paste0("border-left: 3px solid ", BORDER_MUTED, "; padding-left: 1em; color: ", TEXT_HEADING, ";"), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The original one-liner was easy to scan. The replacement fragments the string across multiple # Before
style = "border-left: 3px solid #ccc; padding-left: 1em; color: #555;"
# After
style = paste0("border-left: 3px solid ", BORDER_MUTED, "; padding-left: 1em; color: ", TEXT_HEADING, ";")Since style = glue("border-left: 3px solid {BORDER_MUTED}; padding-left: 1em; color: {TEXT_HEADING};")This applies to all similar
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switched all color-related style interpolations from |
||
| tags$p(cit_text) | ||
| ) | ||
| }) | ||
|
|
@@ -163,7 +163,7 @@ tab_about_server <- function(id) { | |
| cit <- utils::citation("PKNCA") | ||
| cit_text <- paste(format(cit, style = "text"), collapse = "\n\n") | ||
| tags$blockquote( | ||
| style = "border-left: 3px solid #ccc; padding-left: 1em; color: #555;", | ||
| style = paste0("border-left: 3px solid ", BORDER_MUTED, "; padding-left: 1em; color: ", TEXT_HEADING, ";"), | ||
| tags$p(cit_text) | ||
| ) | ||
| }) | ||
|
|
@@ -255,7 +255,7 @@ tab_about_server <- function(id) { | |
| style = "margin-bottom: 0.3em;", | ||
| tags$a(href = url, target = "_blank", label), | ||
| tags$span( | ||
| style = "color: #999; font-size: 0.85em; margin-left: 0.5em;", | ||
| style = paste0("color: ", TEXT_MUTED, "; font-size: 0.85em; margin-left: 0.5em;"), | ||
| url | ||
| ) | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -273,7 +273,7 @@ excretion_help_ui <- function() { | |
| ) | ||
| ), | ||
| style = "unite", | ||
| icon = icon("question"), | ||
| icon = icon("question"), `aria-label` = "Help", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The Please verify in the browser devtools (as described in the test instructions) that the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's right, |
||
| status = "primary" | ||
| ) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require(stats)removal — likely safe but worth verifyingRemoving
require(magrittr)is clearly correct (%>%is re-exported bydplyr). Removingrequire(stats)is almost certainly fine sincestatsis a base package that's always loaded in R sessions, but worth a quickgrep -r "stats::" inst/shiny/to confirm no module code relies on the namespace being explicitly attached.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion,
grep -r "stats::" inst/shiny/returns zero results.