Skip to content

Commit c2bb683

Browse files
authored
Add Resize the room sidepanel using a hoverable tool (#768)
<!-- Please read https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before submitting your pull request --> ### Description Add the ability to resize the room sidebar, you can either do it in settings as a number of the width of it, or using a hoverable thing. Additionally you can now set whether and when do you want to show the room's icon instead of the default symbol, mainly meant for when the sidebar is not wide enough to display meaningful names to serve as an aid to know which room you are in. A good %age of the changes are just indentation from adding/removing one object (example of holding the bar to drag it) <img width="1033" height="1080" alt="image" src="https://github.com/user-attachments/assets/d7c6f47a-40a6-4199-9258-00f89119afd3" /> (example of smart looks) <img width="1033" height="1080" alt="image" src="https://github.com/user-attachments/assets/287ae643-1178-44b8-96e1-436185c93076" /> <img width="1060" height="1080" alt="image" src="https://github.com/user-attachments/assets/3d915210-fa77-4844-8ce3-64afc244ae8c" /> (settings added here) <img width="810" height="697" alt="image" src="https://github.com/user-attachments/assets/fe925a68-63d7-4ad7-9c90-31243dd386d0" /> <img width="811" height="823" alt="image" src="https://github.com/user-attachments/assets/c2266459-af86-4168-b8e5-aabacb057476" /> (example of the threads being resizeable) <img width="918" height="1080" alt="image" src="https://github.com/user-attachments/assets/d41d6749-489d-46ed-aa78-73aa54af8915" /> <img width="930" height="1080" alt="image" src="https://github.com/user-attachments/assets/07677474-0ef3-4708-8eba-a64a68eac61c" /> <img width="816" height="1080" alt="image" src="https://github.com/user-attachments/assets/23efa84d-c2e4-474b-a85f-d12fadc62b56" /> Fixes: #68 #102 #681 #694 #### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) ### Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### AI disclosure: - [ ] Partially AI assisted (clarify which code was AI assisted and briefly explain what it does). - [ ] Fully AI generated (explain what all the generated code does in moderate detail). <!-- Write any explanation required here, but do not generate the explanation using AI!! You must prove you understand what the code in this PR does. --> The Pisan cats have helped me implement this
2 parents 8b511d7 + 61cc04d commit c2bb683

31 files changed

Lines changed: 2482 additions & 1317 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: minor
3+
---
4+
5+
Add setting to show icons of the rooms in the Rooms sidebar
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: minor
3+
---
4+
5+
Add Resize the sidepanels and the thread height of the original object using hoverable tools.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: minor
3+
---
4+
5+
Add toggle to allow one to not join a call in a room by just clicking it in the sidebar.

src/app/components/nav/styles.css.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ export const NavItem = recipe({
107107

108108
export type RoomSelectorVariants = RecipeVariants<typeof NavItem>;
109109
export const NavItemContent = style({
110-
paddingLeft: config.space.S200,
111-
paddingRight: config.space.S300,
110+
paddingLeft: config.space.S300,
111+
paddingRight: config.space.S200,
112112
height: 'inherit',
113113
minWidth: 0,
114114
flexGrow: 1,

src/app/components/page/style.css.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import { DefaultReset, color, config, toRem } from 'folds';
66
export const PageNav = recipe({
77
variants: {
88
size: {
9+
'100%': {
10+
width: '100%',
11+
},
912
'400': {
1013
width: toRem(256),
1114
},
@@ -15,7 +18,7 @@ export const PageNav = recipe({
1518
},
1619
},
1720
defaultVariants: {
18-
size: '400',
21+
size: '100%',
1922
},
2023
});
2124
export type PageNavVariants = RecipeVariants<typeof PageNav>;
Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,48 @@
1-
import { as, Chip, Icon, Icons, Text } from 'folds';
1+
import { as, Chip, Icon, IconButton, Icons, Text } from 'folds';
22
import classNames from 'classnames';
33
import * as css from './styles.css';
44

55
export const RoomNavCategoryButton = as<'button', { closed?: boolean }>(
6-
({ className, closed, children, ...props }, ref) => (
7-
<Chip
8-
className={classNames(css.CategoryButton, className)}
9-
variant="Background"
10-
radii="400"
11-
after={
6+
({ className, closed, children, ...props }, ref) => {
7+
if (children)
8+
return (
9+
<Chip
10+
className={classNames(css.CategoryButton, className)}
11+
variant="Background"
12+
radii="400"
13+
before={
14+
<Icon
15+
className={css.CategoryButtonIcon}
16+
size="50"
17+
src={closed ? Icons.ChevronRight : Icons.ChevronBottom}
18+
/>
19+
}
20+
{...props}
21+
ref={ref}
22+
>
23+
{children && (
24+
<Text size="B400" priority="300" truncate>
25+
{children}
26+
</Text>
27+
)}
28+
</Chip>
29+
);
30+
return (
31+
<IconButton
32+
className={classNames(css.CategoryButton, className)}
33+
variant="Background"
34+
radii="400"
35+
{...props}
36+
style={{ padding: '0' }}
37+
ref={ref}
38+
>
1239
<Icon
1340
className={css.CategoryButtonIcon}
1441
size="50"
42+
style={{ padding: '0' }}
1543
src={closed ? Icons.ChevronRight : Icons.ChevronBottom}
1644
/>
17-
}
18-
{...props}
19-
ref={ref}
20-
>
21-
<Text size="B400" priority="300" truncate>
22-
{children}
23-
</Text>
24-
</Chip>
25-
)
45+
</IconButton>
46+
);
47+
}
2648
);

0 commit comments

Comments
 (0)