Skip to content

fix sort type#3

Merged
awcodes merged 1 commit into
1.xfrom
feat/navigation-sort
Apr 1, 2026
Merged

fix sort type#3
awcodes merged 1 commit into
1.xfrom
feat/navigation-sort

Conversation

@awcodes

@awcodes awcodes commented Apr 1, 2026

Copy link
Copy Markdown
Owner

No description provided.

@awcodes
awcodes merged commit 887ca40 into 1.x Apr 1, 2026
8 of 14 checks passed
@awcodes
awcodes deleted the feat/navigation-sort branch April 1, 2026 18:29
@bri-tong

bri-tong commented Apr 1, 2026

Copy link
Copy Markdown

Code Review — PR #3: fix sort type

Summary

This is a correct, surgical type fix. The $navigationSort property and its setter navigationSort() were typed as string | Closure | null, but the getter getNavigationSort(): ?int already returned ?int, and Filament's Page::getNavigationSort() contract expects ?int. Changing the type from string to int aligns the property and setter with both the getter and the framework contract. No functional issues.

Blocking Issues

None.

Non-blocking Suggestions

  1. Missing test coverage for navigationSort — The existing test suite in tests/src/BotlyPluginTest.php covers navigationLabel, navigationGroup, slug, title, and persistentRules, but there is no test for navigationSort / getNavigationSort(). Consider adding a test like:

    it('returns null navigation sort by default', function (): void {
        expect(BotlyPlugin::make()->getNavigationSort())->toBeNull();
    });
    
    it('returns a custom navigation sort when set', function (): void {
        expect(BotlyPlugin::make()->navigationSort(5)->getNavigationSort())->toBe(5);
    });

    This would have caught the original string type mismatch earlier and prevents regressions.

Questions / Clarifications

None — the intent and fix are clear. Good catch. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants