930e605b2d
Single-pass UX cleanup of the main WP Notes admin page. Functionality
unchanged; the page is shorter, has one H1, and stops contradicting
itself.
CHANGES
- Single H1 on the page (was five different H1s).
- Welcome/about content collapsed from THREE on-page surfaces (top
dismissible notice + nested toggle + Show/Close button row) to one
single description line linking to the dedicated About page where
the long copy already lives.
- Two duplicate "Toggle Welcome Section" buttons with the SAME label
but different targets — both removed.
- Embedded "What's New v3.0.0" changelog block deleted: it was
hard-coded to v3.0.0 while the plugin reports v3.0.2. The real
history is in CHANGELOG.md.
- "Buy me a coffee" button moved from page header to page footer —
promo shouldn't be the first thing under the page title.
- Invalid HTML cleaned up (li outside ul, p wrapping div/ul) by way
of removing the welcome blob that contained it.
- Dead bulk-action UI removed: per-row checkboxes and "Select all"
header in both wp_notes_display_notes() and wp_notes_list_table()
rendered but nothing acted on the selection. Removed with inline
comments marking the spot for when real bulk-actions land. Edit
form colspan adjusted to match the new column count.
- ~80 lines of inline style+script for the about-box dismissal
removed (localStorage tracking, show/hide handlers, two style
blocks). WordPress's notice notice-info is-dismissible + user-meta
is the right path if a banner needs to return.
- toggleSection() JS helper removed (no toggles remain).
- Small CSS additions to inc/wp-notes-styles.php for the header
banner and footer-support link.
ALSO FIXED
- PHP 8.2 deprecation: ${size}px → {$size}px in the dashboard
list-table render. ${var} interpolation is deprecated since 8.2
and will hard-error in 9.0.
NET DIFF: wp-notes.php -213 lines, total -111 lines across 4 files
(plus a new CHANGELOG entry). Storage model unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
232 lines
5.3 KiB
PHP
232 lines
5.3 KiB
PHP
<?php
|
|
// inc/wp-notes-styles.php
|
|
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* Add required styles for WP Notes
|
|
*/
|
|
function wp_notes_admin_styles() {
|
|
?>
|
|
<style>
|
|
/* Header banner image */
|
|
.wp-notes-header-banner {
|
|
margin: 16px 0 24px;
|
|
}
|
|
.wp-notes-banner-img {
|
|
display: block;
|
|
max-width: 1200px;
|
|
width: 100%;
|
|
height: auto;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
/* Footer "buy me a coffee" — lives at the BOTTOM of the page */
|
|
.wp-notes-footer-support {
|
|
text-align: center;
|
|
margin: 32px 0 8px;
|
|
}
|
|
|
|
/* Notes List Container */
|
|
.wp-notes-active,
|
|
.wp-notes-completed {
|
|
margin: 20px 0;
|
|
}
|
|
|
|
/* Section Headers */
|
|
.wp-notes-section {
|
|
margin-bottom: 2em;
|
|
}
|
|
|
|
.wp-notes-section-title {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
color: #23282d;
|
|
font-size: 1.3em;
|
|
margin: 1.5em 0 1em;
|
|
padding-bottom: 0.5em;
|
|
border-bottom: 1px solid #ccd0d4;
|
|
}
|
|
|
|
/* Status Indicators */
|
|
.status-active,
|
|
.status-completed {
|
|
padding: 4px 8px;
|
|
border-radius: 4px;
|
|
font-size: 0.9em;
|
|
font-weight: normal;
|
|
}
|
|
|
|
.status-active {
|
|
background: #e5f5fa;
|
|
color: #0071a1;
|
|
}
|
|
|
|
.status-completed {
|
|
background: #dff0d8;
|
|
color: #3c763d;
|
|
}
|
|
|
|
.note-count {
|
|
color: #666;
|
|
font-size: 0.8em;
|
|
font-weight: normal;
|
|
}
|
|
|
|
/* Note Items */
|
|
.wp-notes-list table {
|
|
border-spacing: 0;
|
|
width: 100%;
|
|
margin-bottom: 2em;
|
|
border: 1px solid #ccd0d4;
|
|
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
/* Table Hover Effects */
|
|
.wp-notes-list table.has-hover tr:hover td {
|
|
background-color: #f8f9fa;
|
|
}
|
|
|
|
/* Table Header */
|
|
.wp-notes-list th {
|
|
font-weight: 600;
|
|
text-align: left;
|
|
padding: 8px 10px;
|
|
}
|
|
|
|
/* Table Cells */
|
|
.wp-notes-list td {
|
|
padding: 12px 10px;
|
|
vertical-align: top;
|
|
}
|
|
|
|
/* Actions Column */
|
|
.wp-notes-list .column-actions {
|
|
text-align: right;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Edit Form */
|
|
.wp-notes-edit-form {
|
|
background: #f8f9fa;
|
|
padding: 15px;
|
|
border: 1px solid #e2e4e7;
|
|
border-radius: 4px;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
/* Form Fields */
|
|
.wp-notes-formatting {
|
|
display: flex;
|
|
gap: 15px;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
margin: 10px 0;
|
|
padding: 12px;
|
|
background: #f8f9fa;
|
|
border-radius: 4px;
|
|
border: 1px solid #e2e4e7;
|
|
}
|
|
|
|
.wp-notes-formatting input[type="color"] {
|
|
padding: 0;
|
|
width: 40px;
|
|
height: 30px;
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
.wp-notes-formatting input[type="number"] {
|
|
width: 70px;
|
|
}
|
|
|
|
.wp-notes-formatting select {
|
|
min-width: 120px;
|
|
}
|
|
|
|
.format-option {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
}
|
|
|
|
/* Emoji Picker */
|
|
.emoji-picker-container {
|
|
position: relative;
|
|
display: inline-block;
|
|
}
|
|
|
|
.emoji-picker-dropdown {
|
|
position: absolute;
|
|
top: 100%;
|
|
left: 0;
|
|
z-index: 1000;
|
|
background: white;
|
|
border: 1px solid #ccd0d4;
|
|
border-radius: 4px;
|
|
padding: 10px;
|
|
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.emoji-list {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, 1fr);
|
|
gap: 5px;
|
|
}
|
|
|
|
.emoji-option {
|
|
font-size: 20px;
|
|
padding: 5px;
|
|
cursor: pointer;
|
|
background: none;
|
|
border: none;
|
|
border-radius: 4px;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.emoji-option:hover {
|
|
background-color: #f0f0f1;
|
|
}
|
|
|
|
/* Note Status Indicators */
|
|
.note-status {
|
|
display: inline-block;
|
|
padding: 2px 8px;
|
|
border-radius: 12px;
|
|
font-size: 12px;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.note-status-active {
|
|
background: #e5f5fa;
|
|
color: #0071a1;
|
|
}
|
|
|
|
.note-status-completed {
|
|
background: #dff0d8;
|
|
color: #3c763d;
|
|
}
|
|
|
|
/* Responsive Design */
|
|
@media screen and (max-width: 782px) {
|
|
.wp-notes-formatting {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.wp-notes-list td {
|
|
padding: 8px 10px;
|
|
}
|
|
|
|
.column-actions {
|
|
text-align: left;
|
|
}
|
|
}
|
|
</style>
|
|
<?php
|
|
}
|
|
add_action('admin_head', 'wp_notes_admin_styles');
|