Design tweaks, issue modal.

This commit is contained in:
Chris McCormick 2026-01-03 21:13:51 +08:00
parent 8ebac3d97d
commit cd471f9697

View file

@ -279,6 +279,13 @@
flex-grow: 1; flex-grow: 1;
} }
.card-expand-indicator {
color: var(--shade);
font-size: 1.2em;
line-height: 1;
margin-left: 0.25em;
}
.card-menu-btn { .card-menu-btn {
width: 1.5em; width: 1.5em;
height: 1.5em; height: 1.5em;
@ -628,6 +635,7 @@
max-height: 90%; max-height: 90%;
overflow-y: auto; overflow-y: auto;
min-width: 400px; min-width: 400px;
width: 1024px;
} }
.modal-content h3 { .modal-content h3 {
@ -718,6 +726,13 @@
ul { ul {
list-style: square; list-style: square;
} }
.card-detail-content {
white-space: pre-wrap;
font-family: monospace;
text-align: left;
line-height: 1.6;
}
</style> </style>
</head> </head>
<body> <body>
@ -821,6 +836,16 @@ chmod 755 kbtd
</div> </div>
</div> </div>
<div id="card-detail-modal" class="modal">
<div class="modal-content">
<h3 id="card-detail-title">Card Details</h3>
<div class="card-detail-content" id="card-detail-content"></div>
<div class="modal-buttons">
<button id="card-detail-close-btn">Close</button>
</div>
</div>
</div>
<div id="about-modal" class="modal"> <div id="about-modal" class="modal">
<div class="modal-content"> <div class="modal-content">
<h3>About Kanban TODO</h3> <h3>About Kanban TODO</h3>
@ -1075,10 +1100,13 @@ chmod 755 kbtd
} }
else { else {
if (currentCard) { if (currentCard) {
const isIndented = line.startsWith(' ') || line.startsWith('\t');
if (isIndented) {
currentCard.nestedLines.push(line); currentCard.nestedLines.push(line);
} }
} }
} }
}
finishCard(); finishCard();
return sections; return sections;
} }
@ -1515,6 +1543,17 @@ chmod 755 kbtd
}; };
} }
function openCardDetailModal(card) {
$('#card-detail-title').textContent = card.text;
const fullText = [card.originalLine, ...card.nestedLines].join('\n');
$('#card-detail-content').textContent = fullText;
$('#card-detail-modal').classList.add('active');
}
function closeCardDetailModal() {
$('#card-detail-modal').classList.remove('active');
}
function openAboutModal() { function openAboutModal() {
$('#about-modal').classList.add('active'); $('#about-modal').classList.add('active');
} }
@ -1576,6 +1615,8 @@ chmod 755 kbtd
column.cards.forEach((card, cardIndex) => { column.cards.forEach((card, cardIndex) => {
if (!state.showCompleted && card.completed) return; if (!state.showCompleted && card.completed) return;
const hasNestedContent = card.nestedLines.length > 0;
const cardDiv = h('div', { const cardDiv = h('div', {
className: `card ${card.completed ? 'completed' : ''}`, className: `card ${card.completed ? 'completed' : ''}`,
draggable: true, draggable: true,
@ -1587,13 +1628,27 @@ chmod 755 kbtd
}, },
ondragstart: (e) => handleDragStart(e, cardDiv), ondragstart: (e) => handleDragStart(e, cardDiv),
ondragend: handleDragEnd, ondragend: handleDragEnd,
ondragenter: (e) => handleCardDragEnter(e, cardDiv, colIndex, cardIndex) ondragenter: (e) => handleCardDragEnter(e, cardDiv, colIndex, cardIndex),
onclick: (e) => {
if (hasNestedContent && !e.target.closest('.card-menu-btn')) {
openCardDetailModal(card);
}
}
}); });
if (hasNestedContent) {
cardDiv.style.cursor = 'pointer';
}
const expandIndicator = hasNestedContent ?
h('span', {
className: 'card-expand-indicator',
textContent: '+'
}) : null;
const cardText = h('span', { const cardText = h('span', {
className: 'card-text', className: 'card-text'
textContent: card.text }, card.text, expandIndicator);
});
const menuBtn = h('button', { const menuBtn = h('button', {
className: 'card-menu-btn', className: 'card-menu-btn',
@ -1902,6 +1957,9 @@ chmod 755 kbtd
if (e.target.id === 'about-modal') { if (e.target.id === 'about-modal') {
closeAboutModal(); closeAboutModal();
} }
if (e.target.id === 'card-detail-modal') {
closeCardDetailModal();
}
}); });
async function openRecentProject(projectName) { async function openRecentProject(projectName) {
@ -2130,6 +2188,10 @@ chmod 755 kbtd
closeAboutModal(); closeAboutModal();
}; };
$('#card-detail-close-btn').onclick = () => {
closeCardDetailModal();
};
$('#change-file-btn').onclick = () => { $('#change-file-btn').onclick = () => {
showScreen('landing-screen'); showScreen('landing-screen');
$('#project-name-input').value = state.filePath || ''; $('#project-name-input').value = state.filePath || '';