cocalc
cocalc copied to clipboard
AI dialog says it will include the cell, but includes the whole notebook
This is default/starting view for a notebook that has 5 cells with numbers 1-5, the focus is on the last empty cell. The dialog highlights "Cell", which makes perfect sense, but that's not what is shown as the context. Switching back and forth does show just the cell above.
Correction - if you are focused on an EMPTY cell, the "Cell" selector means "Everything above", while "All" means all. There is little difference for the last cell. I think there should be an option called "Cell" which means "the current cell unless it is empty, in which case use the previous (non-empty?..) cell", and it should be the default. "All above" is also very useful, inclusion of the current one is questionable. And "All" should mean all.
In the cell-generator, there is a heuristic that should pick the previous non-empty code cell. I think that's what you mean when you say "previous cell" ? The reason is, it's meant to make a follow up to what you just coded.
For this dialog here, I could easily see that there is also a numeric range selector, which starts at "1" for the first previous non-empty cell, and you can click a few times to include more previous cells as context.
If we do go the more complicated round, I think it would be better then to have a double slider from the first cell to the last one and the buttons then serve as "presets". I am not sure, however, that such a feature would be used, while it may look a bit intimidating and complicated.
Yes, if we are only going to send a single cell, the last non-empty code cell is likely to be the most relevant one. I wonder, however, if it makes sense to include comments? If the comments explain what is going to happen, they may be useful to guide the code continuation. That's just a speculation, however.
The main issue with this ticket is that "Cell" does not select a single cell, as its name implies.
The code is completely different now and doesn't have this bug.