Compare commits

...

5 Commits

Author SHA1 Message Date
a2303841ec fix: Show 'Convert Code to Paragraph' button for <code> elements
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
2025-12-03 01:37:08 +00:00
0e7aedbc5e fix: Adjust spacing below comment text content
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
2025-12-03 01:28:10 +00:00
ec7d395407 fix: Wrap text in <pre> blocks to prevent horizontal overflow
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
2025-12-03 00:58:39 +00:00
fd5acd4861 refactor: Convert 'show more' div to semantic button
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
2025-12-03 00:50:58 +00:00
b1d4fc2903 refactor: Convert collapser span to button for accessibility
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
2025-12-03 00:48:22 +00:00
3 changed files with 35 additions and 3 deletions

View File

@@ -105,7 +105,7 @@ function Article({ cache }) {
: :
<React.Fragment key={k}> <React.Fragment key={k}>
<v.localName dangerouslySetInnerHTML={v.innerHTML ? { __html: v.innerHTML } : null} /> <v.localName dangerouslySetInnerHTML={v.innerHTML ? { __html: v.innerHTML } : null} />
{v.localName === 'pre' && <button onClick={() => pConvert(k)}>Convert Code to Paragraph</button>} {(v.localName === 'pre' || v.localName === 'code') && <button onClick={() => pConvert(k)}>Convert Code to Paragraph</button>}
</React.Fragment> </React.Fragment>
) )
)} )}

View File

@@ -85,7 +85,7 @@ function Comments({ cache }) {
{' '} | <HashLink to={'#'+cid} id={cid}>{moment.unix(c.date).fromNow()}</HashLink> {' '} | <HashLink to={'#'+cid} id={cid}>{moment.unix(c.date).fromNow()}</HashLink>
{hidden || hasChildren && {hidden || hasChildren &&
<span className='collapser pointer' onClick={() => collapseComment(cid)}></span> <button className='collapser pointer' onClick={() => collapseComment(cid)}></button>
} }
</p> </p>
</div> </div>
@@ -93,7 +93,7 @@ function Comments({ cache }) {
<div className={isCollapsed ? 'text hidden' : 'text'} dangerouslySetInnerHTML={{ __html: c.text || '<p>[Empty / deleted comment]</p>'}} /> <div className={isCollapsed ? 'text hidden' : 'text'} dangerouslySetInnerHTML={{ __html: c.text || '<p>[Empty / deleted comment]</p>'}} />
{hidden && hasChildren ? {hidden && hasChildren ?
<div className='comment lined info pointer' onClick={() => expandComment(cid)}>[show {countComments(c)-1} more]</div> <button className='comment lined info pointer' onClick={() => expandComment(cid)}>[show {countComments(c)-1} more]</button>
: :
c.comments.map(i => displayComment(story, i, level + 1)) c.comments.map(i => displayComment(story, i, level + 1))
} }

View File

@@ -51,6 +51,8 @@ input {
pre { pre {
overflow: auto; overflow: auto;
white-space: pre-wrap;
overflow-wrap: break-word;
} }
.container { .container {
@@ -196,6 +198,11 @@ span.source {
.comment .text { .comment .text {
margin-top: -0.5rem; margin-top: -0.5rem;
margin-bottom: 1rem;
}
.comment .text > * {
margin-bottom: 0;
} }
.comment .text.hidden > p { .comment .text.hidden > p {
@@ -215,6 +222,31 @@ span.source {
padding-right: 1.5rem; padding-right: 1.5rem;
} }
button.collapser {
background: transparent;
border: none;
margin: 0;
padding-top: 0;
padding-bottom: 0;
font: inherit;
color: inherit;
}
button.comment {
background: transparent;
border-top: none;
border-right: none;
border-bottom: none;
margin: 0;
padding-top: 0;
padding-right: 0;
padding-bottom: 0;
font: inherit;
color: inherit;
text-align: left;
width: 100%;
}
.comment .pointer { .comment .pointer {
cursor: pointer; cursor: pointer;
} }