refactor: clean up opal-web duplication, dead code, and comment noise
- Deduplicate API_BASE (was defined in both client.js and endpoints.js) - Extract EMPTY_STATE and persist() helper in auth store (DRY) - Extract updateByUuid() in tasks store, normalize to .map() pattern - Remove unused getQueueSize(), Select.svelte, and lib/index.js - Modernize uuid.js to prefer crypto.randomUUID() - Strip ~60 redundant comments that restated self-evident code No behavior changes. Build passes, pre-existing type errors unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
const trimmed = value.trim();
|
||||
if (!trimmed || loading) return;
|
||||
|
||||
// Merge user input with active filter, deduplicating tokens
|
||||
const merged = mergeInputWithFilter(trimmed, $activeFilter || '');
|
||||
|
||||
try {
|
||||
@@ -61,22 +60,17 @@
|
||||
}, 150);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert text at cursor position
|
||||
* @param {string} text
|
||||
*/
|
||||
/** @param {string} text */
|
||||
function insertAtCursor(text) {
|
||||
if (!inputEl) return;
|
||||
const start = inputEl.selectionStart ?? value.length;
|
||||
const end = inputEl.selectionEnd ?? value.length;
|
||||
|
||||
// Add leading space if cursor isn't at start and prev char isn't a space
|
||||
const needsSpace = start > 0 && value[start - 1] !== ' ';
|
||||
const insert = (needsSpace ? ' ' : '') + text;
|
||||
|
||||
value = value.slice(0, start) + insert + value.slice(end);
|
||||
|
||||
// Restore focus and cursor position after the inserted text
|
||||
const newPos = start + insert.length;
|
||||
requestAnimationFrame(() => {
|
||||
if (inputEl) {
|
||||
@@ -86,18 +80,12 @@
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current input value (for PropertyPills smart replace)
|
||||
* @returns {string}
|
||||
*/
|
||||
/** @returns {string} */
|
||||
export function getInputValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the input value (for PropertyPills smart replace)
|
||||
* @param {string} newValue
|
||||
*/
|
||||
/** @param {string} newValue */
|
||||
export function setInputValue(newValue) {
|
||||
value = newValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user