Commit 2bbf25d
authored
fix: visual fixes on load, viewport position enhancement and dropdown close logic (#207)
# Pull Request Overview
This pull request initially aimed to address a bug where the layer did
not update correctly on load. The actual fix turned out to be quite
simple—we just needed to set the current layer value explicitly in the
load function. This step is essential because, although the canvas
defaulted to the "link" layer, both the right sidebar and the layer
dropdown retained the previous layer state.
Rather than forcing all components to switch to the "link" layer,
updating the graph's layer alone is a cleaner solution. It also
preserves the user's original settings, which might be more relevant
depending on the context. We can discuss whether this or a more
aggressive sync approach is preferable.
## Viewport Save/Load Improvements
Some inconsistencies the team encountered when saving and loading the
viewport's zoom level and position were also tackled. The updated logic
now performs more thorough validation of the position values and handles
edge cases more gracefully. In addition, logs have been added to help
debug if similar issues arise in the future.
## UI Enhancement: Dropdown Behavior
Lastly, the Dropdown component has been updated to close automatically
when the user touches or drags outside of the options box. Thanks to the
recent refactor of the visual structure, this improvement was
straightforward to implement—and surprisingly satisfying!
closes #1971 parent 25f1fea commit 2bbf25d
File tree
4 files changed
+43
-7
lines changed- src
- graphics
- basic_components
- types
- utils/constants
4 files changed
+43
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
136 | 146 | | |
137 | 147 | | |
138 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
139 | 153 | | |
140 | 154 | | |
141 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
83 | 93 | | |
84 | | - | |
| 94 | + | |
85 | 95 | | |
86 | 96 | | |
87 | 97 | | |
88 | | - | |
89 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
90 | 110 | | |
91 | 111 | | |
92 | 112 | | |
| |||
95 | 115 | | |
96 | 116 | | |
97 | 117 | | |
| 118 | + | |
| 119 | + | |
98 | 120 | | |
99 | 121 | | |
100 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
0 commit comments