fortrangoingonforty/sniffly / e0ac0fd

Browse files

strip leading slashes from breadcrumb segment names

Authored by espadonne
SHA
e0ac0fdcff277303f7ac921506cabfcce01f6e00
Parents
d35c822
Tree
1a288c9

2 changed files

StatusFile+-
M breadcrumb/STATUS.md 16 8
M src/gui/breadcrumb_widget.f90 18 4
breadcrumb/STATUS.mdmodified
@@ -57,18 +57,26 @@ Already implemented:
57
 
57
 
58
 ---
58
 ---
59
 
59
 
60
-## Phase 5: Integration - IN PROGRESS
60
+## Phase 5: Integration ✅ COMPLETE
61
 
61
 
62
-**TODO:**
62
+**Completed:**
63
-- [ ] Update `meson.build` to include breadcrumb_widget.f90
63
+- ✅ Updated `meson.build` to include breadcrumb_widget.f90
64
-- [ ] Replace old breadcrumb in `gtk_app.f90`
64
+- ✅ Replaced old breadcrumb in `gtk_app.f90`
65
-- [ ] Remove old breadcrumb functions
65
+- ✅ Removed old breadcrumb functions (sniffly_update_breadcrumbs, on_breadcrumb_clicked)
66
-- [ ] Wire up navigation callback
66
+- ✅ Wired up navigation callback
67
-- [ ] Test build
67
+- ✅ Test build SUCCESSFUL
68
+
69
+**Build status:** CLEAN (only unused parameter warnings)
70
+
71
+---
72
+
73
+## Phase 6: Back/Forward Awareness - OPTIONAL (can skip)
74
+
75
+This is an advanced feature from the plan. The basic breadcrumb works without it.
68
 
76
 
69
 ---
77
 ---
70
 
78
 
71
-## Phase 6: Back/Forward Awareness - PENDING
79
+## Phase 7: Testing - IN PROGRESS
72
 
80
 
73
 **TODO:**
81
 **TODO:**
74
 - [ ] Add history checking to draw function
82
 - [ ] Add history checking to draw function
src/gui/breadcrumb_widget.f90modified
@@ -192,8 +192,15 @@ contains
192
         else
192
         else
193
           cached_segment_paths(cached_segment_count) = trim(working_path)
193
           cached_segment_paths(cached_segment_count) = trim(working_path)
194
         end if
194
         end if
195
-        ! Extract just the name
195
+        ! Extract just the name (remove any leading/trailing slashes)
196
-        cached_segment_names(cached_segment_count) = trim(working_path(start_pos:))
196
+        cached_segment_names(cached_segment_count) = trim(adjustl(working_path(start_pos:)))
197
+        ! Remove leading slash if present
198
+        if (len_trim(cached_segment_names(cached_segment_count)) > 0) then
199
+          if (cached_segment_names(cached_segment_count)(1:1) == "/") then
200
+            cached_segment_names(cached_segment_count) = &
201
+              trim(cached_segment_names(cached_segment_count)(2:))
202
+          end if
203
+        end if
197
         print *, "  Segment ", cached_segment_count, ": ", &
204
         print *, "  Segment ", cached_segment_count, ": ", &
198
                  trim(cached_segment_paths(cached_segment_count)), " -> ", &
205
                  trim(cached_segment_paths(cached_segment_count)), " -> ", &
199
                  trim(cached_segment_names(cached_segment_count))
206
                  trim(cached_segment_names(cached_segment_count))
@@ -208,8 +215,15 @@ contains
208
         else
215
         else
209
           cached_segment_paths(cached_segment_count) = trim(working_path(1:start_pos+slash_pos-2))
216
           cached_segment_paths(cached_segment_count) = trim(working_path(1:start_pos+slash_pos-2))
210
         end if
217
         end if
211
-        ! Extract just the name
218
+        ! Extract just the name (remove any leading/trailing slashes)
212
-        cached_segment_names(cached_segment_count) = trim(working_path(start_pos:start_pos+slash_pos-2))
219
+        cached_segment_names(cached_segment_count) = trim(adjustl(working_path(start_pos:start_pos+slash_pos-2)))
220
+        ! Remove leading slash if present
221
+        if (len_trim(cached_segment_names(cached_segment_count)) > 0) then
222
+          if (cached_segment_names(cached_segment_count)(1:1) == "/") then
223
+            cached_segment_names(cached_segment_count) = &
224
+              trim(cached_segment_names(cached_segment_count)(2:))
225
+          end if
226
+        end if
213
         print *, "  Segment ", cached_segment_count, ": ", &
227
         print *, "  Segment ", cached_segment_count, ": ", &
214
                  trim(cached_segment_paths(cached_segment_count)), " -> ", &
228
                  trim(cached_segment_paths(cached_segment_count)), " -> ", &
215
                  trim(cached_segment_names(cached_segment_count))
229
                  trim(cached_segment_names(cached_segment_count))