Commit 05acb99
fix(frontend): topic-list error fix + dependency & code-health cleanup (#2501)
* chore(frontend): remove six unused dependencies
Drop moment, react-draggable, jwt-decode, chakra-react-select,
@autoform/react, and @autoform/zod — zero imports across the frontend
(audit finding DEPS-01).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(frontend): extract named cache-policy stale-time constants
Replace inline staleTime magic numbers with named constants
(DEFAULT_QUERY_STALE_TIME, TOPIC_CONFIG_STALE_TIME) reusing the existing
*_LIVED_CACHE_STALE_TIME convention. Values are unchanged (audit DATA-04).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(frontend): type-check ACL query inputs instead of casting
Drop four `{} as ListACLsRequest` casts on connect-query listACLs calls so
the request shape is checked against the proto, and remove the now-unused
ListACLsRequest imports (audit DATA-05).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(frontend): remove dead commented-out MobX demo block
Delete the 90-line commented AnimationExample (observer/observable) from
animation-props.tsx. No MobX references remain in src (audit LEGACY-08).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(frontend): surface HTTP errors in the legacy topic list query
useLegacyListTopicsQuery used window.fetch, which does not reject on 4xx/5xx,
and returned response.json() unguarded — so a 403/500 with a JSON body parsed
as a successful empty result and the topics page silently rendered 0 topics
instead of an error. Guard on response.ok and add a regression test covering
the error and success paths (audit BUGS-01).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(frontend): stop logging document URLs during topic-doc render
Remove a console.log that printed every transformed link/image URL from
backend-supplied topic documentation on each render. The sanitizeUrl logic is
unchanged (audit SECURITY-02).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(frontend): set ok:true on add-topic-step topic-list fetch mocks
The BUGS-01 fix makes useLegacyListTopicsQuery guard response.ok, so the
config.fetch success mocks must mirror a real Response (ok:true) — otherwise
the guard throws and existing-topic detection breaks.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(frontend): align cache-constant naming and clarify fetch comment
Address @claude review nits: rename DEFAULT_QUERY_STALE_TIME ->
DEFAULT_CACHE_STALE_TIME and TOPIC_CONFIG_STALE_TIME ->
TOPIC_CONFIG_CACHE_STALE_TIME to match the existing *_CACHE_STALE_TIME
convention, and reword the topic.tsx comment to reference config.fetch
(not window.fetch). No behavior change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent fa178a7 commit 05acb99
14 files changed
Lines changed: 114 additions & 160 deletions
File tree
- frontend
- src
- components/pages
- rp-connect/onboarding
- security
- hooks
- topics
- federation
- react-query
- api
- utils
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
| |||
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
92 | | - | |
93 | 90 | | |
94 | 91 | | |
95 | 92 | | |
| |||
102 | 99 | | |
103 | 100 | | |
104 | 101 | | |
105 | | - | |
106 | 102 | | |
107 | 103 | | |
108 | 104 | | |
| |||
119 | 115 | | |
120 | 116 | | |
121 | 117 | | |
122 | | - | |
123 | 118 | | |
124 | 119 | | |
125 | 120 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| 126 | + | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| |||
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
| 289 | + | |
287 | 290 | | |
288 | 291 | | |
289 | 292 | | |
| |||
297 | 300 | | |
298 | 301 | | |
299 | 302 | | |
| 303 | + | |
300 | 304 | | |
301 | 305 | | |
302 | 306 | | |
| |||
356 | 360 | | |
357 | 361 | | |
358 | 362 | | |
| 363 | + | |
359 | 364 | | |
360 | 365 | | |
361 | 366 | | |
| |||
Lines changed: 3 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 17 | + | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| |||
58 | 54 | | |
59 | 55 | | |
60 | 56 | | |
61 | | - | |
| 57 | + | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
| |||
111 | 107 | | |
112 | 108 | | |
113 | 109 | | |
114 | | - | |
| 110 | + | |
115 | 111 | | |
116 | 112 | | |
117 | 113 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
| 45 | + | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
0 commit comments