Rewild Your Web
18
fork

Configure Feed

Select the types of activity you want to include in your feed.

homescreen: add an affordance to clear the input field

Signed-off-by: webbeef <me@webbeef.org>

+11 -1
+2 -1
ui/homescreen/index.css
··· 151 151 align-items: center; 152 152 background: var(--bg-menu); 153 153 border-radius: var(--radius-lg); 154 - padding: var(--spacing-sm) var(--spacing-md); 154 + padding: var(--spacing-sm) var(--spacing-sm); 155 155 max-width: 560px; 156 156 margin: 0 auto; 157 157 box-shadow: 0 2px 8px var(--color-shadow-menu); ··· 172 172 margin-right: var(--spacing-sm); 173 173 flex-shrink: 0; 174 174 transition: color var(--transition-fast); 175 + cursor: pointer; 175 176 } 176 177 177 178 .search-input-container:focus-within lucide-icon {
+1
ui/homescreen/index.html
··· 39 39 placeholder="Search or enter URL…" 40 40 autocomplete="off" 41 41 /> 42 + <lucide-icon name="x" id="clear-input"></lucide-icon> 42 43 </div> 43 44 </div> 44 45 </main>
+8
ui/homescreen/index.js
··· 237 237 238 238 // Initialize and signal when ready 239 239 async function initialize() { 240 + document.getElementById("clear-input").addEventListener("click", () => { 241 + searchInput.value = ""; 242 + document.body.classList.remove("searching"); 243 + controller.clear(); 244 + // TODO: figure out a way to not lose searchInput focus when tapping 245 + // the icon to prevent the hide/show again keyboard flash. 246 + searchInput.focus(); 247 + }); 240 248 await Promise.all([loadWidgets(), loadBookmarks()]); 241 249 signalReady(); 242 250 }