Skip to content

feat: rooms list sort by button#210

Merged
eric-kitagawa merged 16 commits intomainfrom
eric/rooms-list-sort-by-button
Mar 25, 2026
Merged

feat: rooms list sort by button#210
eric-kitagawa merged 16 commits intomainfrom
eric/rooms-list-sort-by-button

Conversation

@eric-kitagawa
Copy link
Contributor

@eric-kitagawa eric-kitagawa commented Mar 24, 2026

needs #206 to merge first

Added the sortby button to the rooms page

you can now filter by room number in ascending or descending.

orderby-dropdown-3-24.mov

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 0% with 93 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.14%. Comparing base (eff6f51) to head (21edf0d).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ients/web/src/components/rooms/OrderByDropdown.tsx 0.00% 47 Missing ⚠️
clients/web/src/components/rooms/FilterTag.tsx 0.00% 18 Missing ⚠️
clients/web/src/components/rooms/RoomsList.tsx 0.00% 17 Missing ⚠️
...ients/web/src/components/rooms/SortByContainer.tsx 0.00% 11 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #210      +/-   ##
==========================================
- Coverage   11.49%   11.14%   -0.36%     
==========================================
  Files          99      102       +3     
  Lines        3166     3257      +91     
  Branches       24       24              
==========================================
- Hits          364      363       -1     
- Misses       2798     2890      +92     
  Partials        4        4              
Flag Coverage Δ
backend 24.83% <ø> (ø)
mobile 84.00% <ø> (ø)
web 0.71% <0.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
clients/web/src/routes/_protected/rooms.index.tsx 0.00% <ø> (ø)
...ients/web/src/components/rooms/SortByContainer.tsx 0.00% <0.00%> (ø)
clients/web/src/components/rooms/RoomsList.tsx 0.00% <0.00%> (-4.17%) ⬇️
clients/web/src/components/rooms/FilterTag.tsx 0.00% <0.00%> (ø)
...ients/web/src/components/rooms/OrderByDropdown.tsx 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eric-kitagawa eric-kitagawa marked this pull request as ready for review March 24, 2026 21:09
@eric-kitagawa eric-kitagawa self-assigned this Mar 24, 2026
@eric-kitagawa eric-kitagawa added feature Introduces a new and complete feature needs review labels Mar 24, 2026
@eric-kitagawa eric-kitagawa changed the title Eric/rooms list sort by button feat: rooms list sort by button Mar 24, 2026
};

function sortRoomsByRoomNumber(
rooms: Array<RoomWithOptionalGuestBooking>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ILoRoomWithOptionalGuestBooking

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a fundies reference? 😭

children,
}: PageShellProps) {
const hasDrawer = !!drawer;
const hasDrawer = drawer !== undefined;
Copy link
Contributor

@danctila danctila Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this fine type wise?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this valid actually better than the coercion now that I look at it

Copy link
Contributor

@danctila danctila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good to me but just want to make sure all the new components are directly related / needed for the change to just add the sort by button. if not it would be better to split this into one PR only for the bare minimum to have your sort by button there and then another for nice to have components that aren't related to that - i could be wrong though and it's all used

danctila
danctila previously approved these changes Mar 25, 2026
Copy link
Contributor

@danctila danctila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i take back my other comment i just noticed #206 has the components I mentioned so as long as they match which I'm assuming they do it's good

Copy link
Contributor

@Dao-Ho Dao-Ho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!! Let's goo, it's looking so good 🔥 Just some comments for future reference, especially the sorting functionality. This PR is good to be merged though

)}
</div>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good but def shadcn for future cases, you're the goat for cooking up from scratch though

};

function sortRoomsByRoomNumber(
rooms: Array<RoomWithOptionalGuestBooking>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a fundies reference? 😭

const bn = b.room_number ?? 0;
return ascending ? an - bn : bn - an;
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we wanna do this sorting on the backend at the query level, we can merge this in for now but let's add that as a field to our request body as an optional sorting in a different pr

@eric-kitagawa eric-kitagawa merged commit af5f260 into main Mar 25, 2026
16 checks passed
@eric-kitagawa eric-kitagawa deleted the eric/rooms-list-sort-by-button branch March 25, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Introduces a new and complete feature needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants