Commit 2c7d44e
committed
Fix code review issues and CI build failure
This commit addresses all review comments from Copilot and fixes the GitHub Actions build failure:
Build Fix:
- Made cwd.zig macOS-only with comptime check to prevent Linux build failures
- Added conditional import of cwd_mod in state.zig (struct{} for non-macOS)
- Added early return in updateCwd for non-macOS platforms
Review #1 - Ping-pong animation:
- Replaced sawtooth animation with smooth ping-pong pattern
- Animation now includes forward scroll, backward scroll, and idle at both ends
- Eliminates jarring jump back to start
Review #2 - Fade conditions:
- Fixed inverted fade logic
- fade_left now correctly triggers when scroll_offset > 0
- fade_right now correctly triggers when scroll_offset < scroll_range
Review #3 - Documentation:
- Added documentation clarifying cwd_basename is a subslice of cwd_path
- Documents lifetime dependency between the two fields
Review #4 & #5 - Silent failure logging:
- Added log warnings for basename buffer overflow
- Added log warnings for parent path buffer overflow
- Helps debugging when paths exceed buffer limits
Review #6 - Remove unused field:
- Removed cwd_marquee_offset field (animation uses current_time instead)
- Cleaned up unused code
All fixes tested with:
- zig build: Success
- zig build test: All tests pass
- zig fmt src/: Code formatted1 parent 7c7de37 commit 2c7d44e
3 files changed
Lines changed: 49 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
789 | | - | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
790 | 796 | | |
791 | 797 | | |
792 | 798 | | |
| |||
825 | 831 | | |
826 | 832 | | |
827 | 833 | | |
828 | | - | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
829 | 841 | | |
830 | 842 | | |
831 | 843 | | |
| |||
868 | 880 | | |
869 | 881 | | |
870 | 882 | | |
871 | | - | |
| 883 | + | |
872 | 884 | | |
873 | 885 | | |
874 | 886 | | |
875 | 887 | | |
| 888 | + | |
876 | 889 | | |
877 | | - | |
878 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
879 | 896 | | |
880 | 897 | | |
881 | | - | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
882 | 910 | | |
883 | 911 | | |
884 | 912 | | |
| |||
891 | 919 | | |
892 | 920 | | |
893 | 921 | | |
894 | | - | |
895 | | - | |
| 922 | + | |
| 923 | + | |
896 | 924 | | |
897 | 925 | | |
898 | 926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
| 227 | + | |
| 228 | + | |
225 | 229 | | |
226 | 230 | | |
227 | 231 | | |
| |||
244 | 248 | | |
245 | 249 | | |
246 | 250 | | |
247 | | - | |
248 | 251 | | |
249 | 252 | | |
250 | 253 | | |
| |||
0 commit comments