Add dotfile handling in Locations section - display hidden files as gray non-clickable items at bottom

- Separate dotfiles (starting with .) from regular locations
- Display dotfiles in gray with disabled cursor
- Keep dotfiles always positioned at the bottom of the list regardless of sort order
- Prevent dotfile selection while maintaining visibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Alihan
2025-10-19 01:37:52 +03:00
parent 91141eadcf
commit 80ca19cb4b

View File

@@ -166,7 +166,20 @@ function App() {
return sorted
}
const getSortedLocations = () => sortItems(locations, locationSort)
const getSortedLocations = () => {
const sorted = sortItems(locations, locationSort)
// Separate dotfiles from regular locations
const regularLocations = sorted.filter(loc => {
const name = loc.name || loc
return !name.startsWith('.')
})
const dotfiles = sorted.filter(loc => {
const name = loc.name || loc
return name.startsWith('.')
})
// Return regular locations first, then dotfiles at the bottom
return [...regularLocations, ...dotfiles]
}
const getSortedDates = () => sortItems(dates, dateSort)
const getSortedFiles = () => sortItems(files, fileSort)
@@ -363,12 +376,16 @@ function App() {
<ul className="space-y-1">
{getSortedLocations().map((location) => {
const locationName = location.name || location
const isDotfile = locationName.startsWith('.')
return (
<li key={locationName}>
<button
onClick={() => handleLocationClick(locationName)}
className={`w-full text-left px-3 py-2 rounded hover:bg-blue-50 transition ${
selectedLocation === locationName ? 'bg-blue-100 font-semibold' : ''
onClick={() => !isDotfile && handleLocationClick(locationName)}
disabled={isDotfile}
className={`w-full text-left px-3 py-2 rounded transition ${
isDotfile
? 'text-gray-400 cursor-not-allowed bg-gray-50'
: `hover:bg-blue-50 ${selectedLocation === locationName ? 'bg-blue-100 font-semibold' : ''}`
}`}
>
{locationName}