Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically executed reset: moving to HEAD, Resulting in all temporary storage areas being cleared. #4112

Open
guan6 opened this issue Dec 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@guan6
Copy link

guan6 commented Dec 13, 2024

Describe the bug
Automatically executed reset: moving to HEAD, Resulting in all temporary storage areas being cleared.

To Reproduce

No fixed operation was found to cause this issue, it appears to be random and sometimes occurs when executing the add operation on the bar or when saving files in the editor.

Expected behavior
This error is too dangerous and may cause several hours of work to go to zero. I hope to investigate.

Screenshots
Reset in screenshot: moving to HEAD, All of them are executed suddenly and automatically. It seems that there are as many files that have not been submitted as there are here.

image

Version info:
lazygit:0.44.1
git:2.47.0
os:macos(15.2 (24C101))
terminal:item2 (3.5.10)

@guan6 guan6 added the bug Something isn't working label Dec 13, 2024
@guan6
Copy link
Author

guan6 commented Dec 13, 2024

It seems to be related to the following code. After modifying the content of this file and selecting it in the temporary storage area, this problem will occur. Below are the relevant documents and screen recordings.

output.mp4
<script setup lang="ts">
import { ref, computed } from 'vue'
import { placeholderStyle } from '@/common/utils'

type InputOption = {
  id?: string,
  modelValue?: string | number,
  title?: string
  placeholder?: string
  required?: boolean
  type?: string
  uiActive?: boolean
  suffixBtnVisible?: boolean
  disabled?: boolean
  max?: number
}

const props = withDefaults(defineProps<InputOption>(), {
  id: '',
  modelValue: '',
  title: '',
  placeholder: '',
  required: true,
  type: 'text',
  uiActive: true,
  suffixBtnVisible: true,
  disabled: false,
  max: -1
})

const emit = defineEmits<{
  (e: 'update:modelValue', v: number|string): void
}>()

function inputChange(ev:any){
  emit('update:modelValue', ev.detail.value)
}

const normalInput = computed(() =>{
  return props.type !== 'password'
})

const passwordInput = computed(() => {
  return props.type === 'password'
})

function clear(){
  emit('update:modelValue', '')
}

const showPwd = ref(false)
</script>

<template>
  <label :for="id" class="weui-cell" :class="{'weui-cell_active': uiActive }">
    <view class="weui-cell__hd" v-if="title">
      <view class="weui-label">{{title}}<text class="required" v-if="required">*</text></view>
    </view>
    <view class="weui-cell__bd">
      <input :id="id" :type="showPwd ? 'text' : type" class="weui-input" :placeholderStyle="placeholderStyle" :value="modelValue" :placeholder="placeholder" :maxlength="max" :disabled="disabled" @input="inputChange">
    </view>
    <view class="weui-cell__ft" v-if="suffixBtnVisible" :class="{visible: (modelValue && normalInput && !disabled) || passwordInput }">
      <Iconfont icon="icon-qingchu" v-if="modelValue && normalInput && !disabled" @tap="clear" />
      <Iconfont :icon="showPwd ? 'icon-chakan' : 'icon-biyan'" v-if="passwordInput" @tap="showPwd = !showPwd" />
    </view>
    <view class="weui-cell__ft slot" v-if="$slots.default">
      <slot />
    </view>
  </label>
</template>

<style lang="scss" scoped>
@import '@/common/styles/vars/var.scss';
.required{
  color: $error-color;
  position: relative;
  top: 3.5rpx;
}
.weui-cell__ft{
  position: relative;
  &.slot{
    margin-left: 10rpx;
  }
  &.visible{
    width: 70rpx;
  }
  .iconfont{
    color: $description-color;
    padding: 15rpx 32rpx;
    position: absolute;
    right: -32rpx;
    top: 50%;
    transform: translate(0, -50%);
    &::before{
      vertical-align: middle;
    }
  }
}
</style>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant