Commit d1e9452
committed
feat(ui): animate side-panel slide in/out instead of instant unmount
Panel toggle previously unmounted the aside in a single React commit,
so the center column snapped to its new width with no visual continuity
(per user feedback: "整个左右两侧被砍掉似的"). Add a 250ms width
transition driven by a new `useSlidingPanel` hook in App.tsx and a
matching `.is-collapsed` CSS state in global.css.
Behavior:
- Hide: apply `is-collapsed` (panel width 320→0 animated), then
unmount the aside after 250ms so Explorer / RightPanel stop firing
IPC + event subs while invisible.
- Show: mount the aside in the collapsed state, then drop the class
on the next two rAFs so CSS animates 0→320. Double rAF is needed
so the browser commits a paint at width 0 before the class flip;
otherwise the transition has no "from" frame and snaps open.
- Initial render skips the effect entirely so a launch-hidden panel
stays unmounted and a launch-visible panel doesn't fake-collapse.
Center column's `flex: 1` smoothly reclaims/yields the freed space as
the panel width animates, so the OS window stays put and the visible
resize is the panel itself, not the whole app.
Also drops the stale "side panels chop the window edge" comment block
in global.css — the chop behavior was removed in f903be1; the comment
was just lying around.1 parent 99d3d7c commit d1e9452
2 files changed
Lines changed: 120 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
17 | 91 | | |
18 | 92 | | |
19 | 93 | | |
20 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
21 | 98 | | |
22 | 99 | | |
23 | 100 | | |
| |||
140 | 217 | | |
141 | 218 | | |
142 | 219 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
151 | 228 | | |
152 | 229 | | |
153 | | - | |
154 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
155 | 234 | | |
156 | 235 | | |
157 | 236 | | |
| |||
161 | 240 | | |
162 | 241 | | |
163 | 242 | | |
164 | | - | |
165 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
166 | 247 | | |
167 | 248 | | |
168 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
707 | 705 | | |
708 | 706 | | |
709 | 707 | | |
| |||
758 | 756 | | |
759 | 757 | | |
760 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
761 | 767 | | |
762 | 768 | | |
763 | 769 | | |
| |||
769 | 775 | | |
770 | 776 | | |
771 | 777 | | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
772 | 782 | | |
773 | 783 | | |
774 | 784 | | |
| |||
963 | 973 | | |
964 | 974 | | |
965 | 975 | | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
966 | 980 | | |
967 | 981 | | |
968 | 982 | | |
969 | 983 | | |
970 | 984 | | |
971 | 985 | | |
972 | 986 | | |
973 | | - | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
974 | 991 | | |
975 | 992 | | |
976 | 993 | | |
| |||
0 commit comments