feat(khira): complete remediation, performance optimization, and Cloudflare Turnstile integration

- Backend:
  - Fix ListTickets parameter order mismatch for assignee filtering
  - Replicate all 13 PostgreSQL tables and columns during disaster recovery sync and rollback
  - Implement server-side session store with HttpOnly cookies and Bearer tokens
  - Add profile update verification requiring current password
  - Whitelist allowed file uploads and apply strict security headers (nosniff, CSP)
  - Enforce role check on error deletion (admin/lead/tester only) and authenticate SSE stream
  - Align foreign key user_id for saved filters and api tokens
  - Add ReopenTicket endpoint and workflow
  - Integrate Cloudflare Turnstile verification with testing/production key support
- Frontend:
  - Remove liquid glass displacement filter and lens capsule for high-performance UI
  - Eliminate recursive backdrop-filters and heavy inset shadows
  - Add debounced search and optimize SSE re-rendering
  - Wire Saved Views filter bar with creation, active indicators, and deletion
  - Add Linked & Related Tickets management UI to sheet
  - Seed 6 demo personas in PostgreSQL with instant sign-in
  - Add Cloudflare Turnstile widgets to authentication modals
  - Add keyboard arrow navigation to Command Palette
- Image Manipulator, Docs & Tooling:
  - Sync image manipulator updates, docs, and test coordinates
This commit is contained in:
2026-11-17 18:39:25 +05:30
parent 72ea6cd59d
commit cc6bed127b
84 changed files with 1869 additions and 1339 deletions
+327 -107
View File
@@ -7,6 +7,8 @@ const ls=k=>{try{return localStorage.getItem(k)}catch(e){return null}};
/* ── Inline SVG Icon System (Zero FOUT, Zero Ligature Glitches) ── */
const ICONS = {
bookmark: `<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"/>`,
filter: `<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/>`,
ticket: `<path d="M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"/><path d="M13 5v2"/><path d="M13 11v2"/><path d="M13 17v2"/>`,
confirmation_number: `<path d="M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"/><path d="M13 5v2"/><path d="M13 11v2"/><path d="M13 17v2"/>`,
bug: `<path d="m8 2 1.88 1.88"/><path d="M14.12 3.88 16 2"/><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"/><path d="M12 20v-9"/><path d="M6.53 9C4.6 8.8 3 7.1 3 5"/><path d="M6 13H2"/><path d="M3 21c0-2.1 1.7-3.9 3.8-4"/><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/><path d="M22 13h-4"/><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"/>`,
@@ -41,6 +43,7 @@ const ICONS = {
error: `<circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/>`,
lock: `<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`,
shield: `<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>`,
history: `<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>`,
building: `<rect x="4" y="2" width="16" height="20" rx="2" ry="2"/><line x1="9" y1="22" x2="9" y2="12"/><line x1="15" y1="22" x2="15" y2="12"/><line x1="15" y1="12" x2="9" y2="12"/><line x1="8" y1="6" x2="8.01" y2="6"/><line x1="12" y1="6" x2="12.01" y2="6"/><line x1="16" y1="6" x2="16.01" y2="6"/><line x1="8" y1="10" x2="8.01" y2="10"/><line x1="12" y1="10" x2="12.01" y2="10"/><line x1="16" y1="10" x2="16.01" y2="10"/>`
};
@@ -51,7 +54,7 @@ const ic=(name,size=18,cls='')=>{
const ms=ic; // drop-in replacement for any legacy calls
const S={
u:null, t:[], us:[], e:[], ts:{}, es:{}, n:[],
u:null, t:[], us:[], e:[], ts:{}, es:{}, n:[], savedFilters:[],
sec:'tickets', scope:'assigned', st:'', pr:'', ty:'', fa:'', view:'board', q:'', ef:'', tid:null,
bulkMode:false, bulkSelected:new Set(),
analyticsData:null, analyticsTargetUser:null
@@ -71,11 +74,14 @@ const EMOJIS=['⚡','👩‍💻','👨‍💻','🕵️‍♂️','👤','🚀'
/* ── API ── */
async function api(p,m='GET',b){
const h={},un=S.u?.username||ls('khira_active_user');
const h={};
const tok=ls('khira_session_token');
if(tok)h['Authorization']='Bearer '+tok;
const un=S.u?.username||ls('khira_active_user');
if(un)h['X-Khira-User']=un;
if(m!=='GET')h['Content-Type']='application/json';
try{
const r=await fetch(p,{method:m,headers:h,body:b?JSON.stringify(b):undefined});
const r=await fetch(p,{method:m,headers:h,credentials:'same-origin',body:b?JSON.stringify(b):undefined});
const j=(r.headers.get('content-type')||'').includes('json')?await r.json():{};
if(!r.ok){j._f=1;if(!j.error)j.error='Request failed ('+r.status+')'}
return j;
@@ -223,80 +229,22 @@ function dlg(o){
if(!d.open)d.showModal();
}
/* ── Kube.io Liquid Glass Precision Lens Capsule ── */
function initKubeLens() {
const lens = $('#kubePrecisionLens');
const btnToggle = $('#btnToggleLens');
const btnClose = $('#btnCloseLens');
if (!lens || !btnToggle) return;
let active = false;
let posX = window.innerWidth / 2 - 105;
let posY = 180;
let isDragging = false;
let startX = 0, startY = 0;
let rafId = null;
function setPos(x, y) {
posX = Math.max(10, Math.min(window.innerWidth - 220, x));
posY = Math.max(70, Math.min(window.innerHeight - 160, y));
if (!rafId) {
rafId = requestAnimationFrame(() => {
lens.style.transform = `translate3d(${posX}px, ${posY}px, 0)`;
rafId = null;
});
}
}
function showLens(on) {
active = on;
lens.hidden = !on;
btnToggle.classList.toggle('on', on);
if (on) {
setPos(window.innerWidth / 2 - 105, 180);
toast('Precision Liquid Glass Lens activated (draggable)');
}
}
btnToggle.addEventListener('click', () => showLens(!active));
if (btnClose) btnClose.addEventListener('click', () => showLens(false));
lens.addEventListener('mousedown', e => {
if (e.target.closest('.kube-lens-close')) return;
isDragging = true;
startX = e.clientX - posX;
startY = e.clientY - posY;
lens.style.cursor = 'grabbing';
e.preventDefault();
});
window.addEventListener('mousemove', e => {
if (!isDragging) return;
setPos(e.clientX - startX, e.clientY - startY);
});
window.addEventListener('mouseup', () => {
if (isDragging) {
isDragging = false;
lens.style.cursor = 'grab';
}
});
}
/* ── Data Refresh & State Polling ── */
let pollId;
async function refresh(anim){
if(!S.u)return;
const [tr,ts,er,es,nr,ur]=await Promise.all([
const [tr,ts,er,es,nr,ur,fr]=await Promise.all([
api('/khira/api/tickets?limit=100'),
api('/khira/api/stats'),
api('/khira/api/errors?status=all_with_drafts&limit=100'),
api('/khira/api/errors/stats'),
api('/khira/api/notifications'),
api('/khira/api/users')
api('/khira/api/users'),
api('/khira/api/filters')
]);
const newT=tr.tickets||[],newTs=ts||{},newE=er.errors||[],newEs=es||{},newN=nr.notifications||[];
if(ur.users)S.us=ur.users;
if(fr&&fr.filters)S.savedFilters=fr.filters;
const changed=anim||newT.length!==S.t.length||newE.length!==S.e.length||JSON.stringify(newTs)!==JSON.stringify(S.ts)||JSON.stringify(newEs)!==JSON.stringify(S.es);
S.t=newT;S.ts=newTs;S.e=newE;S.es=newEs;S.n=newN;
$('#dot').hidden=!S.n.some(x=>!x.read);
@@ -438,6 +386,49 @@ function renderT(anim){
put('#list',sectionsHtml||`<div class="big">${ic('confirmation_number',36)}<p>No tickets match these filters.</p></div>`);
}
put('#title','Tickets');
renderSavedFilters();
}
async function loadSavedFilters(){
if(!S.u)return;
try{
const res=await api('/khira/api/filters');
S.savedFilters=res.filters||[];
renderSavedFilters();
}catch(e){}
}
function renderSavedFilters(){
const bar=$('#savedFilterChips');
if(!bar)return;
if(!S.u||S.sec!=='tickets'){
bar.style.display='none';
return;
}
bar.style.display='flex';
const filters=S.savedFilters||[];
let html=`<div class="sf-header"><span class="saved-filter-label">${ic('bookmark',13)} Views:</span></div><div class="sf-items">`;
if(!filters.length){
html+=`<span class="sf-empty">No saved views</span>`;
}else{
html+=filters.map(f=>{
let isActive=false;
try{
const p=JSON.parse(f.filter_json);
isActive=(p.st===undefined||p.st===S.st)&&
(p.pr===undefined||p.pr===S.pr)&&
(p.ty===undefined||p.ty===S.ty)&&
(p.fa===undefined||p.fa===S.fa)&&
(p.scope===undefined||p.scope===S.scope);
}catch(e){}
return`<div class="saved-filter-pill ${isActive?'active':''}" data-fid="${esc(f.id)}" title="Apply ${esc(f.name)}">
<span class="sf-click">${esc(f.name)}</span>
<button class="sf-del" data-delfid="${esc(f.id)}" title="Delete view">&times;</button>
</div>`;
}).join('');
}
html+=`</div><button class="btn-save-filter" id="btnSaveFilter" title="Save current filter set">${ic('add',13)} <span>Save view</span></button>`;
bar.innerHTML=html;
}
function initBoardDragDrop(){
@@ -489,7 +480,7 @@ function initBoardDragDrop(){
toast(`Ticket ${tid} moved to In Progress`);
await refresh(false);
} else if (targetCol === 'open') {
await api(`/khira/api/tickets/${encodeURIComponent(tid)}/resume`, 'POST', { remarks: 'Moved to Open' });
await api(`/khira/api/tickets/${encodeURIComponent(tid)}/reopen`, 'POST', { remarks: 'Moved to Open' });
toast(`Ticket ${tid} moved to Open`);
await refresh(false);
}
@@ -994,15 +985,17 @@ function nav(sec){
}
/* ── Ticket Detail Sheet ── */
function sheet(id){
const t=S.t.find(x=>x.id===id);if(!t)return;S.tid=id;
function renderSheetDOM(t){
const p=pri(t),s=st(t),g=t.ticket_type==='general',rem=t.remarks||[],links=(t.links||[]).map(l=>l.url||l);
const atts=t.attachments||[];
const rels=t.related_ticket_ids||[];
const kv=(k,v,m)=>`<div><dt>${k}</dt><dd${m&&m!=='html'?' class="mono"':''}>${m==='html'?v:esc(v||'—')}</dd></div>`;
let meta='';
if(g){
meta=kv('Reported by',who(t.reporter||{name:t.created_by_name,username:t.created_by,role:t.created_by_role},t.created_by_name),'html');
meta=(t.general_category?kv('Category',t.general_category):'')
+(t.department?kv('Department',t.department):'')
+kv('Reported by',who(t.reporter||{name:t.created_by_name,username:t.created_by,role:t.created_by_role},t.created_by_name),'html');
}else{
meta=(t.app||t.app_name?kv('Application',t.app||t.app_name):'')
+(t.version?kv('Version',t.version):'')
@@ -1022,17 +1015,14 @@ function sheet(id){
const isAssignee = myUser && (myUser === assigneeUser);
const isResolver = myUser && (myUser === resolverUser || myName === resolverUser);
// Corporate Privacy & Permission Rules:
// 1. "noone can delete the ticket assigned to him/her, only the person who has assigned can delete that"
// If the ticket is assigned to me, and I did NOT assign/create it, I CANNOT delete it!
// Corporate Privacy & Permission Rules
const canDel = (isCreator || (isAdm && !isAssignee)) && (!isAssignee || isCreator);
// 2. "only the person when has resolved the ticket can move it to archive"
const isDone = s === 'completed' || s === 'closed';
const canArchive = isDone && (isResolver || isCreator || isAdm);
const archBtn = canArchive ? (t.archived ? `<button class="tn" data-do="unarchive">${ic('unarchive',16)} Restore</button>` : `<button class="tn" data-do="archive">${ic('archive',16)} Archive</button>`) : '';
const tagsList=(t.tags||[]).map(tg=>`<span class="tag-pill">${esc(tg)} <button type="button" class="tag-remove-btn" data-rm-tag="${esc(tg)}">&times;</button></span>`).join('');
const relsList=rels.map(r=>`<span class="tag-pill" style="cursor:pointer" data-view-rel="${esc(r)}">${ic('link',12)} ${esc(r)} <button type="button" class="tag-remove-btn" data-rm-rel="${esc(r)}">&times;</button></span>`).join('');
$('#sheet').innerHTML=`<div class="sbd"><header class="sh"><button class="ib" data-x aria-label="Close">${ic('close',18)}</button><span class="id">${esc(t.id)}</span><span class="pb ${p.toLowerCase()}">${p}</span>${t.archived?'<span class="stt archived">Archived</span>':`<span class="stt ${s}">${STAT[s]||esc(s)}</span>`}</header>
<div class="sb"><h2>${esc(t.title)}</h2>
@@ -1045,19 +1035,23 @@ function sheet(id){
<div class="tag-list" id="sheetTags">${tagsList} <button type="button" class="chip" id="btnAddTagBtn" style="height:24px;font-size:11px">+ Add tag</button></div>
</div>
<!-- Relations Section -->
<div style="margin:12px 0">
<h5>Linked & Related Tickets</h5>
<div class="tag-list" id="sheetRels">${relsList} <button type="button" class="chip" id="btnLinkTicketBtn" style="height:24px;font-size:11px">+ Link ticket</button></div>
</div>
<div><h5>Description</h5><p style="white-space:pre-wrap">${esc(t.description||'No description provided')}</p></div>
${atts.length?`<div><h5>Attached Images / Files</h5><div class="att-row">${atts.map(a=>{
const isImg=a.type==='image'||/\.(png|jpe?g|webp|gif|svg)$/i.test(a.url);
const isImg=a.type==='image'||/\.(png|jpe?g|webp|gif)$/i.test(a.url);
return isImg?`<div class="att-card"><a href="${esc(a.url)}" target="_blank" rel="noopener"><img src="${esc(a.url)}" alt="${esc(a.name)}" class="att-thumb"></a><span class="ell">${esc(a.name)}</span></div>`
:`<div class="att-card"><a href="${esc(a.url)}" target="_blank" rel="noopener" class="tn" style="height:36px">${ic('attachment',16)}<span class="ell">${esc(a.name)}</span></a></div>`;
}).join('')}</div></div>`:''}
${links.length?`<div class="lk"><h5>Links</h5>${links.map(u=>`<a href="${esc(u)}" target="_blank" rel="noopener">${esc(String(u).replace(/^https?:\/\//,''))}</a>`).join('')}</div>`:''}
<div><h5>Activity · ${rem.length}</h5>${rem.map(r=>{const sys=r.system||['created','hold','complete','reassigned','priority','resume','archive','unarchive','sla_breach','reassign'].includes(r.type);return`<div class="tle${sys?' sys':''}"><b>${sys?'Khira System':who(r.author||{name:r.author_name,username:r.author_username,role:r.author_role},r.author_name)}</b><small>${ago(r.created_at)}</small><p>${esc(r.text||r.body)}</p></div>`}).join('')}
<div><h5>Activity · ${rem.length}</h5>${rem.map(r=>{const sys=r.system||['created','hold','complete','reassigned','priority','resume','reopen','archive','unarchive','sla_breach','reassign','link'].includes(r.type);return`<div class="tle${sys?' sys':''}"><b>${sys?'Khira System':who(r.author||{name:r.author_name,username:r.author_username,role:r.author_role},r.author_name)}</b><small>${ago(r.created_at)}</small><p>${esc(r.text||r.body)}</p></div>`}).join('')}
<form class="cmp" id="rf"><textarea id="rt" rows="1" placeholder="Add a remark (Markdown supported)"></textarea><button class="ib" aria-label="Send">${ic('send',16)}</button></form></div></div>
<footer class="sf">${canDel?`<button class="del-btn" data-do="del">${ic('delete',16)} Delete</button>`:''}${archBtn}${s==='hold'?`<button class="tn" data-do="resume">${ic('play_arrow',16)} Resume</button>`:''}${s==='completed'?'':(s==='hold'?'':`<button class="tn" data-do="hold">${ic('pause',16)} Hold</button>`)+`<button class="fb" data-do="done">Complete</button>`}</footer></div>`;
if(!$('#sheet').open)$('#sheet').showModal();
// Add Tag button handler
$('#btnAddTagBtn')?.addEventListener('click',()=>{
@@ -1082,6 +1076,58 @@ ${links.length?`<div class="lk"><h5>Links</h5>${links.map(u=>`<a href="${esc(u)}
else{toast('Tag removed');await refresh();sheet(t.id);}
});
});
// Link Ticket button handler
$('#btnLinkTicketBtn')?.addEventListener('click',()=>{
dlg({
title:'Link Related Ticket',
sub:'Link with another issue ID (e.g. KHR-102)',
body:fld('target_id','Related Ticket ID',{req:1,placeholder:'KHR-102'})+fld('rel_type','Relationship',{t:'select',opts:[['related','Related to'],['blocks','Blocks'],['blocked_by','Blocked by'],['duplicate','Duplicates']]}),
ok:'Link Ticket',
go:async v=>{
const tid=v.target_id.trim().toUpperCase();
const r=await api(`/khira/api/tickets/${encodeURIComponent(t.id)}/relations`,'POST',{target_ticket_id:tid,relation_type:v.rel_type});
if(r._f||r.error){toast(r.error||'Failed to link ticket','err');return false}
toast('Ticket linked');await refresh();sheet(t.id);
}
});
});
// Unlink / view relation buttons
$$('[data-rm-rel]').forEach(btn=>{
btn.addEventListener('click',async e=>{
e.stopPropagation();
const rel=btn.dataset.rmRel;
const r=await api(`/khira/api/tickets/${encodeURIComponent(t.id)}/relations/${encodeURIComponent(rel)}`,'DELETE');
if(r._f)toast(r.error||'Failed to unlink','err');
else{toast('Ticket unlinked');await refresh();sheet(t.id);}
});
});
$$('[data-view-rel]').forEach(el=>{
el.addEventListener('click',()=>{
const rel=el.dataset.viewRel;
if(rel) sheet(rel);
});
});
}
async function sheet(id, skipFetch){
let t=S.t.find(x=>x.id===id);
if(!t)return;
S.tid=id;
renderSheetDOM(t);
if(!$('#sheet').open)$('#sheet').showModal();
if(!skipFetch){
try {
const full = await api(`/khira/api/tickets/${encodeURIComponent(id)}`);
if(full && full.id && S.tid === id && $('#sheet').open){
const idx = S.t.findIndex(x=>x.id===id);
if(idx !== -1) S.t[idx] = full;
renderSheetDOM(full);
}
} catch(e) {}
}
}
async function act(a,b,m){
@@ -1123,9 +1169,13 @@ function newTicket(){
dlg({wide:1,title:'New ticket',sub:`Reporting as ${esc(S.u.name)}`,ok:'Create ticket',
body:`${rad('type',[['general','General'],['application','Application']],'general')}
<fieldset class="grp" data-g="general">
${fld('assignee_username','Choose assignee',{t:'select',opts:usOpts(1),req:1})}
<div class="g2">
${fld('assignee_username','Choose assignee',{t:'select',opts:usOpts(1),req:1})}
${fld('general_category','General Category',{t:'select',opts:[['Infrastructure','Infrastructure'],['Security','Security'],['Operations','Operations'],['Design','Design'],['DevOps','DevOps'],['General','General']]})}
</div>
${fld('department','Department',{t:'select',opts:[['Engineering','Engineering'],['QA / Testing','QA / Testing'],['Product','Product'],['Operations','Operations'],['IT Support','IT Support']]})}
${fld('title','Write title',{req:1})}
${fld('description','Description',{t:'area',rows:5,req:1})}
${fld('description','Description',{t:'area',rows:4,req:1})}
</fieldset>
<fieldset class="grp" data-g="application" hidden disabled>
<label class="fld sel">
@@ -1313,9 +1363,13 @@ function newTicket(){
fd.append('file',file);
try{
const un=S.u?.username||ls('khira_active_user');
const upRes=await fetch('/khira/api/upload',{method:'POST',headers:{'X-Khira-User':un},body:fd});
const tok=ls('khira_session_token');
const upHeaders={'X-Khira-User':un};
if(tok)upHeaders['Authorization']='Bearer '+tok;
const upRes=await fetch('/khira/api/upload',{method:'POST',headers:upHeaders,credentials:'same-origin',body:fd});
const upJson=await upRes.json();
if(upJson.url)uploadedImageUrl=upJson.url;
const url=upJson.url||upJson.attachment?.url;
if(url)uploadedImageUrl=url;
}catch(err){
console.error('Failed to upload image attachment',err);
toast('Could not upload image, submitting ticket without it','err');
@@ -1390,8 +1444,9 @@ function errD(id){
function escD(id){
const e=S.e.find(x=>x.id===id);
const msg = (e.message || '').slice(0,60);
dlg({title:'Escalate error to ticket',sub:e.id,
body:fld('title','Ticket title',{req:1,v:`[${e.platform||'App'} · ${e.app||e.app_name}] ${e.exception_type||e.error_type}: ${e.message.slice(0,60)}`})+fld('priority','Priority',{t:'select',opts:PRI,v:'P1'})+fld('assignee','Assign to',{t:'select',opts:usOpts(1),req:1,v:e.assigned_to||''}),
body:fld('title','Ticket title',{req:1,v:`[${e.platform||'App'} · ${e.app||e.app_name}] ${e.exception_type||e.error_type}: ${msg}`})+fld('priority','Priority',{t:'select',opts:PRI,v:'P1'})+fld('assignee','Assign to',{t:'select',opts:usOpts(1),req:1,v:e.assigned_to||''}),
ok:'Escalate',go:async v=>{
const r=await api(`/khira/api/errors/${encodeURIComponent(id)}/escalate`,'POST',{title:v.title,priority:v.priority,assigned_to:v.assignee});
if(r._f){toast(r.error,'err');return false}
@@ -1609,15 +1664,21 @@ function reportErr(prefill={}){
fd.append('file',file);
try{
toast('Uploading image...');
const un=S.u?.username||ls('khira_active_user');
const tok=ls('khira_session_token');
const upHeaders={'X-Khira-User':un};
if(tok)upHeaders['Authorization']='Bearer '+tok;
const res=await fetch('/khira/api/upload',{
method:'POST',
headers:{'X-Khira-User':S.u?.username||''},
headers:upHeaders,
credentials:'same-origin',
body:fd
});
const data=await res.json();
if(data.status==='ok'&&data.attachment){
imgUrlInput.value=data.attachment.url;
thumb.src=data.attachment.url;
const url=data.url||data.attachment?.url;
if(data.status==='ok'&&url){
imgUrlInput.value=url;
thumb.src=url;
imgName.textContent=file.name;
placeholder.hidden=true;
previewWrap.hidden=false;
@@ -1841,8 +1902,7 @@ function renderCmdResults(q){
{id:'act_analytics',title:'Go to Analytics',sub:'View team velocity and charts',type:'Action',icon:'ticket',go:()=>nav('analytics')},
{id:'act_board',title:'Switch to Kanban Board',sub:'View board columns',type:'Action',icon:'view_kanban',go:()=>{S.view='board';nav('tickets')}},
{id:'act_list',title:'Switch to List View',sub:'View date-grouped list',type:'Action',icon:'view_list',go:()=>{S.view='list';nav('tickets')}},
{id:'act_theme',title:'Toggle Dark/Light Theme',sub:'Switch UI color theme',type:'Action',icon:'sun',go:()=>{theme(document.documentElement.dataset.theme==='dark'?'light':'dark')}},
{id:'act_lens',title:'Toggle Liquid Glass Precision Lens',sub:'Kube.io optical refraction lens',type:'Action',icon:'search',go:()=>$('#btnToggleLens')?.click()}
{id:'act_theme',title:'Toggle Dark/Light Theme',sub:'Switch UI color theme',type:'Action',icon:'sun',go:()=>{theme(document.documentElement.dataset.theme==='dark'?'light':'dark')}}
];
let items=[];
@@ -1864,6 +1924,7 @@ function renderCmdResults(q){
items=matchedActions.concat(matchedTickets).concat(matchedErrors).concat(matchedUsers);
}
cmdSelectedIndex=0;
if(!items.length){
list.innerHTML='<div style="padding:20px;text-align:center;color:var(--sub)">No results found.</div>';
return;
@@ -1885,8 +1946,29 @@ function renderCmdResults(q){
});
}
let cmdSelectedIndex = 0;
$('#btnCmdK')?.addEventListener('click',openCmdPalette);
$('#cmdInput')?.addEventListener('input',e=>renderCmdResults(e.target.value));
$('#cmdInput')?.addEventListener('keydown',e=>{
const items=$$('#cmdResults .cmd-item');
if(!items.length)return;
if(e.key==='ArrowDown'){
e.preventDefault();
cmdSelectedIndex=(cmdSelectedIndex+1)%items.length;
items.forEach((el,idx)=>el.classList.toggle('active',idx===cmdSelectedIndex));
items[cmdSelectedIndex]?.scrollIntoView({block:'nearest'});
}else if(e.key==='ArrowUp'){
e.preventDefault();
cmdSelectedIndex=(cmdSelectedIndex-1+items.length)%items.length;
items.forEach((el,idx)=>el.classList.toggle('active',idx===cmdSelectedIndex));
items[cmdSelectedIndex]?.scrollIntoView({block:'nearest'});
}else if(e.key==='Enter'){
e.preventDefault();
if(items[cmdSelectedIndex]){
items[cmdSelectedIndex].click();
}
}
});
$('#cmdPalette')?.addEventListener('click',e=>{if(e.target.id==='cmdPalette')closeCmdPalette()});
/* ── Keyboard Shortcuts ── */
@@ -2070,10 +2152,14 @@ function profile(){
try{
toast('Uploading avatar photo...');
const un=S.u?.username||ls('khira_active_user');
const upRes=await fetch('/khira/api/upload',{method:'POST',headers:{'X-Khira-User':un},body:fd});
const tok=ls('khira_session_token');
const upHeaders={'X-Khira-User':un};
if(tok)upHeaders['Authorization']='Bearer '+tok;
const upRes=await fetch('/khira/api/upload',{method:'POST',headers:upHeaders,credentials:'same-origin',body:fd});
const upJson=await upRes.json();
if(upJson.url){
curImgUrl=upJson.url;
const url=upJson.url||upJson.attachment?.url;
if(url){
curImgUrl=url;
hidImg.value=curImgUrl;
curType='image';
hidType.value='image';
@@ -2109,7 +2195,7 @@ function pop(){
const p=$('#pop');
if(!p.hidden){p.hidden=true;return}
const unread=S.n.filter(x=>!x.read);
p.innerHTML=`<div class="pop-h"><h4>Notifications</h4><button class="tb" data-d="readall">Mark all read</button></div>${S.n.length?S.n.map(x=>`<div class="ni${x.read?'':' un'}" data-n="${esc(x.ticket_id)}"><p><b>${esc(x.title)}</b> · <small>${ago(x.created_at)}</small></p><p class="sub">${esc(x.message)}</p></div>`).join(''):'<div class="emp">No notifications</div>'}`;
p.innerHTML=`<div class="pop-h"><h4>Notifications</h4><button class="tb" data-d="readall">Mark all read</button></div>${S.n.length?S.n.map(x=>`<div class="ni${x.read?'':' un'}" data-n="${esc(x.ticket_id)}" data-nid="${esc(x.id)}"><p><b>${esc(x.title)}</b> · <small>${ago(x.created_at)}</small></p><p class="sub">${esc(x.message)}</p></div>`).join(''):'<div class="emp">No notifications</div>'}`;
p.hidden=false;
}
@@ -2168,6 +2254,51 @@ document.addEventListener('click',async e=>{
if(x=c('[data-st]')){S.st=x.dataset.st;return renderT(true)}
if(x=c('[data-ef]')){S.ef=x.dataset.ef;return renderE(true)}
// Saved filters
if(x=c('[data-delfid]')){
const fid=x.dataset.delfid;
if(confirm('Delete this saved view?')){
api(`/khira/api/filters/${encodeURIComponent(fid)}`,'DELETE').then(r=>{
if(r._f)toast(r.error||'Failed to delete view','err');
else{toast('Saved view deleted');loadSavedFilters();}
});
}
return;
}
if(x=c('[data-fid]')){
const fid=x.dataset.fid;
const sf=(S.savedFilters||[]).find(it=>it.id===fid);
if(sf){
try{
const cfg=JSON.parse(sf.filter_json);
if(cfg.scope!==undefined)S.scope=cfg.scope;
if(cfg.st!==undefined)S.st=cfg.st;
if(cfg.pr!==undefined)S.pr=cfg.pr;
if(cfg.ty!==undefined)S.ty=cfg.ty;
if(cfg.fa!==undefined)S.fa=cfg.fa;
if(cfg.q!==undefined){S.q=cfg.q;const qEl=$('#q');if(qEl)qEl.value=cfg.q;}
const fpEl=$('#fp');if(fpEl)fpEl.value=S.pr;
const ftEl=$('#ft');if(ftEl)ftEl.value=S.ty;
const faEl=$('#fa');if(faEl)faEl.value=S.fa;
toast(`Applied view: ${sf.name}`);
renderT(true);
}catch(err){toast('Corrupt filter configuration','err');}
}
return;
}
if(c('#btnSaveFilter')){
const defName=(S.pr?S.pr+' ':'')+(S.ty?S.ty+' ':'')+'View';
const name=prompt('Enter a name for this saved view:',defName);
if(name&&name.trim()){
const filterJSON=JSON.stringify({scope:S.scope,st:S.st,pr:S.pr,ty:S.ty,fa:S.fa,q:S.q});
api('/khira/api/filters','POST',{name:name.trim(),filter_json:filterJSON}).then(r=>{
if(r._f)toast(r.error||'Failed to save view','err');
else{toast('View saved successfully');loadSavedFilters();}
});
}
return;
}
// Database tools
if(c('#btnSyncBackup'))return adminSyncDB();
if(c('#btnRollbackBackup'))return adminRollbackDB();
@@ -2196,7 +2327,14 @@ document.addEventListener('click',async e=>{
if(d==='readall'){await api('/khira/api/notifications/read','POST');await refresh();toast('All marked read');$('#pop').hidden=true}
return;
}
if(x=c('[data-n]')){$('#pop').hidden=true;if(x.dataset.n)sheet(x.dataset.n);return}
if(x=c('[data-n]')){
$('#pop').hidden=true;
if(x.dataset.nid){
api(`/khira/api/notifications/${encodeURIComponent(x.dataset.nid)}/read`,'POST').then(()=>refresh(false));
}
if(x.dataset.n)sheet(x.dataset.n);
return;
}
if(c('[data-copy]'))return navigator.clipboard.writeText($('#ctx').textContent).then(()=>toast('Copied'));
if(c('#btnLogAppErr'))return reportErr({continue_app:true});
@@ -2215,14 +2353,67 @@ document.addEventListener('change',e=>{
if(t.dataset.act==='prio')act('priority',{priority:t.value},'Priority updated');
});
let searchDebounceTimer = null;
document.addEventListener('input',e=>{
if(e.target.id==='q'){S.q=e.target.value.trim().toLowerCase();render(false)}
if(e.target.id==='q'){
clearTimeout(searchDebounceTimer);
searchDebounceTimer = setTimeout(() => {
S.q = e.target.value.trim().toLowerCase();
render(false);
}, 200);
}
});
document.addEventListener('submit',e=>{
if(e.target.id==='rf'){e.preventDefault();remark()}
});
/* ── Cloudflare Turnstile Integration ── */
let turnstileSiteKey = '';
let turnstileInWidgetId = null;
let turnstileUpWidgetId = null;
let turnstileInToken = '';
let turnstileUpToken = '';
async function setupTurnstile() {
try {
const res = await api('/khira/api/auth/turnstile-config');
if (res && res.site_key) {
turnstileSiteKey = res.site_key;
renderTurnstileWidgets();
}
} catch(e) {}
}
function renderTurnstileWidgets() {
if (!window.turnstile || !turnstileSiteKey) {
setTimeout(renderTurnstileWidgets, 300);
return;
}
const elIn = document.getElementById('turnstileWidgetIn');
if (elIn && turnstileInWidgetId === null) {
try {
turnstileInWidgetId = window.turnstile.render(elIn, {
sitekey: turnstileSiteKey,
theme: 'dark',
callback: tok => { turnstileInToken = tok; },
'expired-callback': () => { turnstileInToken = ''; }
});
} catch(e) {}
}
const elUp = document.getElementById('turnstileWidgetUp');
if (elUp && turnstileUpWidgetId === null) {
try {
turnstileUpWidgetId = window.turnstile.render(elUp, {
sitekey: turnstileSiteKey,
theme: 'dark',
callback: tok => { turnstileUpToken = tok; },
'expired-callback': () => { turnstileUpToken = ''; }
});
} catch(e) {}
}
}
/* ── Auth System ── */
$('#atabs')?.addEventListener('click',e=>{
const b=e.target.closest('button');if(!b)return;
@@ -2233,22 +2424,56 @@ $('#atabs')?.addEventListener('click',e=>{
$('#fIn')?.addEventListener('submit',async e=>{
e.preventDefault();if(!chk($('#fIn')))return;
const u=$('#lu').value.trim(),p=$('#lp').value;
const r=await api('/khira/api/auth/login','POST',{username:u,password:p});
if(r._f){toast(r.error||'Sign in failed','err');return}
const r=await api('/khira/api/auth/login','POST',{
username:u,
password:p,
turnstile_token:turnstileInToken
});
if(r._f){
toast(r.error||'Sign in failed','err');
if(window.turnstile && turnstileInWidgetId !== null){
try{window.turnstile.reset(turnstileInWidgetId);turnstileInToken='';}catch(e){}
}
return;
}
if(r.token){try{localStorage.khira_session_token=r.token}catch(e){}}
try{localStorage.khira_active_user=r.user.username}catch(e){}
boot(r.user);
});
$('#fUp')?.addEventListener('submit',async e=>{
e.preventDefault();if(!chk($('#fUp')))return;
const r=await api('/khira/api/auth/register','POST',{name:$('#rn').value.trim(),username:$('#ru').value.trim(),password:$('#rp').value,role:$('#rr').value});
if(r._f){toast(r.error||'Registration failed','err');return}
const r=await api('/khira/api/auth/register','POST',{
name:$('#rn').value.trim(),
username:$('#ru').value.trim(),
password:$('#rp').value,
role:$('#rr').value,
turnstile_token:turnstileUpToken
});
if(r._f){
toast(r.error||'Registration failed','err');
if(window.turnstile && turnstileUpWidgetId !== null){
try{window.turnstile.reset(turnstileUpWidgetId);turnstileUpToken='';}catch(e){}
}
return;
}
if(r.token){try{localStorage.khira_session_token=r.token}catch(e){}}
try{localStorage.khira_active_user=r.user.username}catch(e){}
boot(r.user);
});
$$('.demo button').forEach(b=>{
b.onclick=()=>{$('#lu').value=b.dataset.d;$('#lp').value=b.dataset.d+'123';$('#fIn').dispatchEvent(new Event('submit'))};
b.onclick=async()=>{
const uname = b.dataset.d;
const pass = uname + '123';
$('#lu').value = uname;
$('#lp').value = pass;
const r = await api('/khira/api/auth/login','POST',{username:uname, password:pass});
if(r._f){toast(r.error||'Demo sign in failed','err');return}
if(r.token){try{localStorage.khira_session_token=r.token}catch(e){}}
try{localStorage.khira_active_user=r.user.username}catch(e){}
boot(r.user);
};
});
$('#btnForgot')?.addEventListener('click',()=>{
@@ -2321,12 +2546,7 @@ async function handleRealtimeEvent(evt) {
sheet(S.tid);
}
// 3. If currently on Analytics view:
if (S.sec === 'analytics') {
renderA(false);
}
// 4. Subtle visual highlight on affected card
// 3. Subtle visual highlight on affected card
if (tId) {
const card = document.querySelector(`.card[data-t="${tId}"]`);
if (card) {
@@ -2342,7 +2562,6 @@ async function boot(u){
$('#auth').hidden=true;
$('#app').hidden=false;
updateMe(u);
initKubeLens();
initRealtime();
await refresh(true);
clearInterval(pollId);
@@ -2356,5 +2575,6 @@ async function boot(u){
}else{
$('#auth').hidden=false;
$('#app').hidden=true;
setupTurnstile();
}
})();
+4 -32
View File
@@ -9,33 +9,12 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Flex:wght@400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/khira/styles.css?v=5">
<link rel="stylesheet" href="/khira/styles.css?v=6">
<script>try{document.documentElement.dataset.theme=localStorage.khira_theme||'dark'}catch(e){}</script>
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit" async defer></script>
</head>
<body>
<!-- Kube.io SVG Liquid Glass Magnifying Lens Filter -->
<svg color-interpolation-filters="sRGB" style="position:fixed;width:0;height:0;pointer-events:none;z-index:-1;opacity:0" aria-hidden="true">
<defs>
<!-- Kube.io Precision Magnifying Glass Filter -->
<filter id="kube-magnifying-glass-filter" color-interpolation-filters="sRGB" x="-20%" y="-20%" width="140%" height="140%">
<feImage href="/khira/assets/magnifying-map.png" x="0" y="0" width="210" height="150" result="magnifying_displacement_map"></feImage>
<feDisplacementMap in="SourceGraphic" in2="magnifying_displacement_map" xChannelSelector="R" yChannelSelector="G" result="magnified_source" scale="24"></feDisplacementMap>
<feGaussianBlur in="magnified_source" stdDeviation="0" result="blurred_source"></feGaussianBlur>
<feImage href="/khira/assets/displacement-map.png" x="0" y="0" width="210" height="150" result="displacement_map"></feImage>
<feDisplacementMap in="blurred_source" in2="displacement_map" xChannelSelector="R" yChannelSelector="G" result="displaced" scale="98.25"></feDisplacementMap>
<feColorMatrix in="displaced" type="saturate" result="displaced_saturated" values="9"></feColorMatrix>
<feImage href="/khira/assets/specular-map.png" x="0" y="0" width="210" height="150" result="specular_layer"></feImage>
<feComposite in="displaced_saturated" in2="specular_layer" operator="in" result="specular_saturated"></feComposite>
<feComponentTransfer in="specular_layer" result="specular_faded">
<feFuncA type="linear" slope="0.5"></feFuncA>
</feComponentTransfer>
<feBlend in="specular_saturated" in2="displaced" mode="normal" result="withSaturation"></feBlend>
<feBlend in="specular_faded" in2="withSaturation" mode="normal"></feBlend>
</filter>
</defs>
</svg>
<main id="auth" class="auth" hidden>
<div class="ac">
<div class="logo">
@@ -47,6 +26,7 @@
<form id="fIn" novalidate>
<label class="fld"><input id="lu" placeholder=" " autocomplete="username" required><span>Username</span></label>
<label class="fld"><input id="lp" type="password" placeholder=" " autocomplete="current-password" required><span>Password</span></label>
<div id="turnstileWidgetIn" class="turnstile-container" style="margin: 8px 0; min-height: 65px;"></div>
<div class="f-aux"><button type="button" class="btn-text" id="btnForgot">Forgot password?</button></div>
<button class="fb lg">Sign in</button>
</form>
@@ -55,6 +35,7 @@
<label class="fld"><input id="ru" placeholder=" " autocomplete="username" required><span>Username</span></label>
<label class="fld sel"><select id="rr"><option value="tester">Tester</option><option value="ios_dev">iOS Dev</option><option value="android_dev">Android Dev</option><option value="backend_dev">Backend Dev</option><option value="designer">Designer</option></select><span>Role</span></label>
<label class="fld"><input id="rp" type="password" placeholder=" " autocomplete="new-password" required><span>Password</span></label>
<div id="turnstileWidgetUp" class="turnstile-container" style="margin: 8px 0; min-height: 65px;"></div>
<button class="fb lg">Create account</button>
</form>
<div class="demo"><span>Demo accounts</span><button class="chip" data-d="charlie">Charlie (Tester)</button><button class="chip" data-d="alice">Alice (iOS)</button><button class="chip" data-d="bob">Bob (Backend)</button><button class="chip" data-d="diana">Diana (Android)</button><button class="chip" data-d="eva">Eva (Designer)</button><button class="chip" data-d="admin">Admin</button></div>
@@ -84,7 +65,6 @@
<button class="chip db-btn rollback" id="btnRollbackBackup" title="Rollback Primary DB from Backup DB"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-right:5px;vertical-align:middle"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg><span class="btn-txt">Rollback DB</span></button>
</div>
<button class="chip cmd-k-btn" id="btnCmdK" title="Command Palette (Cmd+K / Ctrl+K)"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-right:5px;vertical-align:middle"><path d="M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"/></svg><span class="btn-txt">⌘K</span></button>
<button class="chip lens-toggle-btn" id="btnToggleLens" title="Toggle Liquid Glass Precision Lens (kube.io)"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-right:5px;vertical-align:middle"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg><span class="btn-txt">Lens</span></button>
<button class="ib" id="btnShortcutsHelp" title="Keyboard Shortcuts (?)" aria-label="Shortcuts"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg></button>
<button class="ib" id="theme" aria-label="Toggle theme"><svg id="themeIcon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg></button>
<button class="ib" id="bell" aria-label="Notifications"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg><i id="dot" hidden></i></button>
@@ -196,14 +176,6 @@
</div>
</div>
<!-- Kube.io Liquid Glass Precision Lens Capsule -->
<div id="kubePrecisionLens" class="kube-lens-capsule" draggable="false" hidden>
<div class="kube-lens-drag-handle">
<div class="kube-lens-badge"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;margin-right:4px"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>Liquid Glass · 1.5x</div>
<button type="button" class="kube-lens-close" id="btnCloseLens" title="Close Lens">&times;</button>
</div>
</div>
<!-- Command Palette Modal -->
<div id="cmdPalette" class="cmd-palette-overlay" hidden>
<div class="cmd-palette-box">
+147 -186
View File
@@ -49,38 +49,31 @@
--sc-hi: rgba(22, 30, 46, 0.8);
--sc-hh: rgba(30, 41, 62, 0.9);
/* Ultra-smooth GPU Composited Glass Variables */
--glass-blur: blur(14px) saturate(180%) contrast(104%);
--glass-shadow:
0px 8px 30px rgba(0, 0, 0, 0.65),
inset 0px 1.5px 1.5px rgba(255, 255, 255, 0.28),
inset 0px -1px 2px rgba(0, 0, 0, 0.75);
--glass-shadow-hover:
0px 14px 44px rgba(0, 0, 0, 0.8),
0 0 20px rgba(16, 185, 129, 0.18),
inset 0px 2px 2px rgba(255, 255, 255, 0.45),
inset 0px -1px 2px rgba(255, 255, 255, 0.35);
--glass-shadow-lg:
0px 20px 60px rgba(0, 0, 0, 0.85),
inset 0px 2px 20px rgba(0, 0, 0, 0.35),
inset 0px -1px 2px rgba(255, 255, 255, 0.22);
/* Clean High-Performance Surface Variables */
--glass-blur: none;
--glass-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
--glass-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 16px rgba(16, 185, 129, 0.18);
--glass-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.75);
/* Prismatic Refraction Border Gradient */
--liquid-prism-border: linear-gradient(
135deg,
rgba(255, 255, 255, 0.55) 0%,
rgba(56, 189, 248, 0.35) 20%,
rgba(255, 255, 255, 0.08) 45%,
rgba(168, 85, 247, 0.25) 75%,
rgba(16, 185, 129, 0.35) 100%
);
--liquid-prism-border: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="light"] {
color-scheme: light;
--surf: #090c12;
--on-s: #f8fafc;
--on-sv: #94a3b8;
--surf: #f8fafc;
--obsidian-void: #ffffff;
--on-s: #0f172a;
--on-sv: #475569;
--out: rgba(0, 0, 0, 0.12);
--out-v: rgba(0, 0, 0, 0.06);
--sc-lo: #f1f5f9;
--sc: #e2e8f0;
--sc-hi: #cbd5e1;
--sc-hh: #94a3b8;
--sec-c: rgba(0, 0, 0, 0.05);
--glass-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
--glass-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
--glass-shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.15);
}
body {
@@ -617,6 +610,114 @@ button {
box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
}
/* ── Saved Views Filter Bar ── */
.saved-filter-bar {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 14px;
margin-bottom: 16px;
background: rgba(18, 24, 38, 0.6);
border: 1px solid var(--border-subtle);
border-radius: 12px;
overflow-x: auto;
scrollbar-width: none;
}
.sf-header {
display: flex;
align-items: center;
white-space: nowrap;
}
.saved-filter-label {
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--on-s-dim);
display: flex;
align-items: center;
gap: 4px;
}
.sf-items {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
overflow-x: auto;
scrollbar-width: none;
}
.sf-empty {
font-size: 12px;
color: var(--on-s-dim);
font-style: italic;
padding: 0 4px;
}
.saved-filter-pill {
display: inline-flex;
align-items: center;
background: rgba(255, 255, 255, 0.05);
border: 1px solid var(--border-subtle);
border-radius: 20px;
padding: 3px 10px;
font-size: 12px;
font-weight: 500;
color: var(--on-s);
cursor: pointer;
transition: all 0.15s ease;
white-space: nowrap;
user-select: none;
}
.saved-filter-pill:hover {
background: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.2);
}
.saved-filter-pill.active {
background: rgba(147, 197, 253, 0.15);
border-color: var(--pri);
color: #93c5fd;
font-weight: 600;
}
.sf-click {
cursor: pointer;
}
.sf-del {
background: transparent;
border: none;
color: var(--on-s-dim);
margin-left: 6px;
font-size: 14px;
line-height: 1;
padding: 0 2px;
cursor: pointer;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
transition: color 0.15s;
}
.sf-del:hover {
color: #ef4444;
}
.btn-save-filter {
display: inline-flex;
align-items: center;
gap: 4px;
background: transparent;
border: 1px dashed var(--border-subtle);
border-radius: 20px;
padding: 3px 10px;
font-size: 12px;
font-weight: 500;
color: var(--pri);
cursor: pointer;
transition: all 0.15s ease;
white-space: nowrap;
}
.btn-save-filter:hover {
background: rgba(147, 197, 253, 0.1);
border-color: var(--pri);
}
/* ── Luminous Obsidian Gem Badges ── */
.pb, .stt, .tag, .sv {
display: inline-flex;
@@ -684,19 +785,16 @@ button {
}
.col {
scroll-snap-align: start;
background: linear-gradient(180deg, rgba(16, 22, 34, 0.55) 0%, rgba(9, 12, 18, 0.75) 100%);
backdrop-filter: var(--glass-blur);
-webkit-backdrop-filter: var(--glass-blur);
border-radius: 28px;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.18);
background: rgba(14, 18, 28, 0.88);
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
padding: 10px 14px 18px;
display: flex;
flex-direction: column;
gap: 12px;
align-self: start;
min-width: 0;
transform: translateZ(0);
}
.col h3 {
display: flex;
@@ -715,54 +813,24 @@ button {
}
.col h3 small { margin-left: auto; font-size: 12px; color: var(--on-sv); }
/* ── Refractive Liquid Glass Card (Ultra Smooth 120 FPS) ── */
/* ── High-Performance Card ── */
.card {
position: relative;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 25%, transparent 60%),
linear-gradient(145deg, rgba(20, 26, 40, 0.72) 0%, rgba(8, 11, 18, 0.85) 100%);
backdrop-filter: var(--glass-blur);
-webkit-backdrop-filter: var(--glass-blur);
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(20, 26, 38, 0.95);
border-radius: 16px;
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: var(--glass-shadow);
padding: 16px;
display: grid;
gap: 10px;
cursor: pointer;
transition: transform 0.22s var(--e), box-shadow 0.22s var(--e), background 0.22s var(--e);
transform: translateZ(0);
transition: transform 0.18s var(--e), box-shadow 0.18s var(--e), border-color 0.18s var(--e);
overflow: hidden;
will-change: transform;
}
/* Prismatic Refraction Bezel Meniscus */
.card::before {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
border: 1px solid rgba(255, 255, 255, 0.1);
border-top: 1px solid rgba(255, 255, 255, 0.28);
pointer-events: none;
z-index: 2;
transition: opacity 0.2s var(--e);
}
.card:hover {
transform: translateY(-3px) scale(1.008);
transform: translateY(-2px);
border-color: rgba(16, 185, 129, 0.4);
box-shadow: var(--glass-shadow-hover);
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 25%, transparent 60%),
linear-gradient(145deg, rgba(24, 32, 48, 0.82) 0%, rgba(10, 14, 22, 0.92) 100%);
}
.card:hover::before {
background: linear-gradient(
135deg,
rgba(255, 255, 255, 0.8) 0%,
rgba(56, 189, 248, 0.55) 20%,
rgba(255, 255, 255, 0.15) 45%,
rgba(168, 85, 247, 0.4) 75%,
rgba(16, 185, 129, 0.5) 100%
);
}
.card h4 {
font-size: 15px;
@@ -780,7 +848,7 @@ button {
.empty { text-align: center; color: var(--on-sv); padding: 24px 8px; }
.anim .card, .anim .li { animation: rise .4s var(--e) both; animation-delay: calc(var(--i,0)*35ms); }
/* ── Refractive Liquid Glass List Items ── */
/* ── High-Performance List Items ── */
.list { display: grid; gap: 6px; }
.li {
position: relative;
@@ -789,38 +857,22 @@ button {
gap: 16px;
align-items: center;
padding: 14px 18px;
border-radius: 20px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 25%, transparent 60%),
linear-gradient(145deg, rgba(20, 26, 40, 0.72) 0%, rgba(8, 11, 18, 0.85) 100%);
backdrop-filter: var(--glass-blur);
-webkit-backdrop-filter: var(--glass-blur);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 16px;
background: rgba(20, 26, 38, 0.95);
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: var(--glass-shadow);
cursor: pointer;
text-align: left;
transition: transform 0.2s var(--e), box-shadow 0.2s var(--e), background 0.2s var(--e);
transform: translateZ(0);
transition: transform 0.18s var(--e), box-shadow 0.18s var(--e), background 0.18s var(--e);
overflow: hidden;
will-change: transform;
}
.li::before {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
border: 1px solid rgba(255, 255, 255, 0.08);
border-top: 1px solid rgba(255, 255, 255, 0.22);
pointer-events: none;
z-index: 2;
}
.li:hover {
transform: translateY(-2px);
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 25%, transparent 60%),
linear-gradient(145deg, rgba(24, 32, 48, 0.82) 0%, rgba(10, 14, 22, 0.92) 100%);
background: rgba(26, 34, 50, 0.98);
border-color: rgba(16, 185, 129, 0.4);
box-shadow: var(--glass-shadow-hover);
}
}
.lead {
width: 44px;
height: 44px;
@@ -1615,97 +1667,6 @@ dd { word-break: break-word; }
gap: 6px;
}
/* ══════════════════════════════════════════════════════════════════
KUBE.IO MAGNIFYING GLASS SECTION IMPLEMENTATION
Refraction lens with magnification zoom, edge deflection & specular bloom
══════════════════════════════════════════════════════════════════ */
.kube-lens-capsule {
position: fixed;
top: 0;
left: 0;
width: 210px;
height: 150px;
border-radius: 75px;
z-index: 9999;
cursor: grab;
backdrop-filter: url(#kube-magnifying-glass-filter);
-webkit-backdrop-filter: url(#kube-magnifying-glass-filter);
box-shadow:
0px 12px 42px rgba(0, 0, 0, 0.75),
inset 0px 2px 24px rgba(0, 0, 0, 0.4),
inset 0px -2px 24px rgba(255, 255, 255, 0.25);
border: 1px solid rgba(255, 255, 255, 0.22);
user-select: none;
-webkit-user-select: none;
touch-action: none;
transform: translate3d(240px, 180px, 0);
will-change: transform;
transition: transform 0.15s ease-out, box-shadow 0.2s ease;
}
.kube-lens-capsule:active {
cursor: grabbing;
box-shadow:
0px 24px 68px rgba(0, 0, 0, 0.9),
inset 0px 2px 28px rgba(0, 0, 0, 0.5),
inset 0px -2px 28px rgba(255, 255, 255, 0.35);
}
.kube-lens-drag-handle {
position: absolute;
top: 12px;
left: 14px;
right: 14px;
display: flex;
align-items: center;
justify-content: space-between;
pointer-events: auto;
}
.kube-lens-badge {
font-size: 11px;
font-weight: 600;
letter-spacing: 0.5px;
color: rgba(255, 255, 255, 0.95);
background: rgba(0, 0, 0, 0.5);
padding: 3px 10px;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.18);
backdrop-filter: blur(8px);
pointer-events: none;
display: inline-flex;
align-items: center;
}
.kube-lens-close {
background: rgba(0, 0, 0, 0.55);
border: 1px solid rgba(255, 255, 255, 0.2);
color: #fff;
width: 22px;
height: 22px;
border-radius: 50%;
display: grid;
place-items: center;
font-size: 15px;
line-height: 1;
cursor: pointer;
transition: all 0.2s;
}
.kube-lens-close:hover {
background: rgba(239, 68, 68, 0.85);
border-color: rgba(239, 68, 68, 1);
transform: scale(1.1);
}
.lens-toggle-btn {
display: inline-flex;
align-items: center;
gap: 6px;
transition: all 0.25s var(--e);
}
.lens-toggle-btn.on {
background: rgba(16, 185, 129, 0.22);
border-color: rgba(16, 185, 129, 0.55);
color: #34d399;
box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}
/* ══════════════════════════════════════════════════════════════════════════════
ENTERPRISE SUITE STYLES (Analytics, SLA, Bulk Actions, Admin, Cmd+K, Tags)
══════════════════════════════════════════════════════════════════════════════ */