Skip to content

Commit 9b69cd4

Browse files
authored
Merge pull request #57 from Automattic/release/1.5.1
2 parents 6edc805 + 7bc9d9b commit 9b69cd4

File tree

10 files changed

+316
-308
lines changed

10 files changed

+316
-308
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.5.1] - 2025-10-14
8+
9+
### Fixed
10+
11+
- fix: implicitly marking parameter as nullable is deprecated by @sjinks in https://github.com/Automattic/Rewrite-Rules-Inspector/pull/55
12+
13+
### Changed
14+
15+
- refactor: Update UI to use tabs navigation by @GaryJones in https://github.com/Automattic/Rewrite-Rules-Inspector/pull/56
16+
717
## [1.5.0] - 2025-10-14
818

919
### Added
@@ -71,6 +81,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7181
- Filter by different sources of rewrite rules.
7282
- An error message appears if rewrite rules are missing in the database.
7383

84+
[1.5.1]: https://github.com/Automattic/Rewrite-Rules-Inspector/compare/1.5.0...1.5.1
7485
[1.5.0]: https://github.com/Automattic/Rewrite-Rules-Inspector/compare/1.4.0...1.5.0
7586
[1.4.0]: https://github.com/Automattic/Rewrite-Rules-Inspector/compare/1.3.1...1.4.0
7687
[1.3.1]: https://github.com/Automattic/Rewrite-Rules-Inspector/compare/1.3.0...1.3.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rewrite Rules Inspector
22

3-
Stable tag: 1.5.0
3+
Stable tag: 1.5.1
44
Requires at least: 5.9
55
Tested up to: 6.8
66
Requires PHP: 7.4

assets/css/admin.css

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,11 @@
3434
}
3535

3636
/* ==========================================================================
37-
Navigation and Jump Links
37+
Tabs
3838
========================================================================== */
39-
40-
.jump-link {
41-
display: inline-block;
42-
margin-left: var(--rri-spacing-sm);
43-
padding: 1px 4px;
44-
background: transparent;
45-
border: none;
46-
border-radius: 2px;
47-
text-decoration: none;
48-
color: #666;
49-
font-size: 12px;
50-
font-weight: normal;
51-
transition: color 0.15s ease;
52-
}
53-
54-
.jump-link:hover,
55-
.jump-link:focus {
56-
color: var(--rri-primary-color);
57-
text-decoration: none;
58-
background: transparent;
59-
}
60-
61-
.jump-link:focus {
62-
outline: 1px solid var(--rri-primary-color);
63-
outline-offset: 1px;
39+
/* WordPress provides base styles for .nav-tab-wrapper and .nav-tab */
40+
.nav-tab-wrapper {
41+
margin-bottom: 12px;
6442
}
6543

6644
/* ==========================================================================
@@ -144,9 +122,22 @@
144122
.custom-tablenav-top .tablenav-actions {
145123
float: right;
146124
display: flex;
125+
align-items: center;
147126
gap: var(--rri-spacing-sm);
148127
}
149128

129+
.rri-rules-count {
130+
color: #666;
131+
font-size: 13px;
132+
margin-right: var(--rri-spacing-sm);
133+
}
134+
135+
/* Priority column should be narrow */
136+
.column-priority {
137+
width: 60px;
138+
text-align: center;
139+
}
140+
150141
.custom-tablenav-top form {
151142
display: inline-block;
152143
margin-right: var(--rri-spacing-md);
@@ -247,11 +238,6 @@
247238
padding: 2px 4px;
248239
}
249240

250-
.jump-link {
251-
display: inline-block;
252-
margin-left: var(--rri-spacing-sm);
253-
margin-top: 0;
254-
}
255241
}
256242

257243
@media (max-width: 600px) {
@@ -352,6 +338,29 @@
352338
border-radius: 4px;
353339
}
354340

341+
/* Notices kept inside the tab content to avoid core relocation */
342+
.rri-notice {
343+
/* Match core .notice spacing */
344+
margin: 5px 0 15px;
345+
padding: 12px;
346+
background: #fff;
347+
border-left: 4px solid #72aee6; /* info color default */
348+
box-shadow: 0 1px 1px rgba(0,0,0,.04);
349+
color: #1d2327;
350+
}
351+
352+
.rri-notice p {
353+
margin: .5em 0;
354+
}
355+
356+
.rri-notice-success {
357+
border-left-color: #46b450; /* core success */
358+
}
359+
360+
.rri-notice-error {
361+
border-left-color: #dc3232; /* core error */
362+
}
363+
355364
.rri-url-test-results h3 {
356365
margin-top: 0;
357366
color: #23282d;

assets/js/admin.js

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -12,76 +12,18 @@
1212
* Initialize admin functionality when document is ready.
1313
*/
1414
$(document).ready(function() {
15-
initSmoothScrolling();
1615
initAccessibilityEnhancements();
1716
});
1817

19-
/**
20-
* Initialize smooth scrolling for jump links.
21-
*/
22-
function initSmoothScrolling() {
23-
// Check if user prefers reduced motion.
24-
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
25-
26-
if (prefersReducedMotion) {
27-
return; // Skip smooth scrolling if user prefers reduced motion.
28-
}
29-
30-
// Handle jump link clicks.
31-
$('.jump-link').on('click', function(e) {
32-
const href = $(this).attr('href');
33-
34-
// Only handle internal anchor links.
35-
if (href && href.startsWith('#')) {
36-
e.preventDefault();
37-
38-
const target = $(href);
39-
if (target.length) {
40-
// Calculate offset for WordPress admin toolbar.
41-
const adminBarHeight = $('#wpadminbar').length ? $('#wpadminbar').outerHeight() : 0;
42-
const offset = adminBarHeight + 20; // 20px additional spacing
43-
44-
// Smooth scroll to target.
45-
$('html, body').animate({
46-
scrollTop: target.offset().top - offset
47-
}, 500, 'swing');
48-
49-
// Add focus to target for accessibility.
50-
target.focus();
51-
52-
// Add a temporary highlight effect (subtle).
53-
target.addClass('rri-highlight');
54-
setTimeout(function() {
55-
target.removeClass('rri-highlight');
56-
}, 1500);
57-
}
58-
}
59-
});
60-
}
6118

6219
/**
6320
* Initialize accessibility enhancements.
6421
*/
6522
function initAccessibilityEnhancements() {
66-
// Add keyboard navigation support for jump links.
67-
$('.jump-link').on('keydown', function(e) {
68-
// Handle Enter and Space key presses.
69-
if (e.which === 13 || e.which === 32) { // Enter or Space
70-
e.preventDefault();
71-
$(this).click();
72-
}
73-
});
74-
7523
// Add ARIA live region for dynamic content updates.
7624
if (!$('#rri-live-region').length) {
7725
$('body').append('<div id="rri-live-region" class="screen-reader-text" aria-live="polite" aria-atomic="true"></div>');
7826
}
79-
80-
// Announce section changes when jumping.
81-
$('.jump-link').on('click', function() {
82-
const targetText = $(this).text();
83-
$('#rri-live-region').text('Navigated to ' + targetText);
84-
});
8527
}
8628

8729
/**
@@ -97,38 +39,4 @@
9739
);
9840
}
9941

100-
/**
101-
* Add scroll spy functionality for better navigation.
102-
*/
103-
function initScrollSpy() {
104-
const sections = $('.rri-section h2[id]');
105-
106-
if (sections.length < 2) {
107-
return; // No need for scroll spy with less than 2 sections.
108-
}
109-
110-
$(window).on('scroll', function() {
111-
let current = '';
112-
113-
sections.each(function() {
114-
if (isInViewport(this)) {
115-
current = $(this).attr('id');
116-
}
117-
});
118-
119-
// Update active state of jump links.
120-
$('.jump-link').removeClass('rri-active');
121-
if (current) {
122-
$('.jump-link[href="#' + current + '"]').addClass('rri-active');
123-
}
124-
});
125-
}
126-
127-
// Initialize scroll spy if there are multiple sections.
128-
$(document).ready(function() {
129-
if ($('.rri-section').length > 1) {
130-
initScrollSpy();
131-
}
132-
});
133-
13442
})(jQuery);

0 commit comments

Comments
 (0)