Compare commits

..

1 Commits

Author SHA1 Message Date
Penar Musaraj
63eee677cd
UX: Some very minor WCAG scheme fixes 2023-03-17 15:15:33 -04:00
5 changed files with 21 additions and 33 deletions

View File

@ -8,15 +8,16 @@
}
html.discourse-no-touch {
.btn-default:not(.btn-flat),
.btn-icon:not(.btn-flat) {
.btn-default:not(.btn-flat, .btn-danger, .btn-primary),
.btn-icon:not(.btn-flat, .btn-danger, .btn-primary) {
&.btn-default {
.d-icon {
color: var(--primary-medium);
}
}
&:hover,
&.btn-hover {
&.btn-hover,
&:focus {
.d-icon {
color: var(--secondary);
}
@ -27,7 +28,7 @@ html.discourse-no-touch {
}
.btn-icon.ok,
.btn-icon.cancel,
.btn-danger {
.btn-danger:not(.btn-flat) {
.d-icon {
color: var(--secondary);
}
@ -42,6 +43,10 @@ html.discourse-no-touch {
}
}
}
.select-kit.single-select .select-kit-header:focus {
border-color: var(--primary-medium);
}
}
html {

View File

@ -613,7 +613,6 @@ export default class ChatLivePane extends Component {
const message = ChatMessage.create(this.args.channel, data.chat_message);
this.args.channel.addMessages([message]);
this.scrollToLatestMessage();
this.updateLastReadMessage();
} else {
// If we are almost at the bottom, we append the message and notice the user
const message = ChatMessage.create(this.args.channel, data.chat_message);
@ -896,19 +895,16 @@ export default class ChatLivePane extends Component {
@action
editLastMessageRequested() {
const lastUserMessage = this.args.channel.messages.findLast(
(message) => message.user.id === this.currentUser.id
(message) =>
message.user.id === this.currentUser.id &&
!message.staged &&
!message.error
);
if (!lastUserMessage) {
return;
if (lastUserMessage) {
this.editingMessage = lastUserMessage;
this._focusComposer();
}
if (lastUserMessage.staged || lastUserMessage.error) {
return;
}
this.editingMessage = lastUserMessage;
this._focusComposer();
}
@action

View File

@ -384,7 +384,6 @@ $float-height: 530px;
.d-icon {
color: var(--secondary);
margin-left: 1px; // "fixes" the 1px svg shift
}
}

View File

@ -56,9 +56,7 @@
}
.chat-message-separator__text-container {
align-items: center;
display: flex;
height: 40px;
padding-top: 7px;
position: sticky;
top: -1px;
@ -100,7 +98,11 @@
.chat-message-separator__line {
border-top: 1px solid var(--secondary-high);
left: 0;
margin: 0 0 -1px;
position: relative;
right: 0;
top: -1px;
}
}
}

View File

@ -70,19 +70,5 @@ RSpec.describe "Shortcuts | chat composer", type: :system, js: true do
expect(page.find(".chat-composer-message-details")).to have_content(message_1.message)
end
context "when last message is not editable" do
after { page.driver.browser.network_conditions = { offline: false } }
it "does not edit a message" do
chat.visit_channel(channel_1)
page.driver.browser.network_conditions = { offline: true }
channel_page.send_message("Hello world")
find(".chat-composer-input").send_keys(:arrow_up)
expect(page).to have_no_css(".chat-composer-message-details")
end
end
end
end