Refactor filename naming system and apply convention-based renames

Standardize settings file naming and relocate documentation files
Fix code quality violations from rsx:check
Reorganize user_management directory into logical subdirectories
Move Quill Bundle to core and align with Tom Select pattern
Simplify Site Settings page to focus on core site information
Complete Phase 5: Multi-tenant authentication with login flow and site selection
Add route query parameter rule and synchronize filename validation logic
Fix critical bug in UpdateNpmCommand causing missing JavaScript stubs
Implement filename convention rule and resolve VS Code auto-rename conflict
Implement js-sanitizer RPC server to eliminate 900+ Node.js process spawns
Implement RPC server architecture for JavaScript parsing
WIP: Add RPC server infrastructure for JS parsing (partial implementation)
Update jqhtml terminology from destroy to stop, fix datagrid DOM preservation
Add JQHTML-CLASS-01 rule and fix redundant class names
Improve code quality rules and resolve violations
Remove legacy fatal error format in favor of unified 'fatal' error type
Filter internal keys from window.rsxapp output
Update button styling and comprehensive form/modal documentation
Add conditional fly-in animation for modals
Fix non-deterministic bundle compilation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-13 19:10:02 +00:00
parent fc494c1e08
commit 77b4d10af8
28155 changed files with 2191860 additions and 12967 deletions

View File

@@ -338,13 +338,17 @@ class FilenameClassMatch_CodeQualityRule extends CodeQualityRule_Abstract
}
/**
* Extract short name from class/id if directory structure matches prefix
* Returns null if directory structure doesn't match or if short name rules aren't met
* Extract valid short name(s) from class/id by checking if directory + filename parts match full name
* Returns the filename parts as a valid short name if they can be combined with directory parts
*
* Rules:
* - Short names only allowed in ./rsx directory (NOT in /app/RSpade)
* - Original name must have 3+ segments for short name to be allowed (2-segment names must use full name)
* - Short name must have 2+ segments (exception: if original was 1 segment, short can be 1 segment)
* - Allows partial overlap between directory and filename (e.g., frontend/settings/account/ with settings_account filename)
*
* Algorithm: For a filename to be valid, there must exist a contiguous sequence in the directory path
* that, when combined with the filename parts, equals the full name parts.
*/
private function extract_short_name(string $full_name, string $dir_path): ?string
{
@@ -370,41 +374,31 @@ class FilenameClassMatch_CodeQualityRule extends CodeQualityRule_Abstract
// Split directory path into parts and re-index
$dir_parts = array_values(array_filter(explode('/', $dir_path)));
// Find the maximum number of consecutive matches between end of dir_parts and start of name_parts
$matched_parts = 0;
$max_possible = min(count($dir_parts), count($name_parts) - 1);
// Try all possible short name lengths (from longest to shortest, minimum 2 segments)
// For each potential short name, check if directory contains the complementary prefix parts
for ($short_len = $original_segment_count - 1; $short_len >= 2; $short_len--) {
$short_parts = array_slice($name_parts, $original_segment_count - $short_len);
$prefix_parts = array_slice($name_parts, 0, $original_segment_count - $short_len);
// Try to match last N dir parts with first N name parts
for ($num_to_check = $max_possible; $num_to_check > 0; $num_to_check--) {
$all_match = true;
for ($i = 0; $i < $num_to_check; $i++) {
$dir_idx = count($dir_parts) - $num_to_check + $i;
if (strtolower($dir_parts[$dir_idx]) !== strtolower($name_parts[$i])) {
$all_match = false;
break;
// Check if prefix_parts exist as a contiguous sequence in directory
$prefix_len = count($prefix_parts);
for ($start_idx = 0; $start_idx <= count($dir_parts) - $prefix_len; $start_idx++) {
$all_match = true;
for ($i = 0; $i < $prefix_len; $i++) {
if (strtolower($dir_parts[$start_idx + $i]) !== strtolower($prefix_parts[$i])) {
$all_match = false;
break;
}
}
if ($all_match) {
// Found valid prefix in directory, this short name is valid
return implode('_', $short_parts);
}
}
if ($all_match) {
$matched_parts = $num_to_check;
break;
}
}
if ($matched_parts === 0) {
return null; // No match
}
// Calculate the short name
$short_parts = array_slice($name_parts, $matched_parts);
$short_segment_count = count($short_parts);
// Validate short name segment count
// Short name must have 2+ segments (unless original was 1 segment, which we already excluded above)
if ($short_segment_count < 2) {
return null; // Short name would be too short
}
return implode('_', $short_parts);
return null; // No valid short name found
}
private function get_class_remediation(string $file, string $class_name, string $filename, string $extension, bool $is_rspade, bool $is_jqhtml_component = false): string